From 471b14a147e11ee9a8832c3968c17c356d9c3c9d 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: Sun, 22 Dec 2024 09:36:48 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-tests:=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D0=BA=D0=B0=20=D1=81=D0=BB=D1=83=D1=87=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D1=8F=20dbi-=D1=85?= =?UTF-8?q?=D0=B5=D0=BD=D0=B4=D0=BB=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/extra/early_close_dbi.c++ | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/extra/early_close_dbi.c++ b/test/extra/early_close_dbi.c++ index 42bb7adc..3eeea42c 100644 --- a/test/extra/early_close_dbi.c++ +++ b/test/extra/early_close_dbi.c++ @@ -98,5 +98,31 @@ int main(int argc, char *argv[]) { err = mdbx_env_close_ex(environment, true); assert(err == MDBX_SUCCESS); + // ------------------------------------------------------------------------- + + auto env = mdbx::env_managed(db_filename, mdbx::env_managed::operate_parameters(2)); + auto txn = env.start_write(); + auto dbi = txn.create_map("keller-case"); + txn.commit(); + + txn = env.start_write(); + txn.rename_map(dbi, "keller-case.renamed"); + txn.commit(); + + txn = env.start_write(); + auto dbi2 = txn.create_map("keller-case"); + txn.drop_map(dbi); + txn.drop_map(dbi2); + txn.commit(); + + err = mdbx_dbi_close(env, dbi); + assert(err == MDBX_BAD_DBI); + if (err != MDBX_BAD_DBI) + return 1; + err = mdbx_dbi_close(env, dbi2); + assert(err == MDBX_BAD_DBI); + if (err != MDBX_BAD_DBI) + return 2; + return 0; }