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

Do not assume an index contains unique entries unless it is declared UNIQUE and NOT NULL is specified for all columns. Fix for [7b4fee9f6c].

FossilOrigin-Name: e3b1f625518edc0e925116668dca5d25c3232b59
This commit is contained in:
dan
2015-04-11 11:44:27 +00:00
parent 4a33507f60
commit 2813bde028
4 changed files with 27 additions and 10 deletions

View File

@ -278,6 +278,23 @@ do_test null-8.15 {
}
} {1}
do_execsql_test null-9.1 {
CREATE TABLE t5(a, b, c);
CREATE UNIQUE INDEX t5ab ON t5(a, b);
INSERT INTO t5 VALUES(1, NULL, 'one');
INSERT INTO t5 VALUES(1, NULL, 'i');
INSERT INTO t5 VALUES(NULL, 'x', 'two');
INSERT INTO t5 VALUES(NULL, 'x', 'ii');
}
do_execsql_test null-9.2 {
SELECT * FROM t5 WHERE a = 1 AND b IS NULL;
} {1 {} one 1 {} i}
do_execsql_test null-9.3 {
SELECT * FROM t5 WHERE a IS NULL AND b = 'x';
} {{} x two {} x ii}
finish_test