https://bugs.openldap.org/show_bug.cgi?id=9430
kenta@lithdew.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED
--- Comment #2 from kenta@lithdew.net --- Found out the issue was due to a miscompilation from Zig's end - apologies on my end. I wrote the pseudocode test case up in C just to be extra sure.
#include <stdio.h> #include <assert.h> #include "lmdb.h"
int main(int argc, char * argv[]) { MDB_env *env; MDB_dbi dbi; MDB_val key, data; MDB_txn *txn; MDB_cursor *cursor; char sval[32];
assert(mdb_env_create(&env) == MDB_SUCCESS); assert(mdb_env_set_maxdbs(env, 2) == MDB_SUCCESS); assert(mdb_env_open(env, "./testdb", MDB_NOSUBDIR | MDB_WRITEMAP, 0664) == MDB_SUCCESS); assert(mdb_txn_begin(env, NULL, 0, &txn) == MDB_SUCCESS); assert(mdb_open(txn, NULL, 0, &dbi) == MDB_SUCCESS);
key.mv_data = "hello"; key.mv_size = sizeof(key.mv_data) - 1; data.mv_data = "test"; data.mv_size = sizeof(data.mv_data) - 1; assert(mdb_put(txn, dbi, &key, &data, 0) == MDB_SUCCESS);
data.mv_data = "world!"; data.mv_size = sizeof(data.mv_data) - 1; printf("(key: %s) -> (data: %s)\n", key.mv_data, data.mv_data); assert(mdb_put(txn, dbi, &key, &data, MDB_RESERVE | MDB_NOOVERWRITE) == MDB_KEYEXIST);
printf("(key: %s) -> (data: %s)\n", key.mv_data, data.mv_data);
mdb_close(env, dbi); mdb_env_close(env); return 0; }