Skip to content

Commit

Permalink
MDEV-20377: Fix -Wunused-but-set-variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jul 1, 2020
1 parent be51738 commit 69df4f8
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions storage/innobase/data/data0data.cc
Expand Up @@ -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);
}
Expand Down

0 comments on commit 69df4f8

Please sign in to comment.