MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_mixed_table_queries

Function test_mixed_table_queries

tests/decimal_optimization_test.rs:114–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112
113#[test]
114fn test_mixed_table_queries() {
115 let conn = setup_test_db();
116
117 // JOIN between decimal and non-decimal tables - should be rewritten
118 let sql = "SELECT u.name, p.price
119 FROM users u
120 JOIN products p ON u.id = p.id
121 WHERE p.price > 50";
122 let result = rewrite_query(&conn, sql).unwrap();
123 println!("Mixed table query rewritten to: {result}");
124 assert!(result.contains("decimal_gt"));
125
126 // But operations on non-decimal columns should not be wrapped
127 assert!(!result.contains("decimal_from_text(u.id)"));
128}
129
130#[test]
131fn test_subquery_optimization() {

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected