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

Improved detection of a corrupt database schema. Fix for a problem discovered

by dbsqlfuzz.

FossilOrigin-Name: 30735432bc33cb953b6d7d2a2de9eb378f9740e0e663f50c727c3f138cd43a2b
This commit is contained in:
drh
2020-07-11 16:42:28 +00:00
parent 6af305de1e
commit a1085f0640
4 changed files with 13 additions and 9 deletions

View File

@@ -8772,7 +8772,11 @@ int sqlite3BtreeInsert(
assert( pPage->intKey || pX->nKey>=0 );
assert( pPage->leaf || !pPage->intKey );
if( pPage->nFree<0 ){
rc = btreeComputeFreeSpace(pPage);
if( pCur->eState>CURSOR_INVALID ){
rc = SQLITE_CORRUPT_BKPT;
}else{
rc = btreeComputeFreeSpace(pPage);
}
if( rc ) return rc;
}