1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Bug fixes in the overwrite optimization.

FossilOrigin-Name: 0cb6cd2a6a596afaa1cca6c5f5abc2ea75d04f254c7debaf36ecd6a90b66aed6
This commit is contained in:
drh
2018-05-03 12:57:48 +00:00
parent 3de5d16cf7
commit 9b03192e15
3 changed files with 10 additions and 13 deletions

View File

@@ -8215,12 +8215,12 @@ static int btreeOverwriteCell(BtCursor *pCur, const BtreePayload *pX){
do{
rc = btreeGetPage(pBt, ovflPgno, &pPage, 0);
if( rc ) return rc;
if( iOffset+ovflPageSize>nTotal ){
ovflPgno = get4byte(pPage->aData + ovflPageSize);
if( iOffset+ovflPageSize<nTotal ){
ovflPgno = get4byte(pPage->aData);
}else{
ovflPageSize = nTotal - iOffset;
}
rc = btreeOverwriteContent(pPage, pPage->aData, pX,
rc = btreeOverwriteContent(pPage, pPage->aData+4, pX,
iOffset, ovflPageSize);
if( rc ) return rc;
iOffset += ovflPageSize;