mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-24 03:34:18 +01:00
Fix evaluation of ISNULL/NOTNULL in OR expressions
Previously, the `jump_if_condition_is_true` flag was not respected. As a result, for expressions like <`ISNULL`/`NOTNULL`> `OR` <rhs>, the <rhs> expression was evaluated even when the left-hand side was true, and its value was incorrectly used as the final result.
This commit is contained in:
@@ -62,10 +62,18 @@ do_execsql_test where-clause-isnull {
|
||||
select count(1) from users where last_name isnull;
|
||||
} {0}
|
||||
|
||||
do_execsql_test where-clause-isnull-or-false {
|
||||
select count(1) from users where null isnull or 1 != 1;
|
||||
} {10000}
|
||||
|
||||
do_execsql_test where-clause-notnull {
|
||||
select count(1) from users where last_name not null;
|
||||
} {10000}
|
||||
|
||||
do_execsql_test where-clause-notnull-or-false {
|
||||
select count(1) from users where last_name not null or 1 != 1;
|
||||
} {10000}
|
||||
|
||||
do_execsql_test where-clause-ne {
|
||||
select count(1) from users where id != 2000;
|
||||
} {9999}
|
||||
|
||||
Reference in New Issue
Block a user