Full_Name: Salvador Ortiz
Submission from: (NULL) (220.127.116.11)
Using mdb_dbi_flags with newly created database fails or lies.
mdb_dbi_flags() has been changed to take a txn instead of an env pointer.
Fixed in mdb.master.
In the case of MAIN _DBI, if I set some flags in mdb_dbi_open, the
propagated to the environment, I think the fix is simple:
@@ -7881,6 +7881,7 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned
int flags, MDB_dbi *db
/* make sure flag changes get committed */
if ((txn->mt_dbs[MAIN_DBI].md_flags | f2) !=
txn->mt_dbs[MAIN_DBI].md_flags |= f2;
+ txn->mt_env->me_dbflags[MAIN_DBI] =
txn->mt_flags |= MDB_TXN_DIRTY;
But in the case of a newly created named database, env->me_numdbs isn't adjusted
until the transaction is committed, so mdb_env_flags fails.
The more that I think about it, seems that the proper way to get the flags of an
opened db is with a new API, something like:
int mbd_get_flags(MDB_txn *, MDB_dbi dbi, unsigned int *flags)
if (txn == NULL || arg == NULL || dbi >= txn->mt_numdbs)
*flags = txn->mt_dbflags[dbi];
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/