mdbx: backport - fix regression in 0.9.19 (ITS#8760).

This commit is contained in:
Howard Chu 2018-05-04 17:14:14 +03:00 committed by Leo Yuriev
parent 9baca673ac
commit df08b5144c

7
mdb.c
View File

@ -10204,8 +10204,11 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned flags, MDB_dbi *dbi)
MDB_node *node = NODEPTR(mc.mc_pg[mc.mc_top], mc.mc_ki[mc.mc_top]); MDB_node *node = NODEPTR(mc.mc_pg[mc.mc_top], mc.mc_ki[mc.mc_top]);
if (unlikely((node->mn_flags & (F_DUPDATA|F_SUBDATA)) != F_SUBDATA)) if (unlikely((node->mn_flags & (F_DUPDATA|F_SUBDATA)) != F_SUBDATA))
return MDB_INCOMPATIBLE; return MDB_INCOMPATIBLE;
} else if (! (rc == MDB_NOTFOUND && (flags & MDB_CREATE))) { } else {
return rc; if (rc != MDB_NOTFOUND || !(flags & MDB_CREATE))
return rc;
if (F_ISSET(txn->mt_flags, MDB_TXN_RDONLY))
return EACCES;
} }
/* Done here so we cannot fail after creating a new DB */ /* Done here so we cannot fail after creating a new DB */