#define MDB_CURSOR_FULL (-30787)
/** Page has not enough space - internal error */
#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 */
* errors are:
* <ul>
* <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
* the reader lock table is full. See #mdb_env_set_maxreaders().
* </ul>
"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_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 *
if (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;
}