From 0ac9ba6472449b87d477c8c05cab32fdeda71be7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 3 May 2015 07:52:47 +0100 Subject: [PATCH] lmdb: ITS#8117 better fix. LY: This is not required for ReOpenLDAP, because it is not such issues related to int/long in cmp/dcmp. But let be more close to origin's sources. Origin: Don't change mc_dbx because we would need to undo the change if the txn aborts. Make the fix (for get) match existing code for put. Change-Id: I36f7ff99b4adf821cace5af6b0b84f5210eb454d --- mdb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mdb.c b/mdb.c index ce1090f8..2b9d37dc 100644 --- a/mdb.c +++ b/mdb.c @@ -5922,15 +5922,15 @@ set1: return rc; } } else if (op == MDB_GET_BOTH || op == MDB_GET_BOTH_RANGE) { - MDB_val d2; - if ((rc = mdb_node_read(mc->mc_txn, leaf, &d2)) != MDB_SUCCESS) + MDB_val olddata; + if ((rc = mdb_node_read(mc->mc_txn, leaf, &olddata)) != MDB_SUCCESS) return rc; - rc = mc->mc_dbx->md_dcmp(data, &d2); + rc = mc->mc_dbx->md_dcmp(data, &olddata); if (rc) { if (op == MDB_GET_BOTH || rc > 0) return MDB_NOTFOUND; rc = 0; - *data = d2; + *data = olddata; } } else {