/ Check-in [11763cac]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the .dump command in the command-line shell so that it does not show extraneous SELECT statements when ".echo on" is enabled.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 11763cac33fa809bcf0294d1a381394fcf860b020b51fff81217ee709ba99272
User & Date: drh 2018-07-05 17:35:46
Context
2018-07-05
18:19
Fix a problem in the xInverse method of window-function group_concat(1). check-in: 73391283 user: dan tags: trunk
17:35
Fix the .dump command in the command-line shell so that it does not show extraneous SELECT statements when ".echo on" is enabled. check-in: 11763cac user: drh tags: trunk
17:16
In wal mode, if a "BEGIN EXCLUSIVE" command (or any other command that upgrades from no transaction directly to a write transaction) hits an SQLITE_BUSY_SNAPSHOT error, change the error code to SQLITE_BUSY to indicate to the caller that the condition may be transient. check-in: e6108047 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.in.

  5858   5858       rc = shell_dbinfo_command(p, nArg, azArg);
  5859   5859     }else
  5860   5860   
  5861   5861     if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){
  5862   5862       const char *zLike = 0;
  5863   5863       int i;
  5864   5864       int savedShowHeader = p->showHeader;
  5865         -    ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines);
         5865  +    int savedShellFlags = p->shellFlgs;
         5866  +    ShellClearFlag(p, SHFLG_PreserveRowid|SHFLG_Newlines|SHFLG_Echo);
  5866   5867       for(i=1; i<nArg; i++){
  5867   5868         if( azArg[i][0]=='-' ){
  5868   5869           const char *z = azArg[i]+1;
  5869   5870           if( z[0]=='-' ) z++;
  5870   5871           if( strcmp(z,"preserve-rowids")==0 ){
  5871   5872   #ifdef SQLITE_OMIT_VIRTUALTABLE
  5872   5873             raw_printf(stderr, "The --preserve-rowids option is not compatible"
................................................................................
  5940   5941         raw_printf(p->out, "PRAGMA writable_schema=OFF;\n");
  5941   5942         p->writableSchema = 0;
  5942   5943       }
  5943   5944       sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0);
  5944   5945       sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0);
  5945   5946       raw_printf(p->out, p->nErr ? "ROLLBACK; -- due to errors\n" : "COMMIT;\n");
  5946   5947       p->showHeader = savedShowHeader;
         5948  +    p->shellFlgs = savedShellFlags;
  5947   5949     }else
  5948   5950   
  5949   5951     if( c=='e' && strncmp(azArg[0], "echo", n)==0 ){
  5950   5952       if( nArg==2 ){
  5951   5953         setOrClearFlag(p, SHFLG_Echo, azArg[1]);
  5952   5954       }else{
  5953   5955         raw_printf(stderr, "Usage: .echo on|off\n");