Fix the .dump command in the command-line shell so that it does not show

extraneous SELECT statements when ".echo on" is enabled.

FossilOrigin-Name: 11763cac33fa809bcf0294d1a381394fcf860b020b51fff81217ee709ba99272
This commit is contained in:
drh 2018-07-05 17:35:46 +00:00
parent 8bf6d705f3
commit f213b33c37
3 changed files with 11 additions and 10 deletions

View File

@ -1,5 +1,5 @@
C In\swal\smode,\sif\sa\s"BEGIN\sEXCLUSIVE"\scommand\s(or\sany\sother\scommand\sthat\nupgrades\sfrom\sno\stransaction\sdirectly\sto\sa\swrite\stransaction)\shits\san\nSQLITE_BUSY_SNAPSHOT\serror,\schange\sthe\serror\scode\sto\sSQLITE_BUSY\sto\sindicate\nto\sthe\scaller\sthat\sthe\scondition\smay\sbe\stransient.
D 2018-07-05T17:16:55.340
C Fix\sthe\s.dump\scommand\sin\sthe\scommand-line\sshell\sso\sthat\sit\sdoes\snot\sshow\nextraneous\sSELECT\sstatements\swhen\s".echo\son"\sis\senabled.
D 2018-07-05T17:35:46.748
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 0a3a6c81e6fcb969ff9106e882f0a08547014ba463cb6beca4c4efaecc924ee6
@ -496,7 +496,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
F src/resolve.c 1f965d00b4c26b7eb886b90c687069f5db0d05157dbc1ca406fe88e990eac671
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
F src/select.c 82aa95aa1cfeadef5ecae1126afff1efca64c49050bbf7116425a8a1d4fc5e6c
F src/shell.c.in 8578421c5fb2a972461b2a996f7173646e55e0dbd2a2eee30c8f5dc7d3dbadfd
F src/shell.c.in f1c79c537117ee61317a5ed85cdbcb854998cd690eb34ab803779358a2ace780
F src/sqlite.h.in 243e0b1d302c237372c06002fe84f731fd22587eccd142d15de834a5296514ff
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 9887b27e69c01e79c2cbe74ef73bf01af5b5703d6a7f0a4371e386d7249cb1c7
@ -1745,8 +1745,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 5a12db75d1da65daa92413a6b5892309e9d9479bb3610764e1015abe5bf28dbe e3357728472d5e57db6d7eef0ce008bdee071b5b07b60e242f383440eebe85bd
R 033b09a0f95c9e18f2482abfb8812158
T +closed e3357728472d5e57db6d7eef0ce008bdee071b5b07b60e242f383440eebe85bd
U dan
Z e957a80e23c286301ec669959e08c13c
P e6108047cb136119d8ed19af010a669ed9750b4e7f991ccabc9e3d15774eda31
R eebc653c116db5bba196348ae6abf96b
U drh
Z e2f5395825a2a7cefe1f3d098f5f112e

View File

@ -1 +1 @@
e6108047cb136119d8ed19af010a669ed9750b4e7f991ccabc9e3d15774eda31
11763cac33fa809bcf0294d1a381394fcf860b020b51fff81217ee709ba99272

View File

@ -5862,7 +5862,8 @@ static int do_meta_command(char *zLine, ShellState *p){
const char *zLike = 0;
int i;
int savedShowHeader = p->showHeader;
ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines);
int savedShellFlags = p->shellFlgs;
ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo);
for(i=1; i<nArg; i++){
if( azArg[i][0]=='-' ){
const char *z = azArg[i]+1;
@ -5944,6 +5945,7 @@ static int do_meta_command(char *zLine, ShellState *p){
sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0);
raw_printf(p->out, p->nErr ? "ROLLBACK; -- due to errors\n" : "COMMIT;\n");
p->showHeader = savedShowHeader;
p->shellFlgs = savedShellFlags;
}else
if( c=='e' && strncmp(azArg[0], "echo", n)==0 ){