mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:44:12 +08:00
mdbx: MDBX_BAD_DBI instead of MDBX_NOTFOUND in case table was dropped.
Change-Id: I2894a5721d2be2bb982e7c7a607c6a0413f7e3ca
This commit is contained in:
parent
5fd05db6ea
commit
08508d34b3
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user