1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Do not allow a backup to change the page size if a codec is in use.

FossilOrigin-Name: 5523ecd32295c188e3bf5dbd57d92d2879461e32
This commit is contained in:
drh
2010-08-20 15:32:21 +00:00
parent 4f05e38f09
commit 871919b493
3 changed files with 27 additions and 8 deletions

View File

@@ -221,6 +221,15 @@ static int backupOnePage(sqlite3_backup *p, Pgno iSrcPg, const u8 *zSrcData){
rc = SQLITE_READONLY;
}
#ifdef SQLITE_HAS_CODEC
/* Backup is not possible if the page size of the destination is changing
** a a codec is in use.
*/
if( nSrcPgsz!=nDestPgsz && sqlite3PagerGetCodec(pDestPager)!=0 ){
rc = SQLITE_READONLY;
}
#endif
/* This loop runs once for each destination page spanned by the source
** page. For each iteration, variable iOff is set to the byte offset
** of the destination page.