mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 18:44: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;
|
return rc;
|
||||||
}
|
}
|
||||||
} else if (op == MDB_GET_BOTH || op == MDB_GET_BOTH_RANGE) {
|
} else if (op == MDB_GET_BOTH || op == MDB_GET_BOTH_RANGE) {
|
||||||
MDB_val d2;
|
MDB_val olddata;
|
||||||
if ((rc = mdb_node_read(mc->mc_txn, leaf, &d2)) != MDB_SUCCESS)
|
if ((rc = mdb_node_read(mc->mc_txn, leaf, &olddata)) != MDB_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
rc = mc->mc_dbx->md_dcmp(data, &d2);
|
rc = mc->mc_dbx->md_dcmp(data, &olddata);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
if (op == MDB_GET_BOTH || rc > 0)
|
if (op == MDB_GET_BOTH || rc > 0)
|
||||||
return MDB_NOTFOUND;
|
return MDB_NOTFOUND;
|
||||||
rc = 0;
|
rc = 0;
|
||||||
*data = d2;
|
*data = olddata;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user