Do not allow EP_InnerON terms to be used on a outer join.

FossilOrigin-Name: f47aa745690c018800243bf76930b2499ff4537411c4e27b4b16ba3854cc2bf8
This commit is contained in:
drh 2022-09-20 22:19:13 +00:00
parent 0cc6f78bcf
commit 0f51aa3972
4 changed files with 15 additions and 10 deletions

View File

@ -1,5 +1,5 @@
C Add\snew\stest\scases\sthat\s(current)\sget\san\sincorrect\sanswer.
D 2022-09-20T21:07:52.356
C Do\snot\sallow\sEP_InnerON\sterms\sto\sbe\sused\son\sa\souter\sjoin.
D 2022-09-20T22:19:13.998
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -675,7 +675,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c b9df133a705093da8977da5eb202eaadb844839f1c7297c08d33471f5491843d
F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
F src/walker.c f890a3298418d7cba3b69b8803594fdc484ea241206a8dfa99db6dd36f8cbb3b
F src/where.c 424c42590b71968a9b81cd890df2671902028613fee38a50ed4c2f7ca65315d3
F src/where.c 075de11bb3a7be19cfe27e104d52e19d30096925ef2524341bf5a6bfcdbc4127
F src/whereInt.h 70cd30de9ed784aa33fa6bd1245f060617de7a00d992469b6d8e419eed915743
F src/wherecode.c 6bb1cf9d0a4e3e04dab0bf0ea4a8d936a0dcc05a7e2207beeda6c61aea6dd341
F src/whereexpr.c 55a39f42aaf982574fbf52906371a84cceed98a994422198dfd03db4fce4cc46
@ -1180,7 +1180,7 @@ F test/ioerr4.test f130fe9e71008577b342b8874d52984bd04ede2c
F test/ioerr5.test 2edfa4fb0f896f733071303b42224df8bedd9da4
F test/ioerr6.test a395a6ab144b26a9e3e21059a1ab6a7149cca65b
F test/istrue.test e7f285bb70282625c258e866ce6337d4c762922f5a300e1b50f958aef6e7d9c9
F test/join.test 37d48f2d22688e44bd858b27738265e4408919de40dbc85591217090a44e03c7
F test/join.test e32cb9b1491eed682489e2cde33a22a4eb7611fe5aa3b0aa4b275fe27ab3f3ac
F test/join2.test 466b07233820f5deee66a6c3bf6e4500c8bbf7b83649e67606f5f649c07928c0
F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
@ -2000,8 +2000,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P db55387b1972bc7bc6855bd3497af744a111e7d28d09893cd985fbb01be41bcc
R 07f8452158d8de57be929257c37c037f
P fe5c37736444e397ace387b761ec2491229785d7a437f3f60232aedf9d1f00ec
R b7bb9d0f74cad7fddb9b6178bd7d10bc
U drh
Z 2388624530fdd8581cf3228402a79d3a
Z 62c9c805d4ceaa75bf6aed42a5148e09
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
fe5c37736444e397ace387b761ec2491229785d7a437f3f60232aedf9d1f00ec
f47aa745690c018800243bf76930b2499ff4537411c4e27b4b16ba3854cc2bf8

View File

@ -2876,6 +2876,11 @@ static int whereLoopAddBtreeIndex(
){
continue;
}
if( (pSrc->fg.jointype & (JT_LEFT|JT_RIGHT))!=0
&& ExprHasProperty(pTerm->pExpr, EP_InnerON)
){
continue;
}
}
if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){

View File

@ -1167,9 +1167,9 @@ do_execsql_test join-27.9 {
} {}
do_execsql_test join-27.10 {
WITH t99(b) AS (
SELECT coalesce(b,3) FROM t2 AS x LEFT JOIN t1 ON c IN (SELECT x FROM t3)
SELECT b FROM t2 AS x LEFT JOIN t1 ON c IN (SELECT x FROM t3)
)
SELECT d, e, b FROM t2 JOIN t99 ON b IN (1,2,3);
SELECT d, e, b FROM t2 JOIN t99 ON b IS NULL;
} {}