Fossil SCM

Cherry-pick [http://www.sqlite.org/src/info/19fe4a0a475bd94f491031aea7a183f7c0515cf3|19fe4a0a47]: Fix a (probably harmless) bug in the CSV output mode of the command-line shell. Put back some code, removed by [http://fossil-scm.org/index.html/fdiff?v1=c00220cdd7f2027780bc25b78376c16dc24e4b7d&v2=38f627b0885191357f55902a3ac199de90d79715&sbs=1|c001fa0edf]: when fossil is linked with SQLite < 3.8.7 it might still be needed to produce the same EXPLAIN output.

jan.nijtmans 2014-10-19 21:15 trunk
Commit f6b69db3c88cb96e25fac3bfda4baad56760e717
1 file changed +12 -1
+12 -1
--- src/shell.c
+++ src/shell.c
@@ -880,11 +880,11 @@
880880
for(i=0; i<nArg; i++){
881881
output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1);
882882
}
883883
fprintf(p->out,"%s",p->newline);
884884
}
885
- if( azArg>0 ){
885
+ if( nArg>0 ){
886886
for(i=0; i<nArg; i++){
887887
output_csv(p, azArg[i], i<nArg-1);
888888
}
889889
fprintf(p->out,"%s",p->newline);
890890
}
@@ -1350,10 +1350,21 @@
13501350
}
13511351
}
13521352
sqlite3_finalize(pExplain);
13531353
sqlite3_free(zEQP);
13541354
}
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
13551366
13561367
/* If the shell is currently in ".explain" mode, gather the extra
13571368
** data required to add indents to the output.*/
13581369
if( pArg && pArg->mode==MODE_Explain ){
13591370
explain_data_prepare(pArg, pStmt);
13601371
--- 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

Keyboard Shortcuts

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