mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:24:13 +08:00
lmdb: fix b-tree walking bug in case empty db.
Change-Id: I28c0985493327babe4d2ae5c6cd56116a26e6034
This commit is contained in:
parent
a243a38aa6
commit
595f9e700d
8
mdb.c
8
mdb.c
@ -9727,6 +9727,10 @@ mdb_env_walk(mdb_walk_ctx_t *ctx, const char* dbi, pgno_t pg, int flags, int dee
|
||||
int rc;
|
||||
unsigned i;
|
||||
|
||||
/* Empty DB, nothing to do */
|
||||
if (pg == P_INVALID)
|
||||
return MDB_SUCCESS;
|
||||
|
||||
if (deep < 2) {
|
||||
if ((rc = mdb_page_get(ctx->mw_txn, pg, &mp, NULL)) != 0)
|
||||
return rc;
|
||||
@ -9736,10 +9740,6 @@ mdb_env_walk(mdb_walk_ctx_t *ctx, const char* dbi, pgno_t pg, int flags, int dee
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Empty DB, nothing to do */
|
||||
if (pg == P_INVALID)
|
||||
return MDB_SUCCESS;
|
||||
|
||||
mc.mc_snum = 1;
|
||||
mc.mc_top = 0;
|
||||
mc.mc_txn = ctx->mw_txn;
|
||||
|
Loading…
x
Reference in New Issue
Block a user