diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 05:34:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 05:34:59 +0000 |
commit | 36a5f1403a91d93db689e989ead3d9cf140c3cde (patch) | |
tree | 278cc6e7860205b0d40a895b977a46ea09018eb2 /libraries/liblmdb/mdb.c | |
parent | Releasing progress-linux version 2.6.7+dfsg-1~exp1~progress7.99u1. (diff) | |
download | openldap-36a5f1403a91d93db689e989ead3d9cf140c3cde.tar.xz openldap-36a5f1403a91d93db689e989ead3d9cf140c3cde.zip |
Merging upstream version 2.6.8+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libraries/liblmdb/mdb.c')
-rw-r--r-- | libraries/liblmdb/mdb.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 0570dea..668f966 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -1555,7 +1555,7 @@ mdb_strerror(int err) buf[0] = 0; FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, err, 0, ptr, MSGSIZE, (va_list *)buf+MSGSIZE); + NULL, err, 0, ptr, MSGSIZE, NULL); return ptr; #else if (err < 0) @@ -2796,9 +2796,14 @@ mdb_txn_renew0(MDB_txn *txn) do /* LY: Retry on a race, ITS#7970. */ r->mr_txnid = ti->mti_txnid; while(r->mr_txnid != ti->mti_txnid); + if (!r->mr_txnid && (env->me_flags & MDB_RDONLY)) { + meta = mdb_env_pick_meta(env); + r->mr_txnid = meta->mm_txnid; + } else { + meta = env->me_metas[r->mr_txnid & 1]; + } txn->mt_txnid = r->mr_txnid; txn->mt_u.reader = r; - meta = env->me_metas[txn->mt_txnid & 1]; } } else { @@ -5701,7 +5706,7 @@ mdb_page_search(MDB_cursor *mc, MDB_val *key, int flags) MDB_node *leaf = mdb_node_search(&mc2, &mc->mc_dbx->md_name, &exact); if (!exact) - return MDB_NOTFOUND; + return MDB_BAD_DBI; if ((leaf->mn_flags & (F_DUPDATA|F_SUBDATA)) != F_SUBDATA) return MDB_INCOMPATIBLE; /* not a named DB */ rc = mdb_node_read(&mc2, leaf, &data); |