|
|
@ -2681,12 +2681,16 @@ mdb_txn_renew0(MDB_txn *txn) |
|
|
|
txn->mt_dbflags[MAIN_DBI] = DB_VALID|DB_USRVALID; |
|
|
|
txn->mt_dbflags[MAIN_DBI] = DB_VALID|DB_USRVALID; |
|
|
|
txn->mt_dbflags[FREE_DBI] = DB_VALID; |
|
|
|
txn->mt_dbflags[FREE_DBI] = DB_VALID; |
|
|
|
|
|
|
|
|
|
|
|
if (env->me_maxpg < txn->mt_next_pgno) { |
|
|
|
if (env->me_flags & MDB_FATAL_ERROR) { |
|
|
|
mdb_txn_end(txn, new_notls /*0 or MDB_END_SLOT*/ | MDB_END_FAIL_BEGIN); |
|
|
|
DPUTS("environment had fatal error, must shutdown!"); |
|
|
|
return MDB_MAP_RESIZED; |
|
|
|
rc = MDB_PANIC; |
|
|
|
|
|
|
|
} else if (env->me_maxpg < txn->mt_next_pgno) { |
|
|
|
|
|
|
|
rc = MDB_MAP_RESIZED; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return MDB_SUCCESS; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
mdb_txn_end(txn, new_notls /*0 or MDB_END_SLOT*/ | MDB_END_FAIL_BEGIN); |
|
|
|
return MDB_SUCCESS; |
|
|
|
return rc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int |
|
|
|
int |
|
|
@ -2697,11 +2701,6 @@ mdb_txn_renew(MDB_txn *txn) |
|
|
|
if (!txn || !F_ISSET(txn->mt_flags, MDB_TXN_RDONLY|MDB_TXN_FINISHED)) |
|
|
|
if (!txn || !F_ISSET(txn->mt_flags, MDB_TXN_RDONLY|MDB_TXN_FINISHED)) |
|
|
|
return EINVAL; |
|
|
|
return EINVAL; |
|
|
|
|
|
|
|
|
|
|
|
if (txn->mt_env->me_flags & MDB_FATAL_ERROR) { |
|
|
|
|
|
|
|
DPUTS("environment had fatal error, must shutdown!"); |
|
|
|
|
|
|
|
return MDB_PANIC; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rc = mdb_txn_renew0(txn); |
|
|
|
rc = mdb_txn_renew0(txn); |
|
|
|
if (rc == MDB_SUCCESS) { |
|
|
|
if (rc == MDB_SUCCESS) { |
|
|
|
DPRINTF(("renew txn %"Z"u%c %p on mdbenv %p, root page %"Z"u", |
|
|
|
DPRINTF(("renew txn %"Z"u%c %p on mdbenv %p, root page %"Z"u", |
|
|
@ -2721,10 +2720,6 @@ mdb_txn_begin(MDB_env *env, MDB_txn *parent, unsigned int flags, MDB_txn **ret) |
|
|
|
flags &= MDB_TXN_BEGIN_FLAGS; |
|
|
|
flags &= MDB_TXN_BEGIN_FLAGS; |
|
|
|
flags |= env->me_flags & MDB_WRITEMAP; |
|
|
|
flags |= env->me_flags & MDB_WRITEMAP; |
|
|
|
|
|
|
|
|
|
|
|
if (env->me_flags & MDB_FATAL_ERROR) { |
|
|
|
|
|
|
|
DPUTS("environment had fatal error, must shutdown!"); |
|
|
|
|
|
|
|
return MDB_PANIC; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (env->me_flags & MDB_RDONLY & ~flags) /* write txn in RDONLY env */ |
|
|
|
if (env->me_flags & MDB_RDONLY & ~flags) /* write txn in RDONLY env */ |
|
|
|
return EACCES; |
|
|
|
return EACCES; |
|
|
|
|
|
|
|
|
|
|
|