summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-27 18:56:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-27 18:56:49 +0300
commitc2a929185c147fc85bbf91e2c537bcdd98f2e680 (patch)
tree5fe0631c2eeb9ec48399734a1c0373f3ac8fa664
parentd72594d45d5ce8b3fc74b5bde9a60b9a148fd322 (diff)
downloadmariadb-git-c2a929185c147fc85bbf91e2c537bcdd98f2e680.tar.gz
MDEV-17491 post-fix: GCC 7 -Wclass-memaccess
commit 3a37644a292415bcd73168f35e3d59fea6829a60 added a non-POD member buf_page_info_t::id, and thus GCC 7 or later would complain about a memset() call. Let my_malloc fill the memory for us.
-rw-r--r--storage/innobase/handler/i_s.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index 3c7c64ed130..c7e11311348 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -4612,15 +4612,13 @@ static int i_s_innodb_fill_buffer_lru(THD *thd, TABLE_LIST *tables, Item *)
/* Print error message if malloc fail */
info_buffer = (buf_page_info_t*) my_malloc(PSI_INSTRUMENT_ME,
- lru_len * sizeof *info_buffer, MYF(MY_WME));
+ lru_len * sizeof *info_buffer, MYF(MY_WME | MY_ZEROFILL));;
if (!info_buffer) {
status = 1;
goto exit;
}
- memset(info_buffer, 0, lru_len * sizeof *info_buffer);
-
/* Walk through Pool's LRU list and print the buffer page
information */
bpage = UT_LIST_GET_LAST(buf_pool.LRU);