mdbx: minor fix cursor_on_first/last for empty sub-db.

Change-Id: I68c2e1bd28e62c9512bf8ef711fe21573e3450b9
This commit is contained in:
Leonid Yuriev 2020-11-12 05:36:49 +03:00
parent 4ea2bea22e
commit 21bbba82fb

View File

@ -18615,7 +18615,7 @@ int mdbx_cursor_on_first(const MDBX_cursor *mc) {
: MDBX_EBADSIGN;
if (!(mc->mc_flags & C_INITIALIZED))
return MDBX_RESULT_FALSE;
return mc->mc_db->md_entries ? MDBX_RESULT_FALSE : MDBX_RESULT_TRUE;
for (unsigned i = 0; i < mc->mc_snum; ++i) {
if (mc->mc_ki[i])
@ -18634,7 +18634,7 @@ int mdbx_cursor_on_last(const MDBX_cursor *mc) {
: MDBX_EBADSIGN;
if (!(mc->mc_flags & C_INITIALIZED))
return MDBX_RESULT_FALSE;
return mc->mc_db->md_entries ? MDBX_RESULT_FALSE : MDBX_RESULT_TRUE;
for (unsigned i = 0; i < mc->mc_snum; ++i) {
unsigned nkeys = page_numkeys(mc->mc_pg[i]);