]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the ".eqp trace" command to the CLI when using SQLITE_DEBUG, as a
authordrh <drh@noemail.net>
Sat, 26 Jan 2019 15:40:04 +0000 (15:40 +0000)
committerdrh <drh@noemail.net>
Sat, 26 Jan 2019 15:40:04 +0000 (15:40 +0000)
convenient shorthand for "PRAGMA vdbe_debug=ON" but with automatic indentation
feature for program listings provided by the CLI.

FossilOrigin-Name: 626502faa17b5b7a0fa36cabfd12e463eb09aec048d01c587a18d3977cf04662

manifest
manifest.uuid
src/shell.c.in

index 9b020d7aa58c25962ab6704177351b3bbe906615..34f86707653c575719000b2f205d482ec1896845 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Do\snot\saccidently\struncate\szeroblob\svalues\swhen\sdoing\san\sarithmetic\noperation.\s\sFix\sfor\sticket\s[bb4bdb9f7f654b0bb9f34cfba].
-D 2019-01-25T20:09:04.290
+C Add\sthe\s".eqp\strace"\scommand\sto\sthe\sCLI\swhen\susing\sSQLITE_DEBUG,\sas\sa\nconvenient\sshorthand\sfor\s"PRAGMA\svdbe_debug=ON"\sbut\swith\sautomatic\sindentation\nfeature\sfor\sprogram\slistings\sprovided\sby\sthe\sCLI.
+D 2019-01-26T15:40:04.766
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F Makefile.in 9947eae873c07ae894d4c8633b76c0a0daca7b9fd54401096a77d1a6c7b74359
@@ -515,7 +515,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
 F src/resolve.c c8f207247472c41ac73d738e1c1a80719ad253d1dbb617ed57740492b2a6c097
 F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93
 F src/select.c 8e22fda41a737c391e8b797f7c71e7ded1d107c31181b07bb10b3d4f22a28cd9
-F src/shell.c.in 58f69c9143d9635a3d71a32c3d4cb6fad4de4f0ca400c098fa76ff83e3ec58cb
+F src/shell.c.in 324bc8df6e0ddc1c17771927f3bc9616340175e78cbb15f6cdfd10cade01cdbf
 F src/sqlite.h.in 8ded85ecaa768afd196b24201382ccdf00e5bab6861e30549cd750bebd273a0b
 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
 F src/sqlite3ext.h 960f1b86c3610fa23cb6a267572a97dcf286e77aa0dd3b9b23292ffaa1ea8683
@@ -1804,7 +1804,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 98b3b97573ccb3d986d1552f97f96e15088a598945923adcac77010c1e8b7fe4
-R 1d7c45280e753f1cbd5da589341c01ea
+P 13f6942eb0da2d92a0830f18640ce64208bd0cd6ff6d0c97e4a4c57ac3d65ba6
+R 526b182186e89dc3ca0b6f304ae40eae
 U drh
-Z 62265ca3345faf783a3f875668f7525d
+Z abb2dd0860dab724b6ef3b845cc9519b
index eda02a5d0b6e70deefea2ba5d350c6b8ba905dcc..6ffd094b950d44e8483b49a393545e6b6c65bf3a 100644 (file)
@@ -1 +1 @@
-13f6942eb0da2d92a0830f18640ce64208bd0cd6ff6d0c97e4a4c57ac3d65ba6
\ No newline at end of file
+626502faa17b5b7a0fa36cabfd12e463eb09aec048d01c587a18d3977cf04662
\ No newline at end of file
index 07afdf8d941979aadd9bedc65bc53868f3cf7bb0..1124ab4166abdb9492d748c1594cb050514d1541 100644 (file)
@@ -1006,6 +1006,7 @@ struct ShellState {
   u8 autoExplain;        /* Automatically turn on .explain mode */
   u8 autoEQP;            /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
   u8 autoEQPtest;        /* autoEQP is in test mode */
+  u8 autoEQPtrace;       /* autoEQP is in trace mode */
   u8 statsOn;            /* True to display memory stats before each finalize */
   u8 scanstatsOn;        /* True to display scan stats before each finalize */
   u8 openMode;           /* SHELL_OPEN_NORMAL, _APPENDVFS, or _ZIPFILE */
@@ -3401,7 +3402,13 @@ static const char *(azHelp[]) = {
   "     --newlines             Allow unescaped newline characters in output",
   "   TABLE is LIKE pattern for the tables to dump",
   ".echo on|off             Turn command echo on or off",
-  ".eqp on|off|full         Enable or disable automatic EXPLAIN QUERY PLAN",
+  ".eqp on|off|full|...     Enable or disable automatic EXPLAIN QUERY PLAN",
+  "   Other Modes:",
+#ifdef SQLITE_DEBUG
+  "      test                  Show raw EXPLAIN QUERY PLAN output",
+  "      trace                 Like \"full\" but also enable \"PRAGMA vdbe_trace\"",
+#endif
+  "      trigger               Like \"full\" but also show trigger bytecode",
   ".excel                   Display the output of next command in a spreadsheet",
   ".exit ?CODE?             Exit this program with return-code CODE",
   ".expert                  EXPERIMENTAL. Suggest indexes for specified queries",
@@ -6264,18 +6271,30 @@ static int do_meta_command(char *zLine, ShellState *p){
   if( c=='e' && strncmp(azArg[0], "eqp", n)==0 ){
     if( nArg==2 ){
       p->autoEQPtest = 0;
+      if( p->autoEQPtrace ){
+        if( p->db ) sqlite3_exec(p->db, "PRAGMA vdbe_trace=OFF;", 0, 0, 0);
+        p->autoEQPtrace = 0;
+      }
       if( strcmp(azArg[1],"full")==0 ){
         p->autoEQP = AUTOEQP_full;
       }else if( strcmp(azArg[1],"trigger")==0 ){
         p->autoEQP = AUTOEQP_trigger;
+#ifdef SQLITE_DEBUG
       }else if( strcmp(azArg[1],"test")==0 ){
         p->autoEQP = AUTOEQP_on;
         p->autoEQPtest = 1;
+      }else if( strcmp(azArg[1],"trace")==0 ){
+        p->autoEQP = AUTOEQP_full;
+        p->autoEQPtrace = 1;
+        open_db(p, 0);
+        (void)sqlite3_table_column_metadata(p->db, "x","x",0,0,0,0,0,0);
+        sqlite3_exec(p->db, "PRAGMA vdbe_trace=ON;", 0, 0, 0);
+#endif
       }else{
         p->autoEQP = (u8)booleanValue(azArg[1]);
       }
     }else{
-      raw_printf(stderr, "Usage: .eqp off|on|trigger|full\n");
+      raw_printf(stderr, "Usage: .eqp off|on|trace|trigger|full\n");
       rc = 1;
     }
   }else