Skip to content

Commit a90415f

Browse files
committed
ITS#8310 fix mdb_rebalance cursor fixup
When collapsing root, must adjust entire cursor stack
1 parent 79b12bb commit a90415f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/liblmdb/mdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7970,9 +7970,9 @@ mdb_rebalance(MDB_cursor *mc)
79707970
m3 = &m2->mc_xcursor->mx_cursor;
79717971
else
79727972
m3 = m2;
7973-
if (m3 == mc || m3->mc_snum < mc->mc_snum) continue;
7973+
if (m3 == mc) continue;
79747974
if (m3->mc_pg[0] == mp) {
7975-
for (i=0; i<m3->mc_snum; i++) {
7975+
for (i=0; i<mc->mc_db->md_depth; i++) {
79767976
m3->mc_pg[i] = m3->mc_pg[i+1];
79777977
m3->mc_ki[i] = m3->mc_ki[i+1];
79787978
}

0 commit comments

Comments
 (0)