From 75e1da1f2d382872b941fe1eb3edbb38d46dde6c Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 19 Nov 2020 17:28:47 +0300 Subject: [PATCH] mdbx-test: fix speculum-check iterator. Change-Id: Idaeea908fdcd7b2c1248ae10eeb7f394d69bb987 --- test/test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test.cc b/test/test.cc index f23858f8..8541dfa6 100644 --- a/test/test.cc +++ b/test/test.cc @@ -749,8 +749,8 @@ void testcase::speculum_check_cursor(const char *where, const char *stage, MDBX_val cursor_key = {}; MDBX_val cursor_data = {}; int err; - if (std::next(it) == speculum.end() && op == MDBX_PREV && - (config.params.table_flags & MDBX_DUPSORT)) { + if (it != speculum.end() && std::next(it) == speculum.end() && + op == MDBX_PREV && (config.params.table_flags & MDBX_DUPSORT)) { /* Workaround for MDBX/LMDB flaw */ err = mdbx_cursor_get(cursor, &cursor_key, &cursor_data, MDBX_LAST); if (err == MDBX_SUCCESS)