|
|
@ -7968,7 +7968,6 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned int flags, MDB_dbi *db |
|
|
|
txn->mt_dbflags[slot] = dbflag; |
|
|
|
txn->mt_dbflags[slot] = dbflag; |
|
|
|
memcpy(&txn->mt_dbs[slot], data.mv_data, sizeof(MDB_db)); |
|
|
|
memcpy(&txn->mt_dbs[slot], data.mv_data, sizeof(MDB_db)); |
|
|
|
*dbi = slot; |
|
|
|
*dbi = slot; |
|
|
|
txn->mt_env->me_dbflags[slot] = txn->mt_dbs[slot].md_flags; |
|
|
|
|
|
|
|
mdb_default_cmp(txn, slot); |
|
|
|
mdb_default_cmp(txn, slot); |
|
|
|
if (!unused) { |
|
|
|
if (!unused) { |
|
|
|
txn->mt_numdbs++; |
|
|
|
txn->mt_numdbs++; |
|
|
@ -8004,12 +8003,12 @@ void mdb_dbi_close(MDB_env *env, MDB_dbi dbi) |
|
|
|
free(ptr); |
|
|
|
free(ptr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int mdb_dbi_flags(MDB_env *env, MDB_dbi dbi, unsigned int *flags) |
|
|
|
int mdb_dbi_flags(MDB_txn *txn, MDB_dbi dbi, unsigned int *flags) |
|
|
|
{ |
|
|
|
{ |
|
|
|
/* We could return the flags for the FREE_DBI too but what's the point? */ |
|
|
|
/* We could return the flags for the FREE_DBI too but what's the point? */ |
|
|
|
if (dbi < MAIN_DBI || dbi >= env->me_numdbs) |
|
|
|
if (txn == NULL || dbi < MAIN_DBI || dbi >= txn->mt_numdbs) |
|
|
|
return EINVAL; |
|
|
|
return EINVAL; |
|
|
|
*flags = env->me_dbflags[dbi]; |
|
|
|
*flags = txn->mt_dbs[dbi].md_flags & PERSISTENT_FLAGS; |
|
|
|
return MDB_SUCCESS; |
|
|
|
return MDB_SUCCESS; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|