]> git.sur5r.net Git - openldap/commitdiff
MDB_VL32 - fix prev commit
authorHoward Chu <hyc@openldap.org>
Tue, 22 Dec 2015 06:13:25 +0000 (06:13 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 22 Dec 2015 06:13:25 +0000 (06:13 +0000)
Only tweak length for read-only envs

libraries/liblmdb/mdb.c

index 516e69a7ecbfa403e0d05599100fb8cd447b9b2b..4ff49500a5567e783165dbafac31bf5565bd6c85 100644 (file)
@@ -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;