diff options
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 3 |
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 ){ |