mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Never allow the b-tree layers view of the number of pages in the database
file exceed the actual number of pages in the database file, even when PRAGMA writeable_schema=ON. This helps with earlier detection of corruption, and prevents excess memory usage and CPU cycles in some integrity_check ops. FossilOrigin-Name: 0407c8793700491b8519a649b9624f569b0e7e9b94d0db79d4a08139e0ecdb69
This commit is contained in:
@@ -3945,8 +3945,7 @@ static void assertTruncateConstraint(Pager *pPager){
|
||||
** then continue writing to the database.
|
||||
*/
|
||||
void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){
|
||||
assert( pPager->dbSize>=nPage || CORRUPT_DB );
|
||||
testcase( pPager->dbSize<nPage );
|
||||
assert( pPager->dbSize>=nPage );
|
||||
assert( pPager->eState>=PAGER_WRITER_CACHEMOD );
|
||||
pPager->dbSize = nPage;
|
||||
|
||||
|
Reference in New Issue
Block a user