From 37829ce4933cc45068cca4e076f97a2a738f3fc6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 2 May 2024 16:29:03 +0100 Subject: [PATCH] ITS#10212 LMDB: init txnid for read-only DBs --- libraries/liblmdb/mdb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 6fc72631dd..83bd131d1a 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -2771,6 +2771,10 @@ mdb_txn_renew0(MDB_txn *txn) UNLOCK_MUTEX(rmutex); return MDB_READERS_FULL; } + if ((env->me_flags & MDB_RDONLY) && !ti->mti_txnid) { + meta = mdb_env_pick_meta(env); + ti->mti_txnid = meta->mm_txnid; + } r = &ti->mti_readers[i]; /* Claim the reader slot, carefully since other code * uses the reader table un-mutexed: First reset the -- 2.47.2