From: drh Date: Thu, 24 Jul 2014 22:41:20 +0000 (+0000) Subject: Fix a bug in the whereRangeSkipScanEst() procedure (added by X-Git-Tag: version-3.8.6~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d15f87ecfdf0f1bf12d58da5284c9792f966f4d4;p=thirdparty%2Fsqlite.git Fix a bug in the whereRangeSkipScanEst() procedure (added by check-in [d09ca6d5efad3e4cfa]) where it fails to consider the possibility of a ROWID column when computing the affinity of a table column. FossilOrigin-Name: 6aea2258dd7d3967900cefe4cd0af48a7ee7e169 --- diff --git a/manifest b/manifest index c9c66de972..87c15adf11 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sreadfile(FILENAME)\sand\swritefile(FILENAME,CONTENT)\sSQL\sfunctions\sto\nthe\scommand-line\sshell. -D 2014-07-24T12:39:59.049 +C Fix\sa\sbug\sin\sthe\swhereRangeSkipScanEst()\sprocedure\s(added\sby\ncheck-in\s[d09ca6d5efad3e4cfa])\swhere\sit\sfails\sto\sconsider\sthe\spossibility\nof\sa\sROWID\scolumn\swhen\scomputing\sthe\saffinity\sof\sa\stable\scolumn. +D 2014-07-24T22:41:20.186 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 9454af8e5e18d6e91e5169eadfb61878e2cb42b1 +F src/where.c 4dfcd80380d154be434c4b51e890e17ce9754b3e F src/whereInt.h 929c1349b5355fd44f22cee5c14d72b3329c58a6 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 @@ -1184,7 +1184,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 f8f79f28785db716b10c3bc9d6652b98253fd125 -R 3cb7c1591be4171f813333f040f9142c +P fb1048cb2b613a0dbfe625a5df05e9dcd736a433 +R 7154486a7ce11d45d2aed19cdac8eb64 U drh -Z d6bf09c8f21a2381ecdf6b5a91f85057 +Z 3de5689fcbb67ba500bf3c297659c386 diff --git a/manifest.uuid b/manifest.uuid index c704a64b44..8f811c9bc6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fb1048cb2b613a0dbfe625a5df05e9dcd736a433 \ No newline at end of file +6aea2258dd7d3967900cefe4cd0af48a7ee7e169 \ No newline at end of file diff --git a/src/where.c b/src/where.c index 3901dd468f..38d1014ac0 100644 --- a/src/where.c +++ b/src/where.c @@ -2047,7 +2047,8 @@ static int whereRangeSkipScanEst( int nLower = -1; int nUpper = p->nSample+1; int rc = SQLITE_OK; - u8 aff = p->pTable->aCol[ p->aiColumn[nEq] ].affinity; + int iCol = p->aiColumn[nEq]; + u8 aff = iCol>=0 ? p->pTable->aCol[iCol].affinity : SQLITE_AFF_INTEGER; CollSeq *pColl; sqlite3_value *p1 = 0; /* Value extracted from pLower */