mdbx: fix mdbx_set_attr().

Change-Id: I6628a0629a17f99f39098b8ccb76259cd65dd353
This commit is contained in:
Leo Yuriev 2017-07-23 14:16:19 +03:00
parent b4e0344de7
commit 58f7674fa5

View File

@ -11279,13 +11279,13 @@ int mdbx_set_attr(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data,
return rc;
}
mdbx_attr_t old_attr;
mdbx_attr_t old_attr = 0;
rc = mdbx_attr_peek(&old_data, &old_attr);
if (unlikely(rc != MDBX_SUCCESS))
return rc;
if (old_attr == attr && (!data || (data->iov_len == old_data.iov_len &&
memcpy(data->iov_base, old_data.iov_base,
memcmp(data->iov_base, old_data.iov_base,
old_data.iov_len) == 0)))
return MDBX_SUCCESS;