]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix an out-of-order memset() that occurs before all variable declarations
authordrh <drh@noemail.net>
Wed, 3 Oct 2012 18:09:32 +0000 (18:09 +0000)
committerdrh <drh@noemail.net>
Wed, 3 Oct 2012 18:09:32 +0000 (18:09 +0000)
are finished.  Also fix a line that exceeds the 80-character line length
limit.

FossilOrigin-Name: ba2f492f957ab5556cd540e21a76ebb75efea725

manifest
manifest.uuid
src/where.c

index 373e4e653bf1eb9ca6a3cd6f704bfeaa8352eac6..f15d875432242f4dd1c659f85ad8cacbb4cdb267 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Update\sthe\squery\splanner\sto\srecognize\smore\scases\swhere\sORDER\sBY\sclauses\ncan\sbe\soptimized\sout.\s\sAdd\stest\scases\sto\sverify\scorrect\sbehavior\sof\sthe\nORDER\sBY\soptimization\swhen\sthe\scovering-index-scan\soptimization\sis\sdisabled.\nFix\sa\sharmless\scompiler\swarning\sin\sthe\sTCL\sinterface.
-D 2012-10-03T12:56:18.398
+C Fix\san\sout-of-order\smemset()\sthat\soccurs\sbefore\sall\svariable\sdeclarations\nare\sfinished.\s\sAlso\sfix\sa\sline\sthat\sexceeds\sthe\s80-character\sline\slength\nlimit.
+D 2012-10-03T18:09:32.822
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5f4f26109f9d80829122e0e09f9cda008fa065fb
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -249,7 +249,7 @@ F src/vtab.c d8020c0a0e8ccc490ca449d7e665311b6e9f3ba9
 F src/wal.c e1fe8f92a0ea0fef8faa87ec43a127a478589d22
 F src/wal.h 29c197540b19044e6cd73487017e5e47a1d3dac6
 F src/walker.c 3d75ba73de15e0f8cd0737643badbeb0e002f07b
-F src/where.c cd99218c11dc8df4836f18df0d8a8cc5c10aeb30
+F src/where.c fabdb473752fb465b0cae66d446b7af678033d0c
 F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/aggnested.test 0be144b453e0622a085fae8665c32f5676708e00
@@ -1018,7 +1018,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9
-P c1f10a2643179ec58f3879764e9e89676d4b5f91 0f9bb90100aa304a7f28023ca4173e68b445e8bd
-R 8774a06a6467942bbeb55b1c69f79903
+P 956e4d7f8958e7065ff2d61cd71519d6f4113d4a
+R 9f4b1a764df6137e6f14304dffc8ad1d
 U drh
-Z dc6130441c34298b8082b4166a85e60e
+Z a3c3e4f99944b9339f658e73f3668f5f
index 7aace3cdf7e1a3fff7cf73887382184bf61d3cd8..d51ad9182c57a14804777bdb67f43a23a4bf1d5c 100644 (file)
@@ -1 +1 @@
-956e4d7f8958e7065ff2d61cd71519d6f4113d4a
\ No newline at end of file
+ba2f492f957ab5556cd540e21a76ebb75efea725
\ No newline at end of file
index c6af796d862590978b2af62e7b515e48dd535da9..0df9bb08d5d5066b27241abda43dba222f186a56 100644 (file)
@@ -3067,7 +3067,6 @@ static void bestBtreeIndex(WhereBestIdx *p){
     WhereCost pc;               /* Cost of using pProbe */
     double log10N = (double)1;  /* base-10 logarithm of nRow (inexact) */
     int bRev = 2;               /* 0=forward scan.  1=reverse.  2=undecided */
-    memset(&pc, 0, sizeof(pc));
 
     /* The following variables are populated based on the properties of
     ** index being evaluated. They are then used to determine the expected
@@ -3154,6 +3153,7 @@ static void bestBtreeIndex(WhereBestIdx *p){
     WhereTerm *pFirstTerm = 0;    /* First term matching the index */
 #endif
 
+    memset(&pc, 0, sizeof(pc));
     nOrderBy = p->pOrderBy ? p->pOrderBy->nExpr : 0;
     if( p->i ){
       nPriorSat = pc.plan.nOBSat = p->aLevel[p->i-1].plan.nOBSat;
@@ -3186,7 +3186,8 @@ static void bestBtreeIndex(WhereBestIdx *p){
       }else if( pTerm->eOperator & WO_ISNULL ){
         pc.plan.wsFlags |= WHERE_COLUMN_NULL;
         if( pc.plan.nEq==nOrdered ) nOrdered++;
-      }else if( bSort && pc.plan.nEq==nOrdered && isOrderedTerm(p, pTerm, &bRev) ){
+      }else if( bSort && pc.plan.nEq==nOrdered
+             && isOrderedTerm(p,pTerm,&bRev) ){
         nOrdered++;
       }
 #ifdef SQLITE_ENABLE_STAT3