From: drh Date: Tue, 17 Jun 2014 09:52:26 +0000 (+0000) Subject: Simplification to the logic that prevents automatic indexes from being formed X-Git-Tag: version-3.8.6~110^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f808299ff94e2cd5998b9c373c12b609bcded88;p=thirdparty%2Fsqlite.git Simplification to the logic that prevents automatic indexes from being formed on constant expressions. FossilOrigin-Name: 36d67e1dd2b4f4c22d02f3c3b8d372074de5523a --- diff --git a/manifest b/manifest index 253d4bcb86..17c12ccb2d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Allow\san\sautomatic\sindex\son\sa\sWHERE\sconstraint\swhere\sthe\sRHS\sis\sdoes\snot\nreference\sanother\stable\sas\slong\sas\sthe\sRHS\sis\snot\sa\sconstant. -D 2014-06-17T09:00:54.229 +C Simplification\sto\sthe\slogic\sthat\sprevents\sautomatic\sindexes\sfrom\sbeing\sformed\non\sconstant\sexpressions. +D 2014-06-17T09:52:26.975 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in ed5e4aae4799f724699d5509fac2977786414dbb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -296,7 +296,7 @@ F src/vtab.c 21b932841e51ebd7d075e2d0ad1415dce8d2d5fd F src/wal.c 264df50a1b33124130b23180ded2e2c5663c652a F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c 11edb74d587bc87b33ca96a5173e3ec1b8389e45 -F src/where.c d6a284abd9a1b4c1e617e5208e695cd6f0616ae1 +F src/where.c 3214e390ca5ff0b19fb5084e5bd5870da623389d F src/whereInt.h 929c1349b5355fd44f22cee5c14d72b3329c58a6 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 @@ -1177,7 +1177,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P d6883e960f61365729f279a3c1f2c050beb49a55 -R e7b366f668336ead2394408b5846caa4 +P 58acc2a8b38c5f13175c191697b4d2b663db1872 +R 91ed31168e6ce0a5afee4b984323de5e U drh -Z ded0b7f99669cd2fc0f45c3d542cb907 +Z ee443673993fc3ea86368d30ccfb6dad diff --git a/manifest.uuid b/manifest.uuid index df61c8be5b..385f247806 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -58acc2a8b38c5f13175c191697b4d2b663db1872 \ No newline at end of file +36d67e1dd2b4f4c22d02f3c3b8d372074de5523a \ No newline at end of file diff --git a/src/where.c b/src/where.c index 8550231c30..1caaf73df7 100644 --- a/src/where.c +++ b/src/where.c @@ -4529,10 +4529,7 @@ static int whereLoopAddBtree( WhereTerm *pWCEnd = pWC->a + pWC->nTerm; for(pTerm=pWC->a; rc==SQLITE_OK && pTermprereqRight & pNew->maskSelf ) continue; - if( pTerm->prereqRight==0 - && sqlite3ExprIsConstant(pTerm->pExpr->pRight) ){ - continue; - } + if( sqlite3ExprIsConstant(pTerm->pExpr->pRight) ) continue; if( termCanDriveIndex(pTerm, pSrc, 0) ){ pNew->u.btree.nEq = 1; pNew->u.btree.nSkip = 0;