summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-06-28 20:07:32 +0300
committerMonty <monty@mariadb.org>2020-07-02 17:57:34 +0300
commit65f831d17c84900c1faea49164688e2f5ce59563 (patch)
treec7c576c77fbee59de6b2a1c7d8ac5041e0e06f8d /storage/innobase
parent29f9e679adc90adf5d3c6e08da947789c9c2ac8b (diff)
downloadmariadb-git-65f831d17c84900c1faea49164688e2f5ce59563.tar.gz
Fixed bugs found by valgrind
- Some of the bug fixes are backports from 10.5! - The fix in innobase/fil/fil0fil.cc is just a backport to get less error messages in mysqld.1.err when running with valgrind. - Renamed HAVE_valgrind_or_MSAN to HAVE_valgrind
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/btr/btr0cur.cc8
-rw-r--r--storage/innobase/buf/buf0buddy.cc4
-rw-r--r--storage/innobase/buf/buf0lru.cc12
-rw-r--r--storage/innobase/data/data0data.cc4
-rw-r--r--storage/innobase/fil/fil0fil.cc3
-rw-r--r--storage/innobase/handler/ha_innodb.cc8
-rw-r--r--storage/innobase/include/dict0stats.ic4
-rw-r--r--storage/innobase/include/srv0mon.h6
-rw-r--r--storage/innobase/page/page0cur.cc8
-rw-r--r--storage/innobase/row/row0ftsort.cc4
-rw-r--r--storage/innobase/row/row0ins.cc4
-rw-r--r--storage/innobase/row/row0log.cc32
-rw-r--r--storage/innobase/row/row0merge.cc22
-rw-r--r--storage/innobase/row/row0sel.cc20
-rw-r--r--storage/innobase/row/row0upd.cc4
-rw-r--r--storage/innobase/trx/trx0trx.cc2
16 files changed, 73 insertions, 72 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index e7650b20507..d9684528195 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -1179,12 +1179,12 @@ btr_cur_search_to_nth_level_func(
ut_ad(!(index->type & DICT_FTS));
ut_ad(index->page != FIL_NULL);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(&cursor->up_match, sizeof cursor->up_match);
MEM_UNDEFINED(&cursor->up_bytes, sizeof cursor->up_bytes);
MEM_UNDEFINED(&cursor->low_match, sizeof cursor->low_match);
MEM_UNDEFINED(&cursor->low_bytes, sizeof cursor->low_bytes);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
#ifdef UNIV_DEBUG
cursor->up_match = ULINT_UNDEFINED;
cursor->low_match = ULINT_UNDEFINED;
@@ -3295,12 +3295,12 @@ btr_cur_optimistic_insert(
const page_size_t& page_size = block->page.size;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
if (page_size.is_compressed()) {
MEM_CHECK_DEFINED(page, page_size.logical());
MEM_CHECK_DEFINED(block->page.zip.data, page_size.physical());
}
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
leaf = page_is_leaf(page);
diff --git a/storage/innobase/buf/buf0buddy.cc b/storage/innobase/buf/buf0buddy.cc
index ed36bcb9703..f1849dc28bf 100644
--- a/storage/innobase/buf/buf0buddy.cc
+++ b/storage/innobase/buf/buf0buddy.cc
@@ -393,9 +393,9 @@ buf_buddy_block_free(
HASH_DELETE(buf_page_t, hash, buf_pool->zip_hash, fold, bpage);
ut_d(memset(buf, 0, srv_page_size));
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(buf, srv_page_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
block = (buf_block_t*) bpage;
buf_page_mutex_enter(block);
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index c81975a1f2c..3b058ee4fd8 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -1609,13 +1609,13 @@ func_exit:
order to avoid bogus Valgrind or MSAN warnings.*/
buf_block_t* block = reinterpret_cast<buf_block_t*>(bpage);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_MAKE_DEFINED(block->frame, srv_page_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
btr_search_drop_page_hash_index(block);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(block->frame, srv_page_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
buf_pool_mutex_enter(buf_pool);
@@ -1660,9 +1660,9 @@ buf_LRU_block_free_non_file_page(
buf_block_set_state(block, BUF_BLOCK_NOT_USED);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(block->frame, srv_page_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
/* Wipe page_no and space_id */
memset(block->frame + FIL_PAGE_OFFSET, 0xfe, 4);
memset(block->frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, 0xfe, 4);
diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc
index 49bb8715a51..47e58f1614a 100644
--- a/storage/innobase/data/data0data.cc
+++ b/storage/innobase/data/data0data.cc
@@ -229,7 +229,7 @@ dtuple_validate(
const dtuple_t* tuple) /*!< in: tuple */
{
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
const ulint n_fields = dtuple_get_n_fields(tuple);
for (ulint i = 0; i < n_fields; i++) {
@@ -240,7 +240,7 @@ dtuple_validate(
dfield_get_len(field));
}
}
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
ut_ad(dtuple_check_typed(tuple));
return(TRUE);
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 8928e4af5dc..4fa5fa4aa98 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -2281,7 +2281,8 @@ fil_check_pending_ops(const fil_space_t* space, ulint count)
if (ulint n_pending_ops = my_atomic_loadlint(&space->n_pending_ops)) {
- if (count > 5000) {
+ /* Give a warning every 10 second, starting after 1 second */
+ if ((count % 500) == 50) {
ib::warn() << "Trying to close/delete/truncate"
" tablespace '" << space->name
<< "' but there are " << n_pending_ops
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index f4d3b49c4a4..46b53d87bf3 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -7334,9 +7334,9 @@ build_template_field(
ut_ad(clust_index->table == index->table);
templ = prebuilt->mysql_template + prebuilt->n_template++;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(templ, sizeof *templ);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
templ->is_virtual = !field->stored_in_db();
if (!templ->is_virtual) {
@@ -8454,9 +8454,9 @@ calc_row_difference(
/* The field has changed */
ufield = uvect->fields + n_changed;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(ufield, sizeof *ufield);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
/* Let us use a dummy dfield to make the conversion
from the MySQL column format to the InnoDB format */
diff --git a/storage/innobase/include/dict0stats.ic b/storage/innobase/include/dict0stats.ic
index 98024935e16..3853af2d409 100644
--- a/storage/innobase/include/dict0stats.ic
+++ b/storage/innobase/include/dict0stats.ic
@@ -187,7 +187,7 @@ dict_stats_deinit(
table->stat_initialized = FALSE;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(&table->stat_n_rows, sizeof table->stat_n_rows);
MEM_UNDEFINED(&table->stat_clustered_index_size,
sizeof table->stat_clustered_index_size);
@@ -220,7 +220,7 @@ dict_stats_deinit(
&index->stat_n_leaf_pages,
sizeof(index->stat_n_leaf_pages));
}
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
dict_table_stats_unlock(table, RW_X_LATCH);
}
diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h
index 84e8ece2d77..eaf47789486 100644
--- a/storage/innobase/include/srv0mon.h
+++ b/storage/innobase/include/srv0mon.h
@@ -654,14 +654,14 @@ Use MONITOR_DEC if appropriate mutex protection exists.
} \
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
# define MONITOR_CHECK_DEFINED(value) do { \
mon_type_t m = value; \
MEM_CHECK_DEFINED(&m, sizeof m); \
} while (0)
-#else /* HAVE_valgrind_or_MSAN */
+#else /* HAVE_valgrind */
# define MONITOR_CHECK_DEFINED(value) (void) 0
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
#define MONITOR_INC_VALUE(monitor, value) \
MONITOR_CHECK_DEFINED(value); \
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index 46b2c73cf37..149f3be83d9 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -1248,7 +1248,7 @@ page_cur_insert_rec_low(
/* 1. Get the size of the physical record in the page */
rec_size = rec_offs_size(offsets);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
{
const void* rec_start
= rec - rec_offs_extra_size(offsets);
@@ -1263,7 +1263,7 @@ page_cur_insert_rec_low(
/* The variable-length header must be valid. */
MEM_CHECK_DEFINED(rec_start, extra_size);
}
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
/* 2. Try to find suitable space from page memory management */
@@ -1478,7 +1478,7 @@ page_cur_insert_rec_zip(
/* 1. Get the size of the physical record in the page */
rec_size = rec_offs_size(offsets);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
{
const void* rec_start
= rec - rec_offs_extra_size(offsets);
@@ -1493,7 +1493,7 @@ page_cur_insert_rec_zip(
/* The variable-length header must be valid. */
MEM_CHECK_DEFINED(rec_start, extra_size);
}
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
const bool reorg_before_insert = page_has_garbage(page)
&& rec_size > page_get_max_insert_size(page, 1)
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index c5b6276caf5..dde46b7aae1 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -998,14 +998,14 @@ exit:
goto func_exit;
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(block[i], srv_sort_buf_size);
if (crypt_block[i]) {
MEM_UNDEFINED(crypt_block[i],
srv_sort_buf_size);
}
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
}
buf[i] = row_merge_buf_empty(buf[i]);
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index f659cd4a0a1..adef0e53266 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -1243,10 +1243,10 @@ row_ins_foreign_check_on_constraint(
update->info_bits = 0;
update->n_fields = foreign->n_fields;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(update->fields,
update->n_fields * sizeof *update->fields);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
bool affects_fulltext = false;
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 97cd7c2a92b..43deb344346 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -372,9 +372,9 @@ row_log_online_op(
goto err_exit;
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(log->tail.buf, sizeof log->tail.buf);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
ut_ad(log->tail.bytes < srv_sort_buf_size);
avail_size = srv_sort_buf_size - log->tail.bytes;
@@ -459,10 +459,10 @@ write_failed:
index->type |= DICT_CORRUPT;
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(log->tail.block, srv_sort_buf_size);
MEM_UNDEFINED(buf, srv_sort_buf_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
memcpy(log->tail.block, log->tail.buf + avail_size,
mrec_size - avail_size);
@@ -472,9 +472,9 @@ write_failed:
ut_ad(b == log->tail.block + log->tail.bytes);
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(log->tail.buf, sizeof log->tail.buf);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
err_exit:
mutex_exit(&log->mutex);
}
@@ -506,9 +506,9 @@ row_log_table_open(
{
mutex_enter(&log->mutex);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(log->tail.buf, sizeof log->tail.buf);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
if (log->error != DB_SUCCESS) {
err_exit:
@@ -600,10 +600,10 @@ row_log_table_close_func(
write_failed:
log->error = DB_ONLINE_LOG_TOO_BIG;
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(log->tail.block, srv_sort_buf_size);
MEM_UNDEFINED(buf, srv_sort_buf_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
memcpy(log->tail.block, log->tail.buf + avail, size - avail);
log->tail.bytes = size - avail;
} else {
@@ -612,9 +612,9 @@ write_failed:
}
log->tail.total += size;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(log->tail.buf, sizeof log->tail.buf);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
err_exit:
mutex_exit(&log->mutex);
@@ -2785,9 +2785,9 @@ row_log_table_apply_ops(
ut_ad(new_trx_id_col > 0);
ut_ad(new_trx_id_col != ULINT_UNDEFINED);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(&mrec_end, sizeof mrec_end);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
offsets = static_cast<rec_offs*>(ut_malloc_nokey(i * sizeof *offsets));
rec_offs_set_n_alloc(offsets, i);
@@ -3696,9 +3696,9 @@ row_log_apply_ops(
ut_ad(!index->is_committed());
ut_ad(rw_lock_own(dict_index_get_lock(index), RW_LOCK_X));
ut_ad(index->online_log);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(&mrec_end, sizeof mrec_end);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
offsets = static_cast<rec_offs*>(ut_malloc_nokey(i * sizeof *offsets));
rec_offs_set_n_alloc(offsets, i);
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 3d21d1d2efc..2bfbbd0ba09 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -1027,11 +1027,11 @@ row_merge_buf_write(
ut_a(b < &block[srv_sort_buf_size]);
ut_a(b == &block[0] + buf->total_size);
*b++ = 0;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
/* The rest of the block is uninitialized. Initialize it
to avoid bogus warnings. */
memset(b, 0xff, &block[srv_sort_buf_size] - b);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
DBUG_LOG("ib_merge_sort",
"write " << reinterpret_cast<const void*>(b) << ','
<< of->fd << ',' << of->offset << " EOF");
@@ -1424,9 +1424,9 @@ row_merge_write_rec(
return(NULL);
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(&block[0], srv_sort_buf_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
/* Copy the rest. */
b = &block[0];
@@ -1477,7 +1477,7 @@ row_merge_write_eof(
DBUG_RETURN(NULL);
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(&block[0], srv_sort_buf_size);
#endif
DBUG_RETURN(&block[0]);
@@ -2680,10 +2680,10 @@ write_buffers:
break;
}
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(
&block[0], srv_sort_buf_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
}
}
merge_buf[i] = row_merge_buf_empty(buf);
@@ -3203,9 +3203,9 @@ row_merge(
foffs0 = 0;
foffs1 = ihalf;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(run_offset, *num_run * sizeof *run_offset);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
for (; foffs0 < ihalf && foffs1 < file->offset; foffs0++, foffs1++) {
@@ -3286,9 +3286,9 @@ row_merge(
*tmpfd = file->fd;
*file = of;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(&block[0], 3 * srv_sort_buf_size);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
return(DB_SUCCESS);
}
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index c3dc4e14094..c4c05888eb8 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -982,11 +982,11 @@ row_sel_get_clust_rec(
switch (err) {
case DB_SUCCESS:
case DB_SUCCESS_LOCKED_REC:
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
/* Declare the variable uninitialized.
It should be set to DB_SUCCESS at func_exit. */
MEM_UNDEFINED(&err, sizeof err);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
break;
default:
goto err_exit;
@@ -2742,9 +2742,9 @@ row_sel_field_store_in_mysql_format_func(
ut_ad(len != UNIV_SQL_NULL);
MEM_CHECK_DEFINED(data, len);
MEM_CHECK_ADDRESSABLE(dest, templ->mysql_col_len);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(dest, templ->mysql_col_len);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
switch (templ->type) {
const byte* field_end;
@@ -3653,9 +3653,9 @@ row_sel_copy_cached_field_for_mysql(
row_mysql_read_true_varchar(
&len, cache, templ->mysql_length_bytes);
len += templ->mysql_length_bytes;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(buf, templ->mysql_col_len);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
} else {
len = templ->mysql_col_len;
}
@@ -3724,9 +3724,9 @@ row_sel_dequeue_cached_row_for_mysql(
/* The record is long. Copy it field by field, in case
there are some long VARCHAR column of which only a
small length is being used. */
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(buf, prebuilt->mysql_prefix_len);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
/* First copy the NULL bits. */
ut_memcpy(buf, cached_rec, prebuilt->null_bitmap_len);
@@ -3810,10 +3810,10 @@ row_sel_fetch_last_buf(
}
ut_ad(prebuilt->fetch_cache_first == 0);
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(prebuilt->fetch_cache[prebuilt->n_fetch_cached],
prebuilt->mysql_row_len);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
return(prebuilt->fetch_cache[prebuilt->n_fetch_cached]);
}
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index ee432fdddb7..f63347e8589 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -1869,9 +1869,9 @@ row_upd_changes_ord_field_binary_func(
/* Silence a compiler warning without
silencing a Valgrind error. */
dfield_len = 0;
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
MEM_UNDEFINED(&dfield_len, sizeof dfield_len);
-#endif /* HAVE_valgrind_or_MSAN */
+#endif /* HAVE_valgrind */
/* See if the column is stored externally. */
buf = row_ext_lookup(ext, col_no, &dfield_len);
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 2e761cd7a16..c9b559c7307 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -458,7 +458,7 @@ void trx_free(trx_t*& trx)
MEM_UNDEFINED(&trx->state, sizeof trx->state);
MEM_UNDEFINED(&trx->mysql_thd, sizeof trx->mysql_thd);
#endif
-#ifdef HAVE_valgrind_or_MSAN
+#ifdef HAVE_valgrind
/* Unpoison the memory for innodb_monitor_set_option;
it is operating also on the freed transaction objects.
We checked that these were initialized in