From 08508d34b3c672944904f772108c9c5715cc7d60 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 20 Jan 2019 10:14:59 +0300 Subject: [PATCH] mdbx: MDBX_BAD_DBI instead of MDBX_NOTFOUND in case table was dropped. Change-Id: I2894a5721d2be2bb982e7c7a607c6a0413f7e3ca --- src/mdbx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index 6e59a42b..c0310751 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -7195,13 +7195,13 @@ static int mdbx_page_search(MDBX_cursor *mc, MDBX_val *key, int flags) { return rc; rc = mdbx_page_search(&mc2, &mc->mc_dbx->md_name, 0); if (unlikely(rc != MDBX_SUCCESS)) - return rc; + return (rc == MDBX_NOTFOUND) ? MDBX_BAD_DBI : rc; { MDBX_val data; int exact = 0; MDBX_node *leaf = mdbx_node_search(&mc2, &mc->mc_dbx->md_name, &exact); if (!exact) - return MDBX_NOTFOUND; + return MDBX_BAD_DBI; if (unlikely((leaf->mn_flags & (F_DUPDATA | F_SUBDATA)) != F_SUBDATA)) return MDBX_INCOMPATIBLE; /* not a named DB */ rc = mdbx_node_read(&mc2, leaf, &data);