ITS#9116 LMDB: fix bogus error check in read-only txns

mdb.master
Howard Chu 5 years ago
parent 5c012bbe03
commit 0e895ffe43
  1. 2
      libraries/liblmdb/mdb.c

@ -6448,7 +6448,7 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags)
/* Make sure we're using an up-to-date root */ /* Make sure we're using an up-to-date root */
if (*mc->mc_dbflag & DB_STALE) { if (*mc->mc_dbflag & DB_STALE) {
MDB_cursor mc2; MDB_cursor mc2;
if (TXN_DBI_CHANGED(mc->mc_txn, mc->mc_dbi)) if (!F_ISSET(mc->mc_txn->mt_flags, MDB_TXN_RDONLY) && TXN_DBI_CHANGED(mc->mc_txn, mc->mc_dbi))
return MDB_BAD_DBI; return MDB_BAD_DBI;
mdb_cursor_init(&mc2, mc->mc_txn, MAIN_DBI, NULL); mdb_cursor_init(&mc2, mc->mc_txn, MAIN_DBI, NULL);
rc = mdb_page_search(&mc2, &mc->mc_dbx->md_name, 0); rc = mdb_page_search(&mc2, &mc->mc_dbx->md_name, 0);

Loading…
Cancel
Save