Reject attempts to open named databases if the main
database has flag MDB_DUPSORT or MDB_INTEGERKEY.
DUPSORT would require an xcursor for the DB, INTEGERKEY
would expect the DB name to be a binary integer.
if (!unused && txn->mt_numdbs >= txn->mt_env->me_maxdbs)
return MDB_DBS_FULL;
+ /* Cannot mix named databases with some mainDB flags */
+ if (txn->mt_dbs[MAIN_DBI].md_flags & (MDB_DUPSORT|MDB_INTEGERKEY))
+ return (flags & MDB_CREATE) ? MDB_INCOMPATIBLE : MDB_NOTFOUND;
+
/* Find the DB info */
dbflag = DB_NEW|DB_VALID;
exact = 0;