]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Set the WHERE_UNIQUE flag on loops that can only run once.
authordrh <drh@noemail.net>
Mon, 3 Jun 2013 15:07:23 +0000 (15:07 +0000)
committerdrh <drh@noemail.net>
Mon, 3 Jun 2013 15:07:23 +0000 (15:07 +0000)
FossilOrigin-Name: 510f4d8ecf6eb284f14b91951e7236505bd71203

manifest
manifest.uuid
src/where.c

index fd53c9cffeb17fd992bfbe4284093918a8213aca..4456115495f9237d6259ae0654eda5a7ba0b35b2 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\stest\scases\sto\sverify\sthat\sticket\s[bc1aea7b725f2761]\shas\sbeen\sfixed\sin\nthe\sNGQP.
-D 2013-06-03T14:15:34.631
+C Set\sthe\sWHERE_UNIQUE\sflag\son\sloops\sthat\scan\sonly\srun\sonce.
+D 2013-06-03T15:07:23.693
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -289,7 +289,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83
 F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d
 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
 F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
-F src/where.c 7c931bf930fcf77d9a446e6d60692ab7a6251d00
+F src/where.c 7e34bb26affb2bf0eee8a8c5ab955cf80e7f9580
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
@@ -1093,7 +1093,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 42511a7e12a70cf3436d25e4d069e5d309dfd678
-R 9315575e95aec71de6da1203a12a0f54
+P 9b97af94ae7b1624ef1f5adee58010593fbb8b1c
+R c10d3b1c9e2b7a04d0ad05024b58cd34
 U drh
-Z bf9c6fc8107d350958f4a9bdd4f10f03
+Z 86153958e4f1f3df668821cb8ff6a748
index 824fa2dabf086c226c3ad3a7e8a153664e544112..950d83a47f4fde68fc73dd59c6c0682d97f2dfcd 100644 (file)
@@ -1 +1 @@
-9b97af94ae7b1624ef1f5adee58010593fbb8b1c
\ No newline at end of file
+510f4d8ecf6eb284f14b91951e7236505bd71203
\ No newline at end of file
index 4e78f1ebde2bce68a9653e6ac1592701f88f5d9d..1efa409942dbf24c85d67cd0c03fd58e5cd7b11f 100644 (file)
@@ -4017,6 +4017,12 @@ static int whereLoopAddBtreeIndex(
       pNew->nOut = (double)iRowEst * nInMul * nIn;
     }else if( pTerm->eOperator & (WO_EQ) ){
       pNew->wsFlags |= WHERE_COLUMN_EQ;
+      if( iCol<0 
+       || (pProbe->onError==OE_Abort && nInMul==1
+           && pNew->u.btree.nEq==pProbe->nColumn-1)
+      ){
+        pNew->wsFlags |= WHERE_UNIQUE;
+      }
       pNew->u.btree.nEq++;
       pNew->nOut = (double)iRowEst * nInMul;
     }else if( pTerm->eOperator & (WO_ISNULL) ){