diff options
author | drh <drh@noemail.net> | 2013-10-01 15:30:05 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-10-01 15:30:05 +0000 |
commit | 4384e98e6eef9a209ec7380689344c26a24d25f7 (patch) | |
tree | fb86e9397559aa761198d031d06ea127d04033b7 /src | |
parent | 24b7fe9004785bb2a82aee38aef7952461ff9a6d (diff) | |
download | sqlite-4384e98e6eef9a209ec7380689344c26a24d25f7.tar.gz sqlite-4384e98e6eef9a209ec7380689344c26a24d25f7.zip |
Change the ".dump" command in the command-line shell so that it COMMITs
if there are database corruption errors but invokes ROLLBACK on any other
kind of error.
FossilOrigin-Name: 473234632ff7617680ab151076153f5c1088e55b
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shell.c b/src/shell.c index ccdb157a8..9f0e3530b 100644 --- a/src/shell.c +++ b/src/shell.c @@ -974,7 +974,7 @@ static int run_table_dump_query( rc = sqlite3_prepare(p->db, zSelect, -1, &pSelect, 0); if( rc!=SQLITE_OK || !pSelect ){ fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); - p->nErr++; + if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++; return rc; } rc = sqlite3_step(pSelect); @@ -1001,7 +1001,7 @@ static int run_table_dump_query( rc = sqlite3_finalize(pSelect); if( rc!=SQLITE_OK ){ fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); - p->nErr++; + if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++; } return rc; } |