From 0e895ffe4391fd9a8a484395887a9f7d156b86ae Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 10 Nov 2019 04:58:35 +0000 Subject: [PATCH] ITS#9116 LMDB: fix bogus error check in read-only txns --- libraries/liblmdb/mdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index f685421..3cee0b2 100644 --- a/libraries/liblmdb/mdb.c +++ b/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 */ if (*mc->mc_dbflag & DB_STALE) { 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; mdb_cursor_init(&mc2, mc->mc_txn, MAIN_DBI, NULL); rc = mdb_page_search(&mc2, &mc->mc_dbx->md_name, 0);