From: drh Date: Sat, 3 Mar 2012 00:34:47 +0000 (+0000) Subject: Fix a bug [3557ad65a07] that causes incorrect DISTINCT processing on X-Git-Tag: version-3.7.11~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f67d94cfe8eb49e62cf6766bc409b6831f4634c;p=thirdparty%2Fsqlite.git Fix a bug [3557ad65a07] that causes incorrect DISTINCT processing on an indexed query involving the IN operator. FossilOrigin-Name: dec9a995d7012a1f85be4edb71240b9d4f07c60e --- diff --git a/manifest b/manifest index 6fa62fc177..3e364d2766 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stest\spragma-19.5\sso\sthat\sit\sworks\son\sfile\snames\sthat\smay\scontain\sspaces\sand/or\sbackslashes. -D 2012-03-02T22:41:06.784 +C Fix\sa\sbug\s[3557ad65a07]\sthat\scauses\sincorrect\sDISTINCT\sprocessing\son\nan\sindexed\squery\sinvolving\sthe\sIN\soperator. +D 2012-03-03T00:34:47.462 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 3f79a373e57c3b92dabf76f40b065e719d31ac34 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -253,7 +253,7 @@ F src/vtab.c ab90fb600a3f5e4b7c48d22a4cdb2d6b23239847 F src/wal.c 7bb3ad807afc7973406c805d5157ec7a2f65e146 F src/wal.h 29c197540b19044e6cd73487017e5e47a1d3dac6 F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f -F src/where.c af623942514571895818b9b7ae11db95ae3b3d88 +F src/where.c f2cf59751f7facb4c422adf83ddc989aa5772874 F test/8_3_names.test 631ea964a3edb091cf73c3b540f6bcfdb36ce823 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87 @@ -991,7 +991,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P 74d224b14467d8a6915d3cf372f45e0d28708fa2 -R 1b3b0133ab927bace43b063fe5fb3563 -U mistachkin -Z 8931ed203e5c3d9dfd3529ebd0c654df +P 9aaa1ab7c63c9045fecf5e965b333cc5f28b0791 +R 0fde9a1f5b219b6e9128e202fe652a01 +U drh +Z 8bae0564fba3f81fa4a316b685f23026 diff --git a/manifest.uuid b/manifest.uuid index e9e40ff7c1..41df7bd95d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9aaa1ab7c63c9045fecf5e965b333cc5f28b0791 \ No newline at end of file +dec9a995d7012a1f85be4edb71240b9d4f07c60e \ No newline at end of file diff --git a/src/where.c b/src/where.c index 78efbf9790..eda8d5fb8e 100644 --- a/src/where.c +++ b/src/where.c @@ -3103,7 +3103,9 @@ static void bestBtreeIndex( /* If there is a DISTINCT qualifier and this index will scan rows in ** order of the DISTINCT expressions, clear bDist and set the appropriate ** flags in wsFlags. */ - if( isDistinctIndex(pParse, pWC, pProbe, iCur, pDistinct, nEq) ){ + if( isDistinctIndex(pParse, pWC, pProbe, iCur, pDistinct, nEq) + && (wsFlags & WHERE_COLUMN_IN)==0 + ){ bDist = 0; wsFlags |= WHERE_ROWID_RANGE|WHERE_COLUMN_RANGE|WHERE_DISTINCT; }