From 676fc941f14db99ab47b87c0ac25e4574212ac4f Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Wed, 29 Aug 2018 03:17:36 +0300 Subject: [PATCH] mdbx: fix accounting mdbx_cursor_del(). Change-Id: I19418e46ac1c692aa4eb346019c3a11539870f94 --- src/mdbx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mdbx.c b/src/mdbx.c index fcb8221a..fd948c23 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -8337,6 +8337,9 @@ int mdbx_cursor_del(MDBX_cursor *mc, unsigned flags) { if (leaf->mn_flags & F_SUBDATA) { /* add all the child DB's pages to the free list */ + mc->mc_db->md_branch_pages -= mc->mc_xcursor->mx_db.md_branch_pages; + mc->mc_db->md_leaf_pages -= mc->mc_xcursor->mx_db.md_leaf_pages; + mc->mc_db->md_overflow_pages -= mc->mc_xcursor->mx_db.md_overflow_pages; rc = mdbx_drop0(&mc->mc_xcursor->mx_cursor, 0); if (unlikely(rc)) goto fail;