aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordrh <>2024-06-20 12:07:25 +0000
committerdrh <>2024-06-20 12:07:25 +0000
commit620a00ee32c64944289bc8ff8c37b23bb4e220a1 (patch)
tree1aa3bc89ae3a566c8b8894273fb9dffebcb7fce3 /src/select.c
parent62b954d545f52a8d59db654948f28ad6b6d899f6 (diff)
downloadsqlite-620a00ee32c64944289bc8ff8c37b23bb4e220a1.tar.gz
sqlite-620a00ee32c64944289bc8ff8c37b23bb4e220a1.zip
Do not attempt the exists-to-join optimization if the FROM clause is full.
FossilOrigin-Name: 8e3a1d2850337a902ab36b1d6a0dad4ae35030b71d1e15547f6e7487c1f86d18
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c
index 7a789196b..832b711b8 100644
--- a/src/select.c
+++ b/src/select.c
@@ -7384,7 +7384,8 @@ static u64 findConstIdxTerms(
static void existsToJoin(Parse *pParse, Select *p, Expr *pWhere){
if( pWhere
&& !ExprHasProperty(pWhere, EP_OuterON|EP_InnerON)
- && p->pSrc->nSrc>0
+ && p->pSrc->nSrc>0
+ && p->pSrc->nSrc<BMS
&& pParse->db->mallocFailed==0
){
if( pWhere->op==TK_AND ){