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

Avoid assuming that "column IS ?", where column is declared UNIQUE, matches only a single row (as "?" might be NULL). Fix for [b8689402].

FossilOrigin-Name: d02490a2f0cae047087130b4ad8f55f265845c2ffb3bde3b7d507edb54acea6d
This commit is contained in:
dan
2019-08-21 14:54:50 +00:00
parent 6fcb9f3ad9
commit f7c92e82d2
4 changed files with 43 additions and 11 deletions

View File

@ -274,6 +274,32 @@ do_execsql_test 2040 {
two 1 1
}
#-------------------------------------------------------------------------
#
reset_db
do_execsql_test 3000 {
CREATE TABLE t0 (c0, c1 NOT NULL DEFAULT 1, c2, PRIMARY KEY (c0, c1));
INSERT INTO t0(c2) VALUES (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL);
INSERT INTO t0(c2) VALUES('a');
}
do_execsql_test 3010 {
SELECT DISTINCT * FROM t0 WHERE NULL IS t0.c0;
} {
{} 1 {}
{} 1 a
}
do_execsql_test 3020 {
ANALYZE;
}
do_execsql_test 3030 {
SELECT DISTINCT * FROM t0 WHERE NULL IS c0;
} {
{} 1 {}
{} 1 a
}
finish_test