mdbx: backport - mdb_dbi_open(): Protect mainDB cursors (ITS#8542).

Change-Id: I5bdd3727eddc16a518c4b88534a3e7253e9789fd
This commit is contained in:
Hallvard Furuseth 2016-12-10 09:16:17 +01:00 committed by Leo Yuriev
parent 7b773e6f2d
commit ca97abb7f3

3
mdb.c
View File

@ -9874,7 +9874,8 @@ int mdb_dbi_open(MDB_txn *txn, const char *name, unsigned flags, MDB_dbi *dbi)
memset(&dummy, 0, sizeof(dummy));
dummy.md_root = P_INVALID;
dummy.md_flags = flags & PERSISTENT_FLAGS;
rc = mdb_cursor_put(&mc, &key, &data, F_SUBDATA);
WITH_CURSOR_TRACKING(mc,
rc = mdb_cursor_put(&mc, &key, &data, F_SUBDATA));
dbflag |= DB_DIRTY;
}