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

@ -1,5 +1,5 @@
C Fix\sanother\ssegfault\sin\sfts3\sthat\scould\soccur\swith\scorrupt\srecords.
D 2019-03-08T13:27:27.101
C Patch\smakes\sbalance_nonroot()\sslightly\ssmaller\sand\sfaster\sand\smore\srobust\nagainst\scorrupt\sdatabases.
D 2019-03-08T14:02:11.570
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 1ad7263f38329c0ecea543c80f30af839ee714ea77fc391bf1a3fbb919a5b6b5
@ -456,7 +456,7 @@ F src/auth.c 0fac71038875693a937e506bceb492c5f136dd7b1249fbd4ae70b4e8da14f9df
F src/backup.c 78d3cecfbe28230a3a9a1793e2ead609f469be43e8f486ca996006be551857ab
F src/bitvec.c 17ea48eff8ba979f1f5b04cc484c7bb2be632f33
F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
F src/btree.c 9abc4326303d6f5df9b9de07c753b226d4b7e75b8d3cf94262297c3b87b45b0a
F src/btree.c 51ff9c432f55f7fb8dca32d96707bc191327c1e29b1b83769d3ff6486df3948b
F src/btree.h 63b94fb38ce571c15eb6a3661815561b501d23d5948b2d1e951fbd7a2d04e8d3
F src/btreeInt.h 6111c15868b90669f79081039d19e7ea8674013f907710baa3c814dc3f8bfd3f
F src/build.c 3acec29b23948042173301a8befebae01a98344debf66cbd4467c8b9077707b8
@ -1806,7 +1806,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 235a9698f5e9b3c21dc51c9c5042becfb82fc1762a7519a46b9f9fdafe9b0f13
R 734a9708c695aee16b6fde3fd3f50b66
U dan
Z 98c784e94dcbc34d08f05edd66ffaae5
P fcc24edde471c2214add2dbc3a27da8890a7148105c5ffa024faf72457964a5f
R 46c774c6d7b16c2d77d5ef217f16ae20
U drh
Z aaf2befc3ba47077920e380e99d434ba

View File

@ -1 +1 @@
fcc24edde471c2214add2dbc3a27da8890a7148105c5ffa024faf72457964a5f
174da3c32c9caebd642c31cb594597ccd5bb2a7fc501b1f49aef0b7b4765bfca

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,