]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add debugging output about the EXISTS-to-IN optimization when
authordrh <>
Sat, 16 Jan 2021 18:22:10 +0000 (18:22 +0000)
committerdrh <>
Sat, 16 Jan 2021 18:22:10 +0000 (18:22 +0000)
the ".wheretrace" flag has the 0x20 bit set.

FossilOrigin-Name: 0dad5ce34ad8a59200b013453c9334f8898e07f2c0107c8c734ecc34b67de572

manifest
manifest.uuid
src/whereexpr.c

index a50135c18fecdf893151c713e52e59977142e464..f5d05c712cfe125da108f35fc16338490d1454ee 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sOOM\sinjection\stests\sfor\snew\scode\son\sthis\sbranch.
-D 2021-01-15T17:51:56.060
+C Add\sdebugging\soutput\sabout\sthe\sEXISTS-to-IN\soptimization\swhen\nthe\s".wheretrace"\sflag\shas\sthe\s0x20\sbit\sset.
+D 2021-01-16T18:22:10.163
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -630,7 +630,7 @@ F src/walker.c d9c4e454ebb9499e908aa62d55b8994c375cf5355ac78f60d45af17f7890701c
 F src/where.c 0e6abb22a2323fec80b450825593c26a2ad8f4815d1ee3af9969d8f6144bf681
 F src/whereInt.h 9a3f577619f07700d16d89eeb2f3d94d6b7ed7f109c2dacf0ce8844921549506
 F src/wherecode.c a3a1aff30fe99a818d8e7c607980f033f40c68d890e03ed25838b9dbb7908bee
-F src/whereexpr.c 0462a66ccabeea05c2d41a1e650a9c4db5bc696b9a3b42b48a43a89a2ba81474
+F src/whereexpr.c 10ed78eb09474c4f4d2ad61c3047900897d48ce969f2fa7ef48ffd28b6d934a6
 F src/window.c edd6f5e25a1e8f2b6f5305b7f5f7da7bb35f07f0d432b255b1d4c2fcab4205aa
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/affinity2.test ce1aafc86e110685b324e9a763eab4f2a73f737842ec3b687bd965867de90627
@@ -1897,7 +1897,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 950030d679933f9ccd2b86ee650a4a78d338278a3629f0d289cca720a43e686b
-R 9a769128390cc86c331540163e8fa29c
-U dan
-Z a3f9abfbc145e44a2a1bba02d43a960d
+P 9a181dbaedcc2117e670e679ca94ed6d1fabd90c835671dee36424dd0646c4e5
+R 37544a92998410ad6bf700343ed335b0
+U drh
+Z b455d8286b10f237c30679d2b4a9d690
index 7877c795802181fc9fea8f9d28dad2928fc24d2a..c0bab29af40d3d4c8a6e9a68635a30871103ddd7 100644 (file)
@@ -1 +1 @@
-9a181dbaedcc2117e670e679ca94ed6d1fabd90c835671dee36424dd0646c4e5
\ No newline at end of file
+0dad5ce34ad8a59200b013453c9334f8898e07f2c0107c8c734ecc34b67de572
\ No newline at end of file
index cdaaa7e894180e3530d3cb3acb9496deafb58716..1772aa748663189a92bf4576429eebc5554102c3 100644 (file)
@@ -1107,7 +1107,7 @@ static int exprExistsToInIter(struct ExistsToInCtx *p, Expr **ppExpr){
 }
 
 /*
-** This function is by exprAnalyzeExists() when creating virtual IN(...)
+** This function is used by exprAnalyzeExists() when creating virtual IN(...)
 ** terms equivalent to user-supplied EXIST(...) clauses. It splits the WHERE
 ** clause of the Select object passed as the first argument into one or more
 ** expressions joined by AND operators, and then tests if the following are
@@ -1239,6 +1239,14 @@ static void exprAnalyzeExists(
   }
   sqlite3ExprDelete(db, pEq);
 
+#ifdef WHERETRACE_ENABLED  /* 0x20 */
+  if( sqlite3WhereTrace & 0x20 ){
+    sqlite3DebugPrintf("Convert EXISTS:\n");
+    sqlite3TreeViewExpr(0, pExpr, 0);
+    sqlite3DebugPrintf("into IN:\n");
+    sqlite3TreeViewExpr(0, pDup, 0);
+  }
+#endif
   idxNew = whereClauseInsert(pWC, pDup, TERM_VIRTUAL|TERM_DYNAMIC);
   if( idxNew ){
     exprAnalyze(pSrc, pWC, idxNew);