]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix problems in the indexed-expression handling in the optimizer.
authordrh <drh@noemail.net>
Thu, 27 Aug 2015 19:56:49 +0000 (19:56 +0000)
committerdrh <drh@noemail.net>
Thu, 27 Aug 2015 19:56:49 +0000 (19:56 +0000)
FossilOrigin-Name: 03375017691d5b480e73d712c4318632e835060c

manifest
manifest.uuid
src/where.c

index 2b7ae5a002476f2dda27d2b83ef80b6acc1819ac..2a88bdcb4d7892a2fd7e17b5fd0bf10ccad6ab72 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Activate\sthe\sability\sto\suse\sexpressions\sin\sindexes\sin\sa\squery.\s\sThere\sare\ssome\ntest\sfailures,\sbut\smostly\sthis\sseems\sto\swork.
-D 2015-08-27T18:24:02.056
+C Fix\sproblems\sin\sthe\sindexed-expression\shandling\sin\sthe\soptimizer.
+D 2015-08-27T19:56:49.408
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in e2218eb228374422969de7b1680eda6864affcef
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -414,7 +414,7 @@ F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
 F src/wal.c 6fb6b68969e4692593c2552c4e7bff5882de2cb8
 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
 F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
-F src/where.c 29851b4a1a93934fef1bde3d0a1e7407efd57543
+F src/where.c fcdded4bf274bf527020436e8895b33d575f18f6
 F src/whereInt.h 292d3ac90da4eab1e03ac8452f1add746bcafaa1
 F src/wherecode.c 3d9113cc307ffeed58db41fe9f2d807c94787ab5
 F src/whereexpr.c 990ed42b5940d4000e7e61887a4bbed412c80488
@@ -1380,7 +1380,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P c80e9e8e8cc1e7676d7c782ee0827726875db79e
-R ff3e8c131dda72b26dbe6f001a80b515
+P 42f93f582eccd8a778189aa6c113874f995ab751
+R 475d6e7258921a9c57642e7cd0e82c9c
 U drh
-Z 3e34cddbe64a99afb651902a91a49bea
+Z 29a0c57d5a3080634424e9023a9fd1e9
index 62cf69b6e4963b397e3d5c1bbf871fad0887754a..d483132b9081161ba675a6db5025e8fca188c4be 100644 (file)
@@ -1 +1 @@
-42f93f582eccd8a778189aa6c113874f995ab751
\ No newline at end of file
+03375017691d5b480e73d712c4318632e835060c
\ No newline at end of file
index ad1eecd9207482005f66bc940c0a7c775fff9ec1..c78563f1c5ef7acc0df92be687cd5621a8c796fc 100644 (file)
@@ -180,7 +180,7 @@ static WhereTerm *whereScanNext(WhereScan *pScan){
   while( pScan->iEquiv<=pScan->nEquiv ){
     iCur = pScan->aiCur[pScan->iEquiv-1];
     iColumn = pScan->aiColumn[pScan->iEquiv-1];
-    assert( iColumn!=(-2) || pScan->pIdxExpr!=0 );
+    if( iColumn==(-2) && pScan->pIdxExpr==0 ) return 0;
     while( (pWC = pScan->pWC)!=0 ){
       for(pTerm=pWC->a+k; k<pWC->nTerm; k++, pTerm++){
         if( pTerm->leftCursor==iCur
@@ -804,6 +804,7 @@ static sqlite3_index_info *allocateIndexInfo(
     testcase( pTerm->eOperator & WO_ALL );
     if( (pTerm->eOperator & ~(WO_ISNULL|WO_EQUIV|WO_IS))==0 ) continue;
     if( pTerm->wtFlags & TERM_VNULL ) continue;
+    if( pTerm->u.leftColumn<(-1) ) continue;
     nTerm++;
   }
 
@@ -859,6 +860,7 @@ static sqlite3_index_info *allocateIndexInfo(
     testcase( pTerm->eOperator & WO_ALL );
     if( (pTerm->eOperator & ~(WO_ISNULL|WO_EQUIV|WO_IS))==0 ) continue;
     if( pTerm->wtFlags & TERM_VNULL ) continue;
+    if( pTerm->u.leftColumn<(-1) ) continue;
     pIdxCons[j].iColumn = pTerm->u.leftColumn;
     pIdxCons[j].iTermOffset = i;
     op = (u8)pTerm->eOperator & WO_ALL;