diff options
author | drh <drh@noemail.net> | 2020-01-01 16:43:41 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2020-01-01 16:43:41 +0000 |
commit | aef81674211ab2f0f93852e3e9ca3bebb7e77c0b (patch) | |
tree | eedb3cda0c05246d86049b43182a871b5a3a5d75 /test/expr.test | |
parent | 171c50ec381c5fb4ff1e8b258a49fbf810917011 (diff) | |
download | sqlite-aef81674211ab2f0f93852e3e9ca3bebb7e77c0b.tar.gz sqlite-aef81674211ab2f0f93852e3e9ca3bebb7e77c0b.zip |
Fix the sqlite3ExprImpliesNonNullRow() routine so that it correctly
handles a numeric comparison of two AND subexpressions.
FossilOrigin-Name: 07e504d5174a1a8b1aa05ec5b44ac81ab3ea706c5a098caa88deb3d489cec8fb
Diffstat (limited to 'test/expr.test')
-rw-r--r-- | test/expr.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/expr.test b/test/expr.test index 3cdc9180e..ec5c55c2e 100644 --- a/test/expr.test +++ b/test/expr.test @@ -1036,4 +1036,24 @@ foreach {tn val} [list 1 NaN 2 -NaN 3 NaN0 4 -NaN0 5 Inf 6 -Inf] { } {0} } +reset_db +sqlite3_test_control SQLITE_TESTCTRL_INTERNAL_FUNCTIONS db +do_execsql_test expr-16.1 { + CREATE TABLE t1(a,b,c); + CREATE TABLE dual(dummy); + INSERT INTO dual VALUES('X'); +} {} +do_execsql_test expr-16.100 { + SELECT implies_nonnull_row( (b=1 AND 0)>(b=3 AND 0),a) + FROM dual LEFT JOIN t1; +} {0} +do_execsql_test expr-16.101 { + SELECT implies_nonnull_row( (b=1 AND 0)>(b=3 AND a=4),a) + FROM dual LEFT JOIN t1; +} {1} +do_execsql_test expr-16.102 { + SELECT implies_nonnull_row( (b=1 AND a=2)>(b=3 AND a=4),a) + FROM dual LEFT JOIN t1; +} {1} + finish_test |