mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:34:13 +08:00
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
This commit is contained in:
parent
59d6560fc3
commit
0ac9ba6472
8
mdb.c
8
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user