From 613a53a029b83773facb5f923c8d662f08b0e102 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 3 Oct 2012 18:09:32 +0000 Subject: [PATCH] Fix an out-of-order memset() that occurs before all variable declarations are finished. Also fix a line that exceeds the 80-character line length limit. FossilOrigin-Name: ba2f492f957ab5556cd540e21a76ebb75efea725 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/where.c | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 373e4e653b..f15d875432 100644 --- 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 diff --git a/manifest.uuid b/manifest.uuid index 7aace3cdf7..d51ad9182c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -956e4d7f8958e7065ff2d61cd71519d6f4113d4a \ No newline at end of file +ba2f492f957ab5556cd540e21a76ebb75efea725 \ No newline at end of file diff --git a/src/where.c b/src/where.c index c6af796d86..0df9bb08d5 100644 --- a/src/where.c +++ b/src/where.c @@ -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