Fossil SCM

Put back code from shell.c < 3.8.7, needed for .explain mode: The SQLITE_TESTCTRL_EXPLAIN_STMT test_control became a nop then, but is still needed when linking with older SQLite (./configure --disable-internal-sqlite).

jan.nijtmans 2015-01-17 15:52 trunk
Commit 21acf839cb954e676c710ef71f1a5f5e6be8215c
1 file changed +11
+11
--- src/shell.c
+++ src/shell.c
@@ -1470,10 +1470,21 @@
14701470
}
14711471
}
14721472
sqlite3_finalize(pExplain);
14731473
sqlite3_free(zEQP);
14741474
}
1475
+
1476
+#if USE_SYSTEM_SQLITE+0==1
1477
+ /* Output TESTCTRL_EXPLAIN text of requested */
1478
+ if( pArg && pArg->mode==MODE_Explain && sqlite3_libversion_number()<3008007 ){
1479
+ const char *zExplain = 0;
1480
+ sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain);
1481
+ if( zExplain && zExplain[0] ){
1482
+ fprintf(pArg->out, "%s", zExplain);
1483
+ }
1484
+ }
1485
+#endif
14751486
14761487
/* If the shell is currently in ".explain" mode, gather the extra
14771488
** data required to add indents to the output.*/
14781489
if( pArg && pArg->mode==MODE_Explain ){
14791490
explain_data_prepare(pArg, pStmt);
14801491
--- src/shell.c
+++ src/shell.c
@@ -1470,10 +1470,21 @@
1470 }
1471 }
1472 sqlite3_finalize(pExplain);
1473 sqlite3_free(zEQP);
1474 }
 
 
 
 
 
 
 
 
 
 
 
1475
1476 /* If the shell is currently in ".explain" mode, gather the extra
1477 ** data required to add indents to the output.*/
1478 if( pArg && pArg->mode==MODE_Explain ){
1479 explain_data_prepare(pArg, pStmt);
1480
--- src/shell.c
+++ src/shell.c
@@ -1470,10 +1470,21 @@
1470 }
1471 }
1472 sqlite3_finalize(pExplain);
1473 sqlite3_free(zEQP);
1474 }
1475
1476 #if USE_SYSTEM_SQLITE+0==1
1477 /* Output TESTCTRL_EXPLAIN text of requested */
1478 if( pArg && pArg->mode==MODE_Explain && sqlite3_libversion_number()<3008007 ){
1479 const char *zExplain = 0;
1480 sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain);
1481 if( zExplain && zExplain[0] ){
1482 fprintf(pArg->out, "%s", zExplain);
1483 }
1484 }
1485 #endif
1486
1487 /* If the shell is currently in ".explain" mode, gather the extra
1488 ** data required to add indents to the output.*/
1489 if( pArg && pArg->mode==MODE_Explain ){
1490 explain_data_prepare(pArg, pStmt);
1491

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button