mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 22:24:13 +08:00
mdbx: fix assertion inside mdbx_page_retire()
.
Change-Id: I5d8f92b9fde1c961252757ea508403b5f51e7646
This commit is contained in:
parent
fe386a66df
commit
cea29fe485
@ -4188,8 +4188,13 @@ static int mdbx_page_retire(MDBX_cursor *mc, MDBX_page *mp) {
|
|||||||
const unsigned i = mdbx_pnl_exist(txn->tw.spill_pages, pgno << 1);
|
const unsigned i = mdbx_pnl_exist(txn->tw.spill_pages, pgno << 1);
|
||||||
if (i) {
|
if (i) {
|
||||||
/* This page is no longer spilled */
|
/* This page is no longer spilled */
|
||||||
|
#if MDBX_PNL_ASCENDING
|
||||||
mdbx_tassert(txn, i == MDBX_PNL_SIZE(txn->tw.spill_pages) ||
|
mdbx_tassert(txn, i == MDBX_PNL_SIZE(txn->tw.spill_pages) ||
|
||||||
txn->tw.spill_pages[i + 1] >= (pgno + npages) << 1);
|
txn->tw.spill_pages[i + 1] >= (pgno + npages) << 1);
|
||||||
|
#else
|
||||||
|
mdbx_tassert(txn, i == 1 || txn->tw.spill_pages[i - 1] >= (pgno + npages)
|
||||||
|
<< 1);
|
||||||
|
#endif
|
||||||
txn->tw.spill_pages[i] |= 1;
|
txn->tw.spill_pages[i] |= 1;
|
||||||
if (i == MDBX_PNL_SIZE(txn->tw.spill_pages))
|
if (i == MDBX_PNL_SIZE(txn->tw.spill_pages))
|
||||||
MDBX_PNL_SIZE(txn->tw.spill_pages) -= 1;
|
MDBX_PNL_SIZE(txn->tw.spill_pages) -= 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user