aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-08-20 15:32:21 +0000
committerdrh <drh@noemail.net>2010-08-20 15:32:21 +0000
commit871919b49331ea30425bbd7218a21b8853955dcc (patch)
tree5d676c62fe97d9fffdf6fb6ff2dc624d3d3d00e2 /src
parent4f05e38f098095cdb2818518c1621dbcc0226441 (diff)
downloadsqlite-871919b49331ea30425bbd7218a21b8853955dcc.tar.gz
sqlite-871919b49331ea30425bbd7218a21b8853955dcc.zip
Do not allow a backup to change the page size if a codec is in use.
FossilOrigin-Name: 5523ecd32295c188e3bf5dbd57d92d2879461e32
Diffstat (limited to 'src')
-rw-r--r--src/backup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backup.c b/src/backup.c
index 41fa2c360..1fc01e1ad 100644
--- a/src/backup.c
+++ b/src/backup.c
@@ -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.