We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af99820 commit 98ed192Copy full SHA for 98ed192
libraries/liblmdb/mdb.c
@@ -8589,8 +8589,12 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd)
8589
/* Set metapage 1 */
8590
mm->mm_last_pg = txn->mt_next_pgno - freecount - 1;
8591
mm->mm_dbs[1] = txn->mt_dbs[1];
8592
- mm->mm_dbs[1].md_root = mm->mm_last_pg;
8593
- mm->mm_txnid = 1;
+ if (mm->mm_last_pg > 1) {
+ mm->mm_dbs[1].md_root = mm->mm_last_pg;
8594
+ mm->mm_txnid = 1;
8595
+ } else {
8596
+ mm->mm_dbs[1].md_root = P_INVALID;
8597
+ }
8598
}
8599
my.mc_wlen[0] = env->me_psize * 2;
8600
my.mc_txn = txn;
0 commit comments