mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:24:13 +08:00
mdbx: don't resize mapping beyond used part of DB for read-only txn.
This allow reading extra large DB when used part is acceptable for current platform, i.e. reading DB >4G on a 32-bit platform.
This commit is contained in:
parent
488a272f8b
commit
e762442917
@ -6295,7 +6295,9 @@ static int mdbx_txn_renew0(MDBX_txn *txn, const unsigned flags) {
|
||||
mdbx_warning("%s", "environment had fatal error, must shutdown!");
|
||||
rc = MDBX_PANIC;
|
||||
} else {
|
||||
const size_t size = pgno2bytes(env, txn->mt_end_pgno);
|
||||
const size_t size =
|
||||
pgno2bytes(env, (txn->mt_flags & MDBX_TXN_RDONLY) ? txn->mt_next_pgno
|
||||
: txn->mt_end_pgno);
|
||||
if (unlikely(size > env->me_dxb_mmap.limit)) {
|
||||
if (txn->mt_geo.upper > MAX_PAGENO ||
|
||||
bytes2pgno(env, pgno2bytes(env, txn->mt_geo.upper)) !=
|
||||
|
Loading…
x
Reference in New Issue
Block a user