1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Remove a broken assert() triggered by a "PRAGMA max_page_count = N"

invocation, where N is larger than the number of pages in the database image,
but smaller than the number of pages in the database file.

FossilOrigin-Name: 7cd56cad5efead5097e9918c87313bb46e583fe62bae0df1be60e10117e2c3cb
This commit is contained in:
dan
2019-01-19 15:27:09 +00:00
parent 93b6c1666d
commit b8852ae083
4 changed files with 21 additions and 9 deletions

View File

@@ -3839,7 +3839,10 @@ int sqlite3PagerMaxPageCount(Pager *pPager, int mxPage){
pPager->mxPgno = mxPage;
}
assert( pPager->eState!=PAGER_OPEN ); /* Called only by OP_MaxPgcnt */
assert( pPager->mxPgno>=pPager->dbSize ); /* OP_MaxPgcnt enforces this */
/* assert( pPager->mxPgno>=pPager->dbSize ); */
/* OP_MaxPgcnt ensures that the parameter passed to this function is not
** less than the total number of valid pages in the database. But this
** may be less than Pager.dbSize, and so the assert() above is not valid */
return pPager->mxPgno;
}