From: drh Date: Wed, 23 Jul 2014 19:37:21 +0000 (+0000) Subject: Ugh. Consecutive UNIQUE index entries are only distinct if the index is X-Git-Tag: version-3.8.6~61^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6861b8a13fb0ab906c2ab41e6bb6f5d557969365;p=thirdparty%2Fsqlite.git Ugh. Consecutive UNIQUE index entries are only distinct if the index is on NOT NULL columns. So the previous version was not quite right. This check-in fixes the problem. FossilOrigin-Name: 30033f965030a015fad15e532bcaba1314c8cc0f --- diff --git a/manifest b/manifest index f572551082..c9cc80f306 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\sthe\sperformance\sof\sthe\sANALYZE\scommand\sby\staking\sadvantage\sof\sthe\nfact\sthat\severy\srow\sof\sa\sUNIQUE\sindex\sis\sdistinct. -D 2014-07-23T18:36:55.821 +C Ugh.\s\sConsecutive\sUNIQUE\sindex\sentries\sare\sonly\sdistinct\sif\sthe\sindex\sis\non\sNOT\sNULL\scolumns.\s\sSo\sthe\sprevious\sversion\swas\snot\squite\sright.\s\sThis\ncheck-in\sfixes\sthe\sproblem. +D 2014-07-23T19:37:21.314 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -161,7 +161,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 3d8b83c91651f53472ca17599dae3457b8b89494 F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a F src/alter.c b00900877f766f116f9e16116f1ccacdc21d82f1 -F src/analyze.c c72bb66997ebdbc76936cfe96d7cc9da6ffe2b22 +F src/analyze.c 7f893416d1e4375e31e497107e92b28c2f8f82d1 F src/attach.c 3801129015ef59d76bf23c95ef9b0069d18a0c52 F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34 F src/backup.c a729e63cf5cd1829507cb7b8e89f99b95141bb53 @@ -1183,7 +1183,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 e6225a7bf77a700b318563b1a854b4b3a9e031e1 -R fa098d0ebca9c403761ac8a7cdd64221 +P 3e1e79e1335f7ad33cd35f384f2a063c4aa2253b +R 8df862d446d339da769e0f44096b055d U drh -Z 71590bde4580a255d675842a920968d0 +Z cc08889d86841af01a0687614b9dbde8 diff --git a/manifest.uuid b/manifest.uuid index 2ecff9239b..b9ae50e83b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3e1e79e1335f7ad33cd35f384f2a063c4aa2253b \ No newline at end of file +30033f965030a015fad15e532bcaba1314c8cc0f \ No newline at end of file diff --git a/src/analyze.c b/src/analyze.c index 2c31f81f3a..e235389e2d 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -1029,7 +1029,7 @@ static void analyzeOneTable( }else{ nCol = pIdx->nColumn; zIdxName = pIdx->zName; - nColTest = pIdx->onError==OE_None ? nCol-1 : pIdx->nKeyCol-1; + nColTest = pIdx->uniqNotNull ? pIdx->nKeyCol-1 : nCol-1; } aGotoChng = sqlite3DbMallocRaw(db, sizeof(int)*(nColTest+1)); if( aGotoChng==0 ) continue;