1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Enhance WhereLoopBuilder.iPlanLimit to handle a case involving the OR

optimization discovered overnight by OSSFuzz.

FossilOrigin-Name: 7b59930a1d7b664b54d5a2bc9fa385925b5f4c8f34bf401c798307e3e2dae2c6
This commit is contained in:
drh
2018-09-22 15:05:32 +00:00
parent 7cc5595a01
commit 2c3ba94969
4 changed files with 14 additions and 10 deletions

View File

@@ -2127,7 +2127,11 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
int rc;
/* Stop the search once we hit the query planner search limit */
if( pBuilder->iPlanLimit==0 ) return SQLITE_DONE;
if( pBuilder->iPlanLimit==0 ){
WHERETRACE(0xffffffff,("=== query planner search limit reached ===\n"));
if( pBuilder->pOrSet ) pBuilder->pOrSet->n = 0;
return SQLITE_DONE;
}
pBuilder->iPlanLimit--;
/* If pBuilder->pOrSet is defined, then only keep track of the costs