From: Howard Chu Date: Tue, 22 Dec 2015 06:13:25 +0000 (+0000) Subject: MDB_VL32 - fix prev commit X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9d75a82ae10fdcee80b8b8e82c6ef9b6ab83dc47;p=openldap MDB_VL32 - fix prev commit Only tweak length for read-only envs --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 516e69a7ec..4ff49500a5 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -5803,8 +5803,8 @@ retry: id3.mref = 1; if (id3.mid) goto found; - /* don't map past last written page */ - if (pgno + MDB_RPAGE_CHUNK-1 > txn->mt_last_pgno) + /* don't map past last written page in read-only envs */ + if ((env->me_flags & MDB_RDONLY) && pgno + MDB_RPAGE_CHUNK-1 > txn->mt_last_pgno) id3.mcnt = txn->mt_last_pgno + 1 - pgno; else id3.mcnt = MDB_RPAGE_CHUNK;