From b4dcf148c527aa26ebe036ee71a714738e0cf525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Thu, 22 Aug 2024 00:00:29 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20assert-=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B5=20=D1=81=D0=BE=D0=B7=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86?= =?UTF-8?q?=D1=8B=20=D1=81=20=D0=B4=D1=80=D1=83=D0=B3=D0=B8=D0=BC=D0=B8=20?= =?UTF-8?q?=D1=84=D0=BB=D0=B0=D0=B3=D0=B0=D0=BC=D0=B8/=D0=BE=D0=BF=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=D0=BC=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Сообщение о проблеме https://t.me/libmdbx/6101 --- src/dbi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dbi.c b/src/dbi.c index 5e43234d..bc0e9dcb 100644 --- a/src/dbi.c +++ b/src/dbi.c @@ -279,12 +279,14 @@ int dbi_bind(MDBX_txn *txn, const size_t dbi, unsigned user_flags, } else if ((user_flags & MDBX_CREATE) == 0) return /* FIXME: return extended info */ MDBX_INCOMPATIBLE; else { - eASSERT(env, env->dbs_flags[dbi] & DB_VALID); if (txn->dbi_state[dbi] & DBI_STALE) { + eASSERT(env, env->dbs_flags[dbi] & DB_VALID); int err = tbl_fetch(txn, dbi); if (unlikely(err == MDBX_SUCCESS)) return err; } + eASSERT(env, ((env->dbs_flags[dbi] ^ txn->dbs[dbi].flags) & + DB_PERSISTENT_FLAGS) == 0); eASSERT(env, (txn->dbi_state[dbi] & (DBI_LINDO | DBI_VALID | DBI_STALE)) == (DBI_LINDO | DBI_VALID)); @@ -295,7 +297,7 @@ int dbi_bind(MDBX_txn *txn, const size_t dbi, unsigned user_flags, if (unlikely(txn->cursors[dbi])) return MDBX_DANGLING_DBI; env->dbs_flags[dbi] = DB_POISON; - atomic_store32(&env->dbi_seqs[dbi], dbi_seq_next(env, MAIN_DBI), + atomic_store32(&env->dbi_seqs[dbi], dbi_seq_next(env, dbi), mo_AcquireRelease); const uint32_t seq = dbi_seq_next(env, dbi);