1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Disable the IS NOT NULL optimization when the IS NOT NULL operator is part

of the ON clause of a LEFT JOIN. Fix for ticket [65eb38f6e46de8c75e188a17ec].

FossilOrigin-Name: af39661e60f562b9eb10343fd83e8fe21be4d7276111e7853c1179a24cab09ce
This commit is contained in:
drh
2018-11-05 07:53:17 +00:00
parent 29d77dc450
commit 383bb4fa62
4 changed files with 23 additions and 9 deletions

View File

@ -1413,4 +1413,17 @@ do_execsql_test where-21.1 {
4 0 1
}
# 2018-11-05: ticket [https://www.sqlite.org/src/tktview/65eb38f6e46de8c75e188a]
# Incorrect result in LEFT JOIN when STAT4 is enabled.
#
sqlite3 db :memory:
do_execsql_test where-22.1 {
CREATE TABLE t1(a INT);
CREATE INDEX t1a ON t1(a);
INSERT INTO t1(a) VALUES(NULL),(NULL),(42),(NULL),(NULL);
CREATE TABLE t2(dummy INT);
SELECT count(*) FROM t1 LEFT JOIN t2 ON a IS NOT NULL;
} {5}
finish_test