Skip to content

Commit 6cf262a

Browse files
committed
fix(odbc): use IS NOT DISTINCT FROM for NULL-safe comparisons in tests
1 parent bf991cc commit 6cf262a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sqlx-test/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ macro_rules! Postgres_query_for_test_prepared_type {
227227
#[macro_export]
228228
macro_rules! Odbc_query_for_test_prepared_type {
229229
() => {
230-
"SELECT CASE WHEN {0} = ? THEN 1 ELSE 0 END, {0}, ?"
230+
// Most ODBC drivers support standard SQL syntax for NULL-safe comparison
231+
"SELECT CASE WHEN {0} IS NOT DISTINCT FROM ? THEN 1 ELSE 0 END, {0}, ?"
231232
};
232233
}

0 commit comments

Comments
 (0)