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

Fix a problem where the loop for the RHS of a LEFT JOIN uses values from an IN() clause as the second or subsequent field of an index.

FossilOrigin-Name: 95ef68966c50f311830cba8c9257a4085c93011d205e0e31867c2917fa62a48e
This commit is contained in:
dan
2020-01-04 16:55:57 +00:00
parent f6ea97ea3d
commit 74ebaadcdd
6 changed files with 70 additions and 17 deletions

View File

@ -13,6 +13,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix in4
do_test in4-1.1 {
execsql {
@ -338,5 +339,28 @@ do_execsql_test in4-6.2-eqp {
SELECT * FROM t6a, t6b WHERE a=3 AND c IN (b);
} {~/SCAN/}
reset_db
do_execsql_test 7.0 {
CREATE TABLE t1(a, b, c);
CREATE TABLE t2(d, e);
CREATE INDEX t1bc ON t1(c, b);
INSERT INTO t2(e) VALUES(1);
INSERT INTO t1 VALUES(NULL, NULL, NULL);
}
do_execsql_test 7.1 {
SELECT * FROM t2 LEFT JOIN t1 ON c = d AND b IN (10,10,10);
} {{} 1 {} {} {}}
reset_db
do_execsql_test 7.2 {
CREATE VIRTUAL TABLE t1 USING rtree(a, b, c);
CREATE TABLE t2(d INTEGER, e INT);
INSERT INTO t2(e) VALUES(1);
}
do_execsql_test 7.3 {
SELECT * FROM t2 LEFT JOIN t1 ON c IN (d) AND b IN (10,10,10);
} {{} 1 {} {} {}}
finish_test