From: drh Date: Thu, 7 Aug 2014 20:37:01 +0000 (+0000) Subject: Clarify the computation of compatible isOrdered by in the plan solver of X-Git-Tag: version-3.8.6~25^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2a90306cacfab863d3561024287bcdb88245bcc;p=thirdparty%2Fsqlite.git Clarify the computation of compatible isOrdered by in the plan solver of the query planner. FossilOrigin-Name: b5e8fd575a80334160de0aac8084ed5cd28816a5 --- diff --git a/manifest b/manifest index 833fa0e284..a3788a8b47 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sthe\sextraneous\sdebugging\sprintf()\sfrom\sthe\sprevious\scheck-in. -D 2014-08-07T20:25:37.284 +C Clarify\sthe\scomputation\sof\scompatible\sisOrdered\sby\sin\sthe\splan\ssolver\sof\nthe\squery\splanner. +D 2014-08-07T20:37:01.008 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 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 5e4fe929798e75f9d5c6b5b9c545fbc006966c33 +F src/where.c 4cd4b3622caa81b71ebce8fea8f7811ae052d664 F src/whereInt.h 929c1349b5355fd44f22cee5c14d72b3329c58a6 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 @@ -1185,7 +1185,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 ec5d84ba69c100d9565425ed74040a49e410ea03 -R 85fb26fb0f7344228780016c4074b483 +P 8f04d2c0084afa6381e78847c9aa296498d448cb +R 444666601d1d38c7f4902aa29891f8d2 U drh -Z 218dd74820a0f9854df8a36e666b7aca +Z fa58944021488910925d31a2d03bf4a8 diff --git a/manifest.uuid b/manifest.uuid index 4e34981ca6..42afde34f7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8f04d2c0084afa6381e78847c9aa296498d448cb \ No newline at end of file +b5e8fd575a80334160de0aac8084ed5cd28816a5 \ No newline at end of file diff --git a/src/where.c b/src/where.c index ff50f52b45..4dd6579e2f 100644 --- a/src/where.c +++ b/src/where.c @@ -5536,10 +5536,14 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ ** First look for an existing path among best-so-far paths ** that covers the same set of loops and has the same isOrdered ** setting as the current path candidate. + ** + ** The term "((pTo->isOrdered^isOrdered)&0x80)==0" is equivalent + ** to (pTo->isOrdered==(-1))==(isOrdered==(-1))" for the range + ** of legal values for isOrdered, -1..64. */ for(jj=0, pTo=aTo; jjmaskLoop==maskNew - && ((pTo->isOrdered^isOrdered)&80)==0 + && ((pTo->isOrdered^isOrdered)&0x80)==0 ){ testcase( jj==nTo-1 ); break;