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

Fix a faulty assert() statement in balance_nonroot() - the assert() should use

get2byteNotZero() instead of get2byte() for the corner case where the
number cells is zero on a 65536-byte page.

FossilOrigin-Name: bcbe7d96df3c9515f679ccf671ca9ba89d081b53501495d4218eb5126196838b
This commit is contained in:
drh
2019-03-25 18:44:08 +00:00
parent af5a2e166d
commit 1c960269dd
4 changed files with 10 additions and 9 deletions

View File

@@ -8166,7 +8166,8 @@ static int balance_nonroot(
rc = defragmentPage(apNew[0], -1);
testcase( rc!=SQLITE_OK );
assert( apNew[0]->nFree ==
(get2byte(&apNew[0]->aData[5])-apNew[0]->cellOffset-apNew[0]->nCell*2)
(get2byteNotZero(&apNew[0]->aData[5]) - apNew[0]->cellOffset
- apNew[0]->nCell*2)
|| rc!=SQLITE_OK
);
copyNodeContent(apNew[0], pParent, &rc);