/ Check-in [a91cad33]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge the ".stat/.eqp" CLI fix from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | multikey-opt-idea
Files: files | file ages | folders
SHA3-256: a91cad3381bb843d6f58975251bf99f0fa1a1398fae53d97a98a6c8ee65e718e
User & Date: drh 2018-06-07 15:28:40
Context
2018-06-07
16:07
Test cases. check-in: 085e8637 user: drh tags: multikey-opt-idea
15:28
Merge the ".stat/.eqp" CLI fix from trunk. check-in: a91cad33 user: drh tags: multikey-opt-idea
15:23
Avoid using a prepared statement for ".stats on" after it has been closed by the ".eqp full" logic. Fix for ticket [7be932dfa60a8a6b3b26bcf76]. check-in: bb87c054 user: drh tags: trunk
14:59
Add the WHERE_IN_EARLYOUT flag and use it to clarify the logic of this optimization. check-in: 522f1eac user: drh tags: multikey-opt-idea
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/shell.c.in.

  2968   2968             sqlite3_free(zEQP);
  2969   2969           }
  2970   2970           if( pArg->autoEQP>=AUTOEQP_trigger && triggerEQP==0 ){
  2971   2971             sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 0, 0);
  2972   2972             /* Reprepare pStmt before reactiving trace modes */
  2973   2973             sqlite3_finalize(pStmt);
  2974   2974             sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
         2975  +          if( pArg ) pArg->pStmt = pStmt;
  2975   2976           }
  2976   2977           restore_debug_trace_modes();
  2977   2978         }
  2978   2979   
  2979   2980         if( pArg ){
  2980   2981           pArg->cMode = pArg->mode;
  2981   2982           if( pArg->autoExplain ){

Changes to test/shell1.test.

   632    632   do_test shell1-3.23b.3 {
   633    633     catchcmd "test.db" ".stats OFF"
   634    634   } {0 {}}
   635    635   do_test shell1-3.23b.4 {
   636    636     # too many arguments
   637    637     catchcmd "test.db" ".stats OFF BAD"
   638    638   } {1 {Usage: .stats ?on|off?}}
          639  +
          640  +# Ticket 7be932dfa60a8a6b3b26bcf7623ec46e0a403ddb 2018-06-07
          641  +# Adverse interaction between .stats and .eqp
          642  +#
          643  +do_test shell1-3.23b.5 {
          644  +  catchcmd "test.db" [string map {"\n    " "\n"} {
          645  +    CREATE TEMP TABLE t1(x);
          646  +    INSERT INTO t1 VALUES(1),(2);
          647  +    .stats on
          648  +    .eqp full
          649  +    SELECT * FROM t1;
          650  +  }]
          651  +} {/1\n2\n/}
   639    652   
   640    653   # .tables ?TABLE?        List names of tables
   641    654   #                          If TABLE specified, only list tables matching
   642    655   #                          LIKE pattern TABLE.
   643    656   do_test shell1-3.24.1 {
   644    657     catchcmd "test.db" ".tables"
   645    658   } {0 {}}