]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Reduce the number of cases where it is necessary to check for NULL after
authordrh <drh@noemail.net>
Fri, 14 Feb 2014 20:59:53 +0000 (20:59 +0000)
committerdrh <drh@noemail.net>
Fri, 14 Feb 2014 20:59:53 +0000 (20:59 +0000)
the loop terminating condition.

FossilOrigin-Name: 3c1ae447dec8fc2af1c5105134061717594ac0e0

manifest
manifest.uuid
src/where.c

index b85a23bdd50b46d672f364583de6c22f3c26a759..d8dd8495677f2333e0836e5146e9ea6acae21464 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sOP_IdxGT\sand\sOP_IdxLE\sas\sdistinct\sopcodes.\s\sFormerly\sthese\soperations\swhere\ndone\susing\sOP_IdxGE\sand\sOP_IdxLT\swith\sthe\sP5\sflag\sset.\s\sBut\sVDBE\scode\sis\seasier\nto\sread\swith\sdistinct\sopcode\snames.\s\sAlso\schange\sOP_SeekGe\sto\sOP_SeekGE,\sand\nso\sforth,\sso\sthat\sthe\scapitalization\sis\sconsistent.\s\sThe\swhole\spoint\sof\sthis\nchange\sis\sto\simprove\sthe\sreadability\sof\sVDBE\slistings.
-D 2014-02-14T15:13:36.850
+C Reduce\sthe\snumber\sof\scases\swhere\sit\sis\snecessary\sto\scheck\sfor\sNULL\safter\nthe\sloop\sterminating\scondition.
+D 2014-02-14T20:59:53.587
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -290,7 +290,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 43eb827f10d90972578eb0759d01bf0094fcb8c7
+F src/where.c bf849f08ee09f15e507b5d5f4bc5b608761d5fe2
 F src/whereInt.h 921f935af8b684ffb49705610bda7284db1db138
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
@@ -1150,7 +1150,7 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
-P 9e573198e107f1b85ee37c52a10343d38968bda1
-R 761a583803ea417c3e82fa617fd0a139
+P b6bea903ac8e1717ed50b221d73bd0be061c7663
+R f976ccc3e6f99e20be380cc680402b19
 U drh
-Z 39171055bea51b7fba314c7bdb8e0ff5
+Z d8a7427791a9ddd9c5e417477ea3c5a6
index 7c4fe4fd3a2419b0bd388d8aa14a811fc87234a8..3ff1fc2f3d976ac9960d001e6701666657e59e57 100644 (file)
@@ -1 +1 @@
-b6bea903ac8e1717ed50b221d73bd0be061c7663
\ No newline at end of file
+3c1ae447dec8fc2af1c5105134061717594ac0e0
\ No newline at end of file
index 94e939e27f2b5292bc91a89808bd5e37813a3ee0..96ee0e931eee32dba3a50ee051088f65d90eed5e 100644 (file)
@@ -3134,17 +3134,15 @@ static Bitmask codeOneLoopStart(
       sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint);
     }
 
-    /* If there are inequality constraints, check that the value
-    ** of the table column that the inequality contrains is not NULL.
-    ** If it is, jump to the next iteration of the loop.
+    /* If there are inequality constraint upper bound but not a lower
+    ** bound, then check that the value of the table column that the
+    ** inequality contrains is not NULL since there is alway an implied
+    ** lower bound of "column>NULL".
     */
     r1 = sqlite3GetTempReg(pParse);
-    testcase( pLoop->wsFlags & WHERE_BTM_LIMIT );
-    testcase( pLoop->wsFlags & WHERE_TOP_LIMIT );
-    if( (pLoop->wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0 
+    if( (pLoop->wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))==WHERE_TOP_LIMIT 
      && (j = pIdx->aiColumn[nEq])>=0 
      && pIdx->pTable->aCol[j].notNull==0 
-     && (nEq || (pLoop->wsFlags & WHERE_BTM_LIMIT)==0)
     ){
       sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, nEq, r1);
       VdbeComment((v, "%s", pIdx->pTable->aCol[j].zName));