Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(931)

Unified Diff: third_party/sqlite/amalgamation/sqlite3.c

Issue 885473002: [sql] Rewrite sqlite patching "system". (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typo in readme. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « third_party/sqlite/README.chromium ('k') | third_party/sqlite/fts2.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/amalgamation/sqlite3.c
diff --git a/third_party/sqlite/amalgamation/sqlite3.c b/third_party/sqlite/amalgamation/sqlite3.c
index 16a136b32481d3be473fbbad824027ed12765dcc..22092947bb57ea0d87af037357ed594e66bcfa90 100644
--- a/third_party/sqlite/amalgamation/sqlite3.c
+++ b/third_party/sqlite/amalgamation/sqlite3.c
@@ -82813,7 +82813,7 @@ static void trimFunc(
}
}
if( zCharSet ){
- sqlite3_free((void*)azChar);
+ sqlite3_free(azChar);
}
}
sqlite3_result_text(context, (char*)zIn, nIn, SQLITE_TRANSIENT);
@@ -109241,6 +109241,14 @@ static int openDatabase(
}
#endif
+#ifdef DEFAULT_ENABLE_RECOVER
+ /* Initialize recover virtual table for testing. */
+ extern int recoverVtableInit(sqlite3 *db);
+ if( !db->mallocFailed && rc==SQLITE_OK ){
+ rc = recoverVtableInit(db);
+ }
+#endif
+
#ifdef SQLITE_ENABLE_ICU
if( !db->mallocFailed && rc==SQLITE_OK ){
rc = sqlite3IcuInit(db);
@@ -110904,12 +110912,18 @@ static void interiorCursorSetPage(RecoverInteriorCursor *pCursor,
pCursor->nChildren = decodeUnsigned16(PageHeader(pPage) +
kiPageCellCountOffset) + 1;
- /* The maximum possible value for nChildren is:
+ /* Each child requires a 16-bit offset from an array after the header,
+ * and each child contains a 32-bit page number and at least a varint
+ * (min size of one byte). The final child page is in the header. So
+ * the maximum value for nChildren is:
* (nPageSize - kiPageInteriorHeaderBytes) /
* (sizeof(uint16) + sizeof(uint32) + 1) + 1
- * Each child requires a 16-bit offset from an array after the header, and
- * each child contains a 32-bit page number and at least a varint (min size of
- * one byte). The final child page is in the header.
+ */
+ /* TODO(shess): This count is very unlikely to be corrupted in
+ * isolation, so seeing this could signal to skip the page. OTOH, I
+ * can't offhand think of how to get here unless this or the page-type
+ * byte is corrupted. Could be an overflow page, but it would require
+ * a very large database.
*/
nMaxChildren =
(pCursor->nPageSize - kiPageInteriorHeaderBytes) / knMinCellLength + 1;
« no previous file with comments | « third_party/sqlite/README.chromium ('k') | third_party/sqlite/fts2.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698