1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-03 16:53:36 +03:00

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
This commit is contained in:
drh
2013-10-01 15:30:05 +00:00
parent 24b7fe9004
commit 4384e98e6e
3 changed files with 9 additions and 9 deletions

View File

@@ -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;
}