Commit 69df4f83 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-20377: Fix -Wunused-but-set-variable

parent be517384
......@@ -194,29 +194,20 @@ dtuple_validate(
/*============*/
const dtuple_t* tuple) /*!< in: tuple */
{
const dfield_t* field;
ulint n_fields;
ulint len;
ulint i;
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
#ifdef HAVE_valgrind_or_MSAN
const ulint n_fields = dtuple_get_n_fields(tuple);
n_fields = dtuple_get_n_fields(tuple);
/* We dereference all the data of each field to test
for memory traps */
for (i = 0; i < n_fields; i++) {
field = dtuple_get_nth_field(tuple, i);
len = dfield_get_len(field);
for (ulint i = 0; i < n_fields; i++) {
const dfield_t* field = dtuple_get_nth_field(tuple, i);
if (!dfield_is_null(field)) {
MEM_CHECK_DEFINED(dfield_get_data(field), len);
MEM_CHECK_DEFINED(dfield_get_data(field),
dfield_get_len(field));
}
}
ut_a(dtuple_check_typed(tuple));
#endif /* HAVE_valgrind_or_MSAN */
ut_ad(dtuple_check_typed(tuple));
return(TRUE);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment