mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-05 04:30:38 +03:00
Do the ".dump" command inside of a transaction to prevent other processes
from modifying the database while the dump is underway. Ticket [2466653295e65] FossilOrigin-Name: 1c00d5454c85dfddb6c628c3742b4ddeaad6423a
This commit is contained in:
@@ -1580,7 +1580,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, "PRAGMA writable_schema=ON", 0, 0, 0);
|
||||
sqlite3_exec(p->db, "BEGIN; PRAGMA writable_schema=ON", 0, 0, 0);
|
||||
p->nErr = 0;
|
||||
if( nArg==1 ){
|
||||
run_schema_dump_query(p,
|
||||
@@ -1613,7 +1613,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
}
|
||||
}
|
||||
if( p->writableSchema ){
|
||||
fprintf(p->out, "PRAGMA writable_schema=OFF;\n");
|
||||
fprintf(p->out, "PRAGMA writable_schema=OFF; COMMIT;\n");
|
||||
p->writableSchema = 0;
|
||||
}
|
||||
sqlite3_exec(p->db, "PRAGMA writable_schema=OFF", 0, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user