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

Patch makes balance_nonroot() slightly smaller and faster and more robust

against corrupt databases.

FossilOrigin-Name: 174da3c32c9caebd642c31cb594597ccd5bb2a7fc501b1f49aef0b7b4765bfca
This commit is contained in:
drh
2019-03-08 14:02:11 +00:00
parent 66b8457c7c
commit 4b986b2a47
3 changed files with 11 additions and 10 deletions

View File

@@ -7152,8 +7152,9 @@ static int editPage(
int iCell = (iOld + pPg->aiOvfl[i]) - iNew;
if( iCell>=0 && iCell<nNew ){
pCellptr = &pPg->aCellIdx[iCell * 2];
assert( nCell>=iCell );
memmove(&pCellptr[2], pCellptr, (nCell - iCell) * 2);
if( nCell>iCell ){
memmove(&pCellptr[2], pCellptr, (nCell - iCell) * 2);
}
nCell++;
if( pageInsertArray(
pPg, pBegin, &pData, pCellptr,