diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-01 20:34:06 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-01 20:34:06 +0300 |
commit | 69df4f834b09d2405610afc81f055658188ab8c2 (patch) | |
tree | 16ce9b3eec863307c5a5eafe79ac3c04e5017f9d /storage | |
parent | be51738465ff30eda627c72168e06e2ea9ca13f8 (diff) | |
download | mariadb-git-69df4f834b09d2405610afc81f055658188ab8c2.tar.gz |
MDEV-20377: Fix -Wunused-but-set-variable
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/data/data0data.cc | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc index b4d41f47060..fba06e78987 100644 --- a/storage/innobase/data/data0data.cc +++ b/storage/innobase/data/data0data.cc @@ -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); } |