From 3622433cf495bbed8f5b8f43bfd6343ad79e8ce0 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sat, 17 Apr 2021 19:02:48 +0300 Subject: [PATCH] mdbx: fix `page_copy()` for unspilling a large/overflow page. Change-Id: I46c6b6bf94c877c1c0142116c404692960dc5ab7 --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index b38502fb..1690e0f6 100644 --- a/src/core.c +++ b/src/core.c @@ -6354,7 +6354,7 @@ done: __hot static void mdbx_page_copy(MDBX_page *dst, MDBX_page *src, size_t psize) { STATIC_ASSERT(UINT16_MAX > MAX_PAGESIZE - PAGEHDRSZ); STATIC_ASSERT(MIN_PAGESIZE > PAGEHDRSZ + NODESIZE * 4); - if (!IS_LEAF2(src)) { + if ((src->mp_flags & (P_LEAF2 | P_OVERFLOW)) == 0) { size_t upper = src->mp_upper, lower = src->mp_lower, unused = upper - lower; /* If page isn't full, just copy the used portion. Adjust