mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-06 15:49:35 +03:00
Change the command-line shell to do the ".dump" inside of a SAVEPOINT
rather than a transaction, since this allows it to be run from within a transaction. FossilOrigin-Name: 6df7343b4c3de9ad8221180dc959dbbdf54733c7
This commit is contained in:
@@ -1591,7 +1591,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
fprintf(p->out, "PRAGMA foreign_keys=OFF;\n");
|
||||
fprintf(p->out, "BEGIN TRANSACTION;\n");
|
||||
p->writableSchema = 0;
|
||||
sqlite3_exec(p->db, "BEGIN; PRAGMA writable_schema=ON", 0, 0, 0);
|
||||
sqlite3_exec(p->db, "SAVEPOINT dump; PRAGMA writable_schema=ON", 0, 0, 0);
|
||||
p->nErr = 0;
|
||||
if( nArg==1 ){
|
||||
run_schema_dump_query(p,
|
||||
@@ -1624,10 +1624,11 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
}
|
||||
}
|
||||
if( p->writableSchema ){
|
||||
fprintf(p->out, "PRAGMA writable_schema=OFF; COMMIT;\n");
|
||||
fprintf(p->out, "PRAGMA writable_schema=OFF;\n");
|
||||
p->writableSchema = 0;
|
||||
}
|
||||
sqlite3_exec(p->db, "PRAGMA writable_schema=OFF", 0, 0, 0);
|
||||
sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0);
|
||||
sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0);
|
||||
fprintf(p->out, p->nErr ? "ROLLBACK; -- due to errors\n" : "COMMIT;\n");
|
||||
}else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user