summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 06:07:58 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 06:07:58 +0000
commit0ba4adfdd09dc392ca8f7655b0a27295f477fa02 (patch)
tree2d94d8cfc4ade1ffec054f59257c45487ffd4861 /third_party/sqlite
parent2e6548cd07e1269bf1f0e84067737395a47dda11 (diff)
downloadchromium_src-0ba4adfdd09dc392ca8f7655b0a27295f477fa02.zip
chromium_src-0ba4adfdd09dc392ca8f7655b0a27295f477fa02.tar.gz
chromium_src-0ba4adfdd09dc392ca8f7655b0a27295f477fa02.tar.bz2
Account for reserved space in SQLite recover module.
Propagating nPageSize-nReserved from the top seems to do it. I was unable to affect this directly, I ended up testing by modifying PRAGMA page_size to set the reserved space to 4 bytes, then hacking recover2.test in my checkout to call that. BUG=none Review URL: https://chromiumcodereview.appspot.com/14559002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/sqlite')
-rw-r--r--third_party/sqlite/src/src/recover-alt.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/third_party/sqlite/src/src/recover-alt.c b/third_party/sqlite/src/src/recover-alt.c
index ce98866..ff4ae1c 100644
--- a/third_party/sqlite/src/src/recover-alt.c
+++ b/third_party/sqlite/src/src/recover-alt.c
@@ -207,9 +207,6 @@
* sqlite3_result_null() does not cause the default to be generate.
* Handling it ourselves seems hard, unfortunately.
*/
-/* TODO(shess): Account for the reserved region on pages (value from
- * offset 20 in the database header).
- */
#include <assert.h>
#include <ctype.h>
@@ -405,7 +402,7 @@ static int GetPager(sqlite3 *db, const char *zName,
}
*pPager = sqlite3BtreePager(pBt);
- *pnPageSize = sqlite3BtreeGetPageSize(pBt);
+ *pnPageSize = sqlite3BtreeGetPageSize(pBt) - sqlite3BtreeGetReserve(pBt);
return SQLITE_OK;
}
@@ -847,7 +844,6 @@ static int overflowMaybeCreate(DbPage *pPage, unsigned nPageSize,
* 1.5 of http://www.sqlite.org/fileformat2.html . maxLocal and
* minLocal to match naming in btree.c.
*/
- /* TODO(shess): Account for reserved space. */
const unsigned maxLocal = nPageSize - 35;
const unsigned minLocal = ((nPageSize-12)*32/255)-23; /* m */