summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-03-12 16:27:19 +0100
committerSergei Golubchik <serg@mariadb.org>2019-03-14 16:33:17 +0100
commit3d2d060b626a94a19480db55feecc3020440b5c3 (patch)
tree52a1c7c7add53908023d23f90a95a764bbc23d06 /sql/table.h
parentddfa722a03ab3649783f8798df02d94a8a8ef6e3 (diff)
downloadmariadb-git-3d2d060b626a94a19480db55feecc3020440b5c3.tar.gz
fix gcc 8 compiler warnings
There were two newly enabled warnings: 1. cast for a function pointers. Affected sql_analyse.h, mi_write.c and ma_write.cc, mf_iocache-t.cc, mysqlbinlog.cc, encryption.cc, etc 2. memcpy/memset of nontrivial structures. Fixed as: * the warning disabled for InnoDB * TABLE, TABLE_SHARE, and TABLE_LIST got a new method reset() which does the bzero(), which is safe for these classes, but any other bzero() will still cause a warning * Table_scope_and_contents_source_st uses `TABLE_LIST *` (trivial) instead of `SQL_I_List<TABLE_LIST>` (not trivial) so it's safe to bzero now. * added casts in debug_sync.cc and sql_select.cc (for JOIN) * move assignment method for MDL_request instead of memcpy() * PARTIAL_INDEX_INTERSECT_INFO::init() instead of bzero() * remove constructor from READ_RECORD() to make it trivial * replace some memcpy() with c++ copy assignments
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/table.h b/sql/table.h
index de10a966d1b..afe3220c943 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -789,6 +789,8 @@ struct TABLE_SHARE
/** Instrumentation for this table share. */
PSI_table_share *m_psi;
+ inline void reset() { bzero((void*)this, sizeof(*this)); }
+
/*
Set share's table cache key and update its db and table name appropriately.
@@ -1337,6 +1339,7 @@ public:
bool histograms_are_read;
MDL_ticket *mdl_ticket;
+ inline void reset() { bzero((void*)this, sizeof(*this)); }
void init(THD *thd, TABLE_LIST *tl);
bool fill_item_list(List<Item> *item_list) const;
void reset_item_list(List<Item> *item_list) const;
@@ -1763,6 +1766,7 @@ struct TABLE_LIST
Prepare TABLE_LIST that consists of one table instance to use in
open_and_lock_tables
*/
+ inline void reset() { bzero((void*)this, sizeof(*this)); }
inline void init_one_table(const char *db_name_arg,
size_t db_length_arg,
const char *table_name_arg,
@@ -1778,7 +1782,7 @@ struct TABLE_LIST
else
mdl_type= MDL_SHARED_READ;
- bzero((char*) this, sizeof(*this));
+ reset();
db= (char*) db_name_arg;
db_length= db_length_arg;
table_name= (char*) table_name_arg;
@@ -2272,8 +2276,7 @@ struct TABLE_LIST
@sa check_and_update_table_version()
*/
- inline
- bool is_table_ref_id_equal(TABLE_SHARE *s) const
+ inline bool is_table_ref_id_equal(TABLE_SHARE *s) const
{
return (m_table_ref_type == s->get_table_ref_type() &&
m_table_ref_version == s->get_table_ref_version());
@@ -2285,12 +2288,10 @@ struct TABLE_LIST
@sa check_and_update_table_version()
*/
- inline
- void set_table_ref_id(TABLE_SHARE *s)
+ inline void set_table_ref_id(TABLE_SHARE *s)
{ set_table_ref_id(s->get_table_ref_type(), s->get_table_ref_version()); }
- inline
- void set_table_ref_id(enum_table_ref_type table_ref_type_arg,
+ inline void set_table_ref_id(enum_table_ref_type table_ref_type_arg,
ulong table_ref_version_arg)
{
m_table_ref_type= table_ref_type_arg;