mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-10 03:54:13 +08:00
mdbx: backport - fix mdbx_set_attr().
Change-Id: I6628a0629a17f99f39098b8ccb76259cd65dd353
This commit is contained in:
parent
6760ca87ae
commit
4874852b79
3
mdbx.c
3
mdbx.c
@ -864,13 +864,14 @@ int mdbx_set_attr(MDB_txn *txn, MDB_dbi dbi,
|
||||
return rc;
|
||||
}
|
||||
|
||||
old_attr = 0;
|
||||
rc = mdbx_attr_peek(&old_data, &old_attr);
|
||||
if (unlikely(rc != MDB_SUCCESS))
|
||||
return rc;
|
||||
|
||||
if (old_attr == attr && (!data ||
|
||||
(data->mv_size == old_data.mv_size
|
||||
&& memcpy(data->mv_data, old_data.mv_data, old_data.mv_size) == 0)))
|
||||
&& memcmp(data->mv_data, old_data.mv_data, old_data.mv_size) == 0)))
|
||||
return MDB_SUCCESS;
|
||||
|
||||
mc.mc_next = txn->mt_cursors[dbi];
|
||||
|
Loading…
x
Reference in New Issue
Block a user