summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-03-12 14:09:39 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-03-12 14:09:39 +0200
commit3dfda08702df0a1e2aee5bd62c9e4d95915cd08a (patch)
tree6c87b4575263c6484c0ddcd04a9788d69233eff2
parent8d4e3ec2f7fff72e8a5383f7efcf62635cdef937 (diff)
downloadmariadb-git-3dfda08702df0a1e2aee5bd62c9e4d95915cd08a.tar.gz
MDEV-21212 fixup: GCC -Wclass-memaccess
-rw-r--r--storage/innobase/buf/buf0buf.cc2
-rw-r--r--storage/innobase/include/buf0buf.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index a98d8551df8..416e8be746c 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -3897,8 +3897,8 @@ void buf_pool_invalidate()
buf_pool.freed_page_clock = 0;
buf_pool.LRU_old = NULL;
buf_pool.LRU_old_len = 0;
+ buf_pool.stat.init();
- memset(&buf_pool.stat, 0x00, sizeof(buf_pool.stat));
buf_refresh_io_stats();
mysql_mutex_unlock(&buf_pool.mutex);
}
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index b95ae70c794..56c741bcb0e 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1220,6 +1220,9 @@ struct buf_buddy_free_t {
/** @brief The buffer pool statistics structure. */
struct buf_pool_stat_t{
+ /** Initialize the counters */
+ void init() { memset((void*) this, 0, sizeof *this); }
+
ib_counter_t<ulint> n_page_gets;
/*!< number of page gets performed;
also successful searches through