Fossil SCM
Revert to SQLite trunk's version of shell.c (3.8.7.1 missed a bug-fix already there). Re-add some lines needed for pre-3.8.7 compatibility (needed with configure --disable-internal-sqlite).
Commit
963c950cd6ac8cc8b9503f20a90ffac8e383c1de
Parent
37cfe7ad9891d6d…
1 file changed
+12
-1
+12
-1
| --- src/shell.c | ||
| +++ src/shell.c | ||
| @@ -880,11 +880,11 @@ | ||
| 880 | 880 | for(i=0; i<nArg; i++){ |
| 881 | 881 | output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1); |
| 882 | 882 | } |
| 883 | 883 | fprintf(p->out,"%s",p->newline); |
| 884 | 884 | } |
| 885 | - if( azArg>0 ){ | |
| 885 | + if( nArg>0 ){ | |
| 886 | 886 | for(i=0; i<nArg; i++){ |
| 887 | 887 | output_csv(p, azArg[i], i<nArg-1); |
| 888 | 888 | } |
| 889 | 889 | fprintf(p->out,"%s",p->newline); |
| 890 | 890 | } |
| @@ -1350,10 +1350,21 @@ | ||
| 1350 | 1350 | } |
| 1351 | 1351 | } |
| 1352 | 1352 | sqlite3_finalize(pExplain); |
| 1353 | 1353 | sqlite3_free(zEQP); |
| 1354 | 1354 | } |
| 1355 | + | |
| 1356 | +#if USE_SYSTEM_SQLITE+0==1 | |
| 1357 | + /* Output TESTCTRL_EXPLAIN text of requested */ | |
| 1358 | + if( pArg && pArg->mode==MODE_Explain && sqlite3_libversion_number()<3008007 ){ | |
| 1359 | + const char *zExplain = 0; | |
| 1360 | + sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain); | |
| 1361 | + if( zExplain && zExplain[0] ){ | |
| 1362 | + fprintf(pArg->out, "%s", zExplain); | |
| 1363 | + } | |
| 1364 | + } | |
| 1365 | +#endif | |
| 1355 | 1366 | |
| 1356 | 1367 | /* If the shell is currently in ".explain" mode, gather the extra |
| 1357 | 1368 | ** data required to add indents to the output.*/ |
| 1358 | 1369 | if( pArg && pArg->mode==MODE_Explain ){ |
| 1359 | 1370 | explain_data_prepare(pArg, pStmt); |
| 1360 | 1371 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -880,11 +880,11 @@ | |
| 880 | for(i=0; i<nArg; i++){ |
| 881 | output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1); |
| 882 | } |
| 883 | fprintf(p->out,"%s",p->newline); |
| 884 | } |
| 885 | if( azArg>0 ){ |
| 886 | for(i=0; i<nArg; i++){ |
| 887 | output_csv(p, azArg[i], i<nArg-1); |
| 888 | } |
| 889 | fprintf(p->out,"%s",p->newline); |
| 890 | } |
| @@ -1350,10 +1350,21 @@ | |
| 1350 | } |
| 1351 | } |
| 1352 | sqlite3_finalize(pExplain); |
| 1353 | sqlite3_free(zEQP); |
| 1354 | } |
| 1355 | |
| 1356 | /* If the shell is currently in ".explain" mode, gather the extra |
| 1357 | ** data required to add indents to the output.*/ |
| 1358 | if( pArg && pArg->mode==MODE_Explain ){ |
| 1359 | explain_data_prepare(pArg, pStmt); |
| 1360 |
| --- src/shell.c | |
| +++ src/shell.c | |
| @@ -880,11 +880,11 @@ | |
| 880 | for(i=0; i<nArg; i++){ |
| 881 | output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1); |
| 882 | } |
| 883 | fprintf(p->out,"%s",p->newline); |
| 884 | } |
| 885 | if( nArg>0 ){ |
| 886 | for(i=0; i<nArg; i++){ |
| 887 | output_csv(p, azArg[i], i<nArg-1); |
| 888 | } |
| 889 | fprintf(p->out,"%s",p->newline); |
| 890 | } |
| @@ -1350,10 +1350,21 @@ | |
| 1350 | } |
| 1351 | } |
| 1352 | sqlite3_finalize(pExplain); |
| 1353 | sqlite3_free(zEQP); |
| 1354 | } |
| 1355 | |
| 1356 | #if USE_SYSTEM_SQLITE+0==1 |
| 1357 | /* Output TESTCTRL_EXPLAIN text of requested */ |
| 1358 | if( pArg && pArg->mode==MODE_Explain && sqlite3_libversion_number()<3008007 ){ |
| 1359 | const char *zExplain = 0; |
| 1360 | sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain); |
| 1361 | if( zExplain && zExplain[0] ){ |
| 1362 | fprintf(pArg->out, "%s", zExplain); |
| 1363 | } |
| 1364 | } |
| 1365 | #endif |
| 1366 | |
| 1367 | /* If the shell is currently in ".explain" mode, gather the extra |
| 1368 | ** data required to add indents to the output.*/ |
| 1369 | if( pArg && pArg->mode==MODE_Explain ){ |
| 1370 | explain_data_prepare(pArg, pStmt); |
| 1371 |