mdbx-test: fix speculum-check iterator.

Change-Id: Idaeea908fdcd7b2c1248ae10eeb7f394d69bb987
This commit is contained in:
Leonid Yuriev 2020-11-19 17:28:47 +03:00
parent 1bbf20bf39
commit 75e1da1f2d

View File

@ -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)