*/
#define MDB_MAGIC 0xBEEFC0DE
- /** The version number for a database's file format. */
-#define MDB_VERSION 1
+ /** The version number for a database's datafile format. */
+#define MDB_DATA_VERSION 1
+ /** The version number for a database's lockfile format. */
+#define MDB_LOCK_VERSION 1
/** @brief The maximum size of a key in the database.
*
/** Stamp identifying this as an MDB file. It must be set
* to #MDB_MAGIC. */
uint32_t mtb_magic;
- /** Version number of this lock file. Must be set to #MDB_VERSION. */
+ /** Version number of this lock file. Must be set to #MDB_LOCK_VERSION. */
uint32_t mtb_version;
#if defined(_WIN32) || defined(MDB_USE_POSIX_SEM)
char mtb_rmname[MNAME_LEN];
/** Stamp identifying this as an MDB file. It must be set
* to #MDB_MAGIC. */
uint32_t mm_magic;
- /** Version number of this lock file. Must be set to #MDB_VERSION. */
+ /** Version number of this lock file. Must be set to #MDB_DATA_VERSION. */
uint32_t mm_version;
void *mm_address; /**< address for fixed mapping */
size_t mm_mapsize; /**< size of mmap region */
return MDB_INVALID;
}
- if (m->mm_version != MDB_VERSION) {
+ if (m->mm_version != MDB_DATA_VERSION) {
DPRINTF("database is version %u, expected version %u",
- m->mm_version, MDB_VERSION);
+ m->mm_version, MDB_DATA_VERSION);
return MDB_VERSION_MISMATCH;
}
GET_PAGESIZE(psize);
meta->mm_magic = MDB_MAGIC;
- meta->mm_version = MDB_VERSION;
+ meta->mm_version = MDB_DATA_VERSION;
meta->mm_mapsize = env->me_mapsize;
meta->mm_psize = psize;
meta->mm_last_pg = 1;
pthread_mutexattr_destroy(&mattr);
#endif /* _WIN32 || MDB_USE_POSIX_SEM */
- env->me_txns->mti_version = MDB_VERSION;
+ env->me_txns->mti_version = MDB_LOCK_VERSION;
env->me_txns->mti_magic = MDB_MAGIC;
env->me_txns->mti_txnid = 0;
env->me_txns->mti_numreaders = 0;
rc = MDB_INVALID;
goto fail;
}
- if (env->me_txns->mti_version != MDB_VERSION) {
+ if (env->me_txns->mti_version != MDB_LOCK_VERSION) {
DPRINTF("lock region is version %u, expected version %u",
- env->me_txns->mti_version, MDB_VERSION);
+ env->me_txns->mti_version, MDB_LOCK_VERSION);
rc = MDB_VERSION_MISMATCH;
goto fail;
}