diff options
author | drh <> | 2023-02-13 12:46:22 +0000 |
---|---|---|
committer | drh <> | 2023-02-13 12:46:22 +0000 |
commit | 9e463e878db0ec610ec3b14d30b0bcdf5bd053ba (patch) | |
tree | 792d4b80ae1b5f60beb68bf242f1abe329c40ef8 /src | |
parent | 0c55b5fd1ccab39a16fe0d0453c6882a83d42304 (diff) | |
download | sqlite-9e463e878db0ec610ec3b14d30b0bcdf5bd053ba.tar.gz sqlite-9e463e878db0ec610ec3b14d30b0bcdf5bd053ba.zip |
In the LIKE optimization, do not analyze the new virtual WHERE clause terms
until both have been added, since they are expected to be consecutive and
the analysis might add complementary terms.
This fixes a problem caused by [44200596aa943963] and discovered by dbsqlfuzz
and recorded as case 7e3b5983727d843b910b2d9ab556e4afcd777cfb.
FossilOrigin-Name: d35de3ad3fac6b30d3f266cbe4b1e9923eb31a1eff4a869205bbc3ba122eeec5
Diffstat (limited to 'src')
-rw-r--r-- | src/whereexpr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/whereexpr.c b/src/whereexpr.c index 0be39b7d6..e458952c4 100644 --- a/src/whereexpr.c +++ b/src/whereexpr.c @@ -1376,7 +1376,6 @@ static void exprAnalyze( transferJoinMarkings(pNewExpr1, pExpr); idxNew1 = whereClauseInsert(pWC, pNewExpr1, wtFlags); testcase( idxNew1==0 ); - exprAnalyze(pSrc, pWC, idxNew1); pNewExpr2 = sqlite3ExprDup(db, pLeft, 0); pNewExpr2 = sqlite3PExpr(pParse, TK_LT, sqlite3ExprAddCollateString(pParse,pNewExpr2,zCollSeqName), @@ -1384,6 +1383,7 @@ static void exprAnalyze( transferJoinMarkings(pNewExpr2, pExpr); idxNew2 = whereClauseInsert(pWC, pNewExpr2, wtFlags); testcase( idxNew2==0 ); + exprAnalyze(pSrc, pWC, idxNew1); exprAnalyze(pSrc, pWC, idxNew2); pTerm = &pWC->a[idxTerm]; if( isComplete ){ |