aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-08-19 15:11:34 +0000
committerdan <dan@noemail.net>2010-08-19 15:11:34 +0000
commita35dafcdeac215ffbe129fc03557da81624d7737 (patch)
treed0d2e0e9614b82ee7c687e1c3a9070e2dd741b90 /src
parent8311c47d8373890a262c497c8863f2ca1368ce5a (diff)
downloadsqlite-a35dafcdeac215ffbe129fc03557da81624d7737.tar.gz
sqlite-a35dafcdeac215ffbe129fc03557da81624d7737.zip
Modify the code for reading hot-journal files so that it can handle journals generated by versions 3.5.7 and earlier.
FossilOrigin-Name: b9170f2903c480bca2bdc986e98aaeadfdb9ad2b
Diffstat (limited to 'src')
-rw-r--r--src/pager.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pager.c b/src/pager.c
index 04b7c8275..df5150c7a 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -1509,6 +1509,14 @@ static int readJournalHdr(
return rc;
}
+ /* Versions of SQLite prior to 3.5.8 set the page-size field of the
+ ** journal header to zero. In this case, assume that the Pager.pageSize
+ ** variable is already set to the correct page size.
+ */
+ if( iPageSize==0 ){
+ iPageSize = pPager->pageSize;
+ }
+
/* Check that the values read from the page-size and sector-size fields
** are within range. To be 'in range', both values need to be a power
** of two greater than or equal to 512 or 32, and not greater than their