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 /src/select.c | |
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 'src/select.c')
-rw-r--r-- | src/select.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c index e546a664c..7a789196b 100644 --- a/src/select.c +++ b/src/select.c @@ -7382,7 +7382,11 @@ static u64 findConstIdxTerms( ** WHERE S.sid = R.sid AND R.day = '2022-10-25'; */ static void existsToJoin(Parse *pParse, Select *p, Expr *pWhere){ - if( pWhere && p->pSrc->nSrc>0 && pParse->db->mallocFailed==0 ){ + if( pWhere + && !ExprHasProperty(pWhere, EP_OuterON|EP_InnerON) + && p->pSrc->nSrc>0 + && pParse->db->mallocFailed==0 + ){ if( pWhere->op==TK_AND ){ Expr *pRight = pWhere->pRight; existsToJoin(pParse, p, pWhere->pLeft); |