Add error code MDB_MAP_RESIZED.

vmware
Hallvard Furuseth 12 years ago
parent 5e59695b8d
commit 7aba5f5ab9
  1. 8
      libraries/liblmdb/lmdb.h
  2. 8
      libraries/liblmdb/mdb.c

@ -353,7 +353,9 @@ typedef enum MDB_cursor_op {
#define MDB_CURSOR_FULL (-30787) #define MDB_CURSOR_FULL (-30787)
/** Page has not enough space - internal error */ /** Page has not enough space - internal error */
#define MDB_PAGE_FULL (-30786) #define MDB_PAGE_FULL (-30786)
#define MDB_LAST_ERRCODE MDB_PAGE_FULL /** Database contents grew beyond environment mapsize */
#define MDB_MAP_RESIZED (-30785)
#define MDB_LAST_ERRCODE MDB_MAP_RESIZED
/** @} */ /** @} */
/** @brief Statistics for a database in the environment */ /** @brief Statistics for a database in the environment */
@ -675,7 +677,9 @@ int mdb_env_set_maxdbs(MDB_env *env, MDB_dbi dbs);
* errors are: * errors are:
* <ul> * <ul>
* <li>#MDB_PANIC - a fatal error occurred earlier and the environment * <li>#MDB_PANIC - a fatal error occurred earlier and the environment
* must be shut down. - * must be shut down.
* <li>#MDB_MAP_RESIZED - another process wrote data beyond this MDB_env's
* mapsize and the environment must be shut down.
* <li>ENOMEM - out of memory, or a read-only transaction was requested and * <li>ENOMEM - out of memory, or a read-only transaction was requested and
* the reader lock table is full. See #mdb_env_set_maxreaders(). * the reader lock table is full. See #mdb_env_set_maxreaders().
* </ul> * </ul>

@ -1054,7 +1054,8 @@ static char *const mdb_errstr[] = {
"MDB_TLS_FULL: Thread-local storage keys full - too many environments open", "MDB_TLS_FULL: Thread-local storage keys full - too many environments open",
"MDB_TXN_FULL: Transaction has too many dirty pages - transaction too big", "MDB_TXN_FULL: Transaction has too many dirty pages - transaction too big",
"MDB_CURSOR_FULL: Internal error - cursor stack limit reached", "MDB_CURSOR_FULL: Internal error - cursor stack limit reached",
"MDB_PAGE_FULL: Internal error - page has no more space" "MDB_PAGE_FULL: Internal error - page has no more space",
"MDB_MAP_RESIZED: Database contents grew beyond environment mapsize",
}; };
char * char *
@ -1818,6 +1819,11 @@ mdb_txn_renew0(MDB_txn *txn)
if (txn->mt_numdbs > 2) if (txn->mt_numdbs > 2)
memset(txn->mt_dbflags+2, DB_STALE, txn->mt_numdbs-2); memset(txn->mt_dbflags+2, DB_STALE, txn->mt_numdbs-2);
if (env->me_maxpg < txn->mt_next_pgno) {
mdb_txn_reset0(txn);
return MDB_MAP_RESIZED;
}
return MDB_SUCCESS; return MDB_SUCCESS;
} }

Loading…
Cancel
Save