mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
When copying a rollback mode database over a WAL database using the backup API, leave the destination database in WAL mode (instead of switching it to rollback mode). Fix for [af95b8c609].
FossilOrigin-Name: 35e6ac18e3d030095da57fff87a288939e9be93f
This commit is contained in:
@@ -419,6 +419,15 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){
|
||||
sqlite3ResetInternalSchema(p->pDestDb, -1);
|
||||
}
|
||||
|
||||
if( destMode==PAGER_JOURNALMODE_WAL ){
|
||||
/* This call cannot fail. The success of the BtreeUpdateMeta()
|
||||
** method above indicates that a write transaction has been opened
|
||||
** and page 1 is already dirty. Therefore this always succeeds.
|
||||
*/
|
||||
TESTONLY(int rc2 =) sqlite3BtreeSetVersion(p->pDest, 2);
|
||||
assert( rc2==SQLITE_OK );
|
||||
}
|
||||
|
||||
/* Set nDestTruncate to the final number of pages in the destination
|
||||
** database. The complication here is that the destination page
|
||||
** size may be different to the source page size.
|
||||
|
Reference in New Issue
Block a user