]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Avoid O(N*N) behavior with very long lists of VALUES. many-VALUEs
authordrh <drh@noemail.net>
Mon, 5 Jan 2015 20:04:51 +0000 (20:04 +0000)
committerdrh <drh@noemail.net>
Mon, 5 Jan 2015 20:04:51 +0000 (20:04 +0000)
FossilOrigin-Name: ee30fb35217f3429ee89aaad7c19f29710420e4c

manifest
manifest.uuid
src/select.c

index d9ca18ff0338fc23aa65651277b631b3b08985ff..1131d6525bde356eee1ae4ad05fa2a5ab85974ca 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Handle\scompound-select\sstatements\soriginating\sfrom\sVALUES\sclauses\sas\sa\nspecial\scase\sthat\sdoes\snot\suse\srecursion.
-D 2015-01-05T19:16:42.892
+C Avoid\sO(N*N)\sbehavior\swith\svery\slong\slists\sof\sVALUES.
+D 2015-01-05T20:04:51.191
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 335e2d3ff0f2455eacbfa3075fc37495e3321410
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -228,7 +228,7 @@ F src/printf.c 9e75a6a0b55bf61cfff7d7e19d89834a1b938236
 F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
 F src/resolve.c f6c46d3434439ab2084618d603e6d6dbeb0d6ada
 F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
-F src/select.c 4776e16d19296f0f93ecd9431dca8bc3e3182714
+F src/select.c e4c38c75e36f28aed80a69a725d888751bfd53df
 F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf
 F src/sqlite.h.in ed799ff5c814227c7957eb4f4a217f67fdc0da48
 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
@@ -1235,7 +1235,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 c9d65f739ad56f016c676e79aa39080be3fe868a
-R 382474f6cec467234b3ff04ac38978b4
+P 9ce9e43af38e6bc362734463d4bfc40ff0c98f8f
+R 7d358a2d55ab9540987f678e54c3928e
 U drh
-Z 33ab3e676dc0271c6784ea259fd00ed6
+Z 9bf53124e75790b3e22f8f45574d11c9
index e3a83ccf8ffa95aa369ca2e8523450f16bd83ed6..c565f584a5ea2226f0f7c5f044cc92eabcd96d7a 100644 (file)
@@ -1 +1 @@
-9ce9e43af38e6bc362734463d4bfc40ff0c98f8f
\ No newline at end of file
+ee30fb35217f3429ee89aaad7c19f29710420e4c
\ No newline at end of file
index 5de489b86edfce4a5a0e43a4bcbc6bba4b40e2e6..78b1caea8de3ce75d1ab82640ef5d49327de0ec8 100644 (file)
@@ -4115,7 +4115,9 @@ static int selectExpander(Walker *pWalker, Select *p){
   }
   pTabList = p->pSrc;
   pEList = p->pEList;
-  sqlite3WithPush(pParse, findRightmost(p)->pWith, 0);
+  if( pWalker->xSelectCallback2==selectPopWith ){
+    sqlite3WithPush(pParse, findRightmost(p)->pWith, 0);
+  }
 
   /* Make sure cursor numbers have been assigned to all entries in
   ** the FROM clause of the SELECT statement.
@@ -4406,7 +4408,9 @@ static void sqlite3SelectExpand(Parse *pParse, Select *pSelect){
     sqlite3WalkSelect(&w, pSelect);
   }
   w.xSelectCallback = selectExpander;
-  w.xSelectCallback2 = selectPopWith;
+  if( (pSelect->selFlags & SF_AllValues)==0 ){
+    w.xSelectCallback2 = selectPopWith;
+  }
   sqlite3WalkSelect(&w, pSelect);
 }