From 4874852b796c0570376b184e2d689e97e14733b1 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Sun, 23 Jul 2017 14:16:19 +0300 Subject: [PATCH] mdbx: backport - fix mdbx_set_attr(). Change-Id: I6628a0629a17f99f39098b8ccb76259cd65dd353 --- mdbx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mdbx.c b/mdbx.c index 009b9d43..60ce25e3 100644 --- a/mdbx.c +++ b/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];