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

Function test_union_optimization

tests/decimal_optimization_test.rs:194–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192
193#[test]
194fn test_union_optimization() {
195 let conn = setup_test_db();
196
197 // UNION of non-decimal tables
198 let sql = "SELECT name FROM users
199 UNION
200 SELECT name FROM categories";
201 let result = rewrite_query(&conn, sql).unwrap();
202 assert!(!result.contains("decimal_"));
203
204 // UNION involving decimal table
205 let sql = "SELECT name FROM users
206 UNION
207 SELECT name FROM products WHERE price > 50";
208 let result = rewrite_query(&conn, sql).unwrap();
209 assert!(result.contains("decimal_gt"));
210}

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected