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).
Commit
21acf839cb954e676c710ef71f1a5f5e6be8215c
Parent
ba1429cef87c9cb…
1 file changed
+11
+11
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -1470,10 +1470,21 @@ | ||
| 1470 | 1470 | } |
| 1471 | 1471 | } |
| 1472 | 1472 | sqlite3_finalize(pExplain); |
| 1473 | 1473 | sqlite3_free(zEQP); |
| 1474 | 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 | |
| 1475 | 1486 | |
| 1476 | 1487 | /* If the shell is currently in ".explain" mode, gather the extra |
| 1477 | 1488 | ** data required to add indents to the output.*/ |
| 1478 | 1489 | if( pArg && pArg->mode==MODE_Explain ){ |
| 1479 | 1490 | explain_data_prepare(pArg, pStmt); |
| 1480 | 1491 |
| --- 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 |