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

Function test_implicit_cast_update_assignment

tests/implicit_cast_test.rs:162–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160
161#[test]
162fn test_implicit_cast_update_assignment() {
163 let conn = setup_test_db();
164
165 // Test: UPDATE with implicit cast in SET clause
166 let sql = "UPDATE products SET price = price * 1.1 WHERE category_id = '5'";
167 let result = rewrite_query(&conn, sql).unwrap();
168
169 // Debug: print the rewritten query
170 println!("Rewritten UPDATE query: {result}");
171
172 // Should handle multiplication and comparison
173 assert!(result.contains("decimal_mul"));
174 assert!(result.contains("decimal_eq"));
175}
176
177#[test]
178fn test_no_implicit_cast_when_types_match() {

Callers

nothing calls this directly

Calls 2

setup_test_dbFunction · 0.70
rewrite_queryFunction · 0.70

Tested by

no test coverage detected