aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <Dan Kennedy>2024-06-12 17:01:00 +0000
committerdan <Dan Kennedy>2024-06-12 17:01:00 +0000
commit0d92e66dfc42e23cf07fdf01b37f1bcbd0d8b6b9 (patch)
tree5db7941e43db4538da6cafed227b9519c1c346a5 /src
parentddc62664bfb5e3237b20098b30e4a99815c322e0 (diff)
downloadsqlite-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')
-rw-r--r--src/select.c6
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);