| 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;
|
|
|