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

Function test_cte_optimization

tests/decimal_optimization_test.rs:172–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170
171#[test]
172fn test_cte_optimization() {
173 let conn = setup_test_db();
174
175 // CTE with only non-decimal tables
176 let sql = "WITH active_users AS (
177 SELECT * FROM users WHERE active = 1
178 )
179 SELECT * FROM active_users WHERE age > 30";
180 let result = rewrite_query(&conn, sql).unwrap();
181 // Should remain unchanged
182 assert!(!result.contains("decimal_"));
183
184 // CTE with decimal table
185 let sql = "WITH expensive_products AS (
186 SELECT * FROM products WHERE price > 100
187 )
188 SELECT * FROM expensive_products";
189 let result = rewrite_query(&conn, sql).unwrap();
190 assert!(result.contains("decimal_gt"));
191}
192
193#[test]
194fn test_union_optimization() {

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected