1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

When we play games with COLLATE in order to commute an operator in the

WHERE clause processing, be sure not to use the commuted operator to qualify
a partial index, as insufficient COLLATE information is preserved to verify
that the expression will correctly qualify the index.
Ticket [767a8cbc6d20bd68]

FossilOrigin-Name: 5351e920f489562f959ab8a376ff720f845ea165e0cdc7c3a271aac53c2aa64a
This commit is contained in:
drh
2019-09-03 14:27:25 +00:00
parent 4fc836546e
commit c7d12f4ad4
6 changed files with 43 additions and 13 deletions

View File

@@ -462,5 +462,23 @@ do_execsql_test index6-15.5 {
SELECT 1 FROM t0 WHERE (c0 IS FALSE) IN (FALSE);
} {1}
# 2019-09-03
# Ticket https://sqlite.org/src/info/767a8cbc6d20bd68
do_execsql_test index6-16.1 {
DROP TABLE t0;
CREATE TABLE t0(c0 COLLATE NOCASE, c1);
CREATE INDEX i0 ON t0(0) WHERE c0 >= c1;
INSERT INTO t0 VALUES('a', 'B');
SELECT c1 <= c0, c0 >= c1 FROM t0;
} {1 0}
do_execsql_test index6-16.2 {
SELECT 2 FROM t0 WHERE c0 >= c1;
} {}
do_execsql_test index6-16.3 {
SELECT 3 FROM t0 WHERE c1 <= c0;
} {3}
finish_test