diff options
author | dan <Dan Kennedy> | 2024-06-12 17:01:00 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2024-06-12 17:01:00 +0000 |
commit | 0d92e66dfc42e23cf07fdf01b37f1bcbd0d8b6b9 (patch) | |
tree | 5db7941e43db4538da6cafed227b9519c1c346a5 /test | |
parent | ddc62664bfb5e3237b20098b30e4a99815c322e0 (diff) | |
download | sqlite-0d92e66dfc42e23cf07fdf01b37f1bcbd0d8b6b9.tar.gz sqlite-0d92e66dfc42e23cf07fdf01b37f1bcbd0d8b6b9.zip |
Do not attempt the exists-to-join optimization for expressions from the ON clause of joins.
FossilOrigin-Name: 4666433cbd9af21c2e0440b10bcb39878624a39485e2bb514553b276acb8a401
Diffstat (limited to 'test')
-rw-r--r-- | test/existsexpr.test | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/existsexpr.test b/test/existsexpr.test index a5f60b944..81aa5799f 100644 --- a/test/existsexpr.test +++ b/test/existsexpr.test @@ -404,6 +404,23 @@ do_catchsql_test 6.1 { SELECT a FROM t1 WHERE EXISTS (SELECT 1 FROM t2 WHERE c COLLATE f = a) } {1 {no such collation sequence: f}} +#------------------------------------------------------------------------- +reset_db +do_execsql_test 7.0 { + CREATE TABLE t1(x); + CREATE TABLE t2(y UNIQUE); + + INSERT INTO t1 VALUES(1), (2); + INSERT INTO t2 VALUES(1), (3); + + SELECT * FROM t1 one LEFT JOIN t1 two ON (one.x=two.x AND EXISTS ( + SELECT 1 FROM t2 WHERE y=one.x + )); +} { + 1 1 + 2 {} +} + finish_test |