mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx: backport - ITS#8299 fix page_merge cursor fixup.
The parent's mc_ki has changed. We need to fix that up as well in other cursors. Change-Id: I1f422a07ed75b99f3e36075749800c892ca6d5ec
This commit is contained in:
parent
b430c9a22f
commit
f35fb03f86
3
CHANGES
3
CHANGES
@ -5,8 +5,9 @@ LMDB 0.9.17 Release Engineering
|
||||
Fix ITS#8237 regression from ITS#7589
|
||||
Fix ITS#8221 MDB_PAGE_FULL on delete/rebalance
|
||||
Fix ITS#8258 rebalance/split assert
|
||||
Fix ITS#8264 cursor_del cursor tracking
|
||||
Fix ITS#8263 cursor_put cursor tracking
|
||||
Fix ITS#8264 cursor_del cursor tracking
|
||||
Fix ITS#8299 mdb_del cursor tracking
|
||||
Fix ITS#7771 fakepage cursor tracking
|
||||
Fix ITS#7789 ensure mapsize >= pages in use
|
||||
Fix ITS#7971 mdb_txn_renew0() new reader slots
|
||||
|
8
mdb.c
8
mdb.c
@ -7936,6 +7936,7 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst)
|
||||
/* Adjust other cursors pointing to mp */
|
||||
MDB_cursor *m2, *m3;
|
||||
MDB_dbi dbi = csrc->mc_dbi;
|
||||
unsigned top = csrc->mc_top;
|
||||
|
||||
for (m2 = csrc->mc_txn->mt_cursors[dbi]; m2; m2=m2->mc_next) {
|
||||
if (csrc->mc_flags & C_SUB)
|
||||
@ -7944,9 +7945,10 @@ mdb_page_merge(MDB_cursor *csrc, MDB_cursor *cdst)
|
||||
m3 = m2;
|
||||
if (m3 == csrc) continue;
|
||||
if (m3->mc_snum < csrc->mc_snum) continue;
|
||||
if (m3->mc_pg[csrc->mc_top] == psrc) {
|
||||
m3->mc_pg[csrc->mc_top] = pdst;
|
||||
m3->mc_ki[csrc->mc_top] += nkeys;
|
||||
if (m3->mc_pg[top] == psrc) {
|
||||
m3->mc_pg[top] = pdst;
|
||||
m3->mc_ki[top] += nkeys;
|
||||
m3->mc_ki[top-1] = cdst->mc_ki[top-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user