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:
@ -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
|
||||
|
Reference in New Issue
Block a user