MDB_VL32 - fix prev commit

Only tweak length for read-only envs
rawpart
Howard Chu 9 years ago
parent 5eb25c5cb9
commit 9d75a82ae1
  1. 4
      libraries/liblmdb/mdb.c

@ -5803,8 +5803,8 @@ retry:
id3.mref = 1; id3.mref = 1;
if (id3.mid) if (id3.mid)
goto found; goto found;
/* don't map past last written page */ /* don't map past last written page in read-only envs */
if (pgno + MDB_RPAGE_CHUNK-1 > txn->mt_last_pgno) if ((env->me_flags & MDB_RDONLY) && pgno + MDB_RPAGE_CHUNK-1 > txn->mt_last_pgno)
id3.mcnt = txn->mt_last_pgno + 1 - pgno; id3.mcnt = txn->mt_last_pgno + 1 - pgno;
else else
id3.mcnt = MDB_RPAGE_CHUNK; id3.mcnt = MDB_RPAGE_CHUNK;

Loading…
Cancel
Save