https://bugs.openldap.org/show_bug.cgi?id=9949
--- Comment #2 from Howard Chu hyc@openldap.org --- Note that you can't create a DB in a readonly txn.
### E(mdb_env_create(&env)); E(mdb_env_set_maxdbs(env, 4)); E(mdb_env_open(env, "./testdb", MDB_FIXEDMAP /*|MDB_NOSYNC*/, 0664));
E(mdb_txn_begin(env, NULL, MDB_RDONLY, &txn)); E(mdb_dbi_open(txn, "db_name", MDB_CREATE, &dbi)); ### (gdb) br main Breakpoint 1 at 0x52d5: file 9949.c, line 25. (gdb) r Starting program: /home/hyc/OD/mdb/libraries/liblmdb/9949 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, main (argc=1, argv=0x7fffffffe5d8) at 9949.c:25 25 { (gdb) n 26 int i = 0, j = 0, rc; (gdb) 36 char sval[32] = ""; (gdb) 38 E(mdb_env_create(&env)); (gdb) 39 E(mdb_env_set_maxdbs(env, 4)); (gdb) 40 E(mdb_env_open(env, "./testdb", MDB_FIXEDMAP /*|MDB_NOSYNC*/, 0664)); (gdb) 42 E(mdb_txn_begin(env, NULL, MDB_RDONLY, &txn)); (gdb) 43 E(mdb_dbi_open(txn, "db_name", MDB_CREATE, &dbi)); (gdb) 9949.c:43: mdb_dbi_open(txn, "db_name", MDB_CREATE, &dbi): Permission denied
Program received signal SIGABRT, Aborted. 0x00007ffff7e11a7c in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6 (gdb)