From: drh Date: Wed, 19 Mar 2014 14:30:55 +0000 (+0000) Subject: Make sure the where.c query planner never reports that the number of ORDER BY X-Git-Tag: version-3.8.5~109^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea6c36e2041410d64292bdc3493124dd457eb20c;p=thirdparty%2Fsqlite.git Make sure the where.c query planner never reports that the number of ORDER BY terms that are satisfied by indices is negative. FossilOrigin-Name: b186d8d15a10d5e8fcae9ae72e8624d71831f5bd --- diff --git a/manifest b/manifest index a367d8b9b9..cdb6bd8483 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C First\sattempt\sat\sgetting\sblock-sort\sto\swork.\s\sThis\sis\san\sincremental\scheck-in.\nThere\sare\smany\sproblems\sstill\sto\sbe\sworked\sout. -D 2014-03-19T14:10:55.625 +C Make\ssure\sthe\swhere.c\squery\splanner\snever\sreports\sthat\sthe\snumber\sof\sORDER\sBY\nterms\sthat\sare\ssatisfied\sby\sindices\sis\snegative. +D 2014-03-19T14:30:55.491 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -291,7 +291,7 @@ F src/vtab.c 21b932841e51ebd7d075e2d0ad1415dce8d2d5fd F src/wal.c 76e7fc6de229bea8b30bb2539110f03a494dc3a8 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c 11edb74d587bc87b33ca96a5173e3ec1b8389e45 -F src/where.c d4739c3900e4cb99dfd7d19853e6b4fb63c9d342 +F src/where.c 1757f31c7f1c59a35ac8ffe931d22d66b43f9f1f F src/whereInt.h 2564055b440e44ebec8b47f237bbccae6719b7af F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 @@ -1156,7 +1156,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P e258df236b7de70087c8227cb209080e55b9bf9c -R edda8149383dd364d2984f7033840ec9 +P 59742dd4c5259883850044d0938248b009ebd045 +R 48f9fc76ec5916ff8df0bfaab631c0e0 U drh -Z c306e7ec68619896c760c46adb63dbc2 +Z 42480fcdcdf9fedc12ae658e080be0a9 diff --git a/manifest.uuid b/manifest.uuid index 837615cb34..ee59a2b175 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -59742dd4c5259883850044d0938248b009ebd045 \ No newline at end of file +b186d8d15a10d5e8fcae9ae72e8624d71831f5bd \ No newline at end of file diff --git a/src/where.c b/src/where.c index a0bc027d97..740e1607e0 100644 --- a/src/where.c +++ b/src/where.c @@ -5205,6 +5205,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ } }else{ pWInfo->nOBSat = pFrom->isOrdered; + if( pWInfo->nOBSat<0 ) pWInfo->nOBSat = 0; pWInfo->revMask = pFrom->revLoop; } }