From 3d2d060b626a94a19480db55feecc3020440b5c3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 12 Mar 2019 16:27:19 +0100 Subject: 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` (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 --- sql/tztime.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sql/tztime.cc') diff --git a/sql/tztime.cc b/sql/tztime.cc index 279d5990460..60a3ceafe0a 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1537,16 +1537,11 @@ my_offset_tzs_get_key(Time_zone_offset *entry, static void tz_init_table_list(TABLE_LIST *tz_tabs) { - bzero(tz_tabs, sizeof(TABLE_LIST) * MY_TZ_TABLES_COUNT); - for (int i= 0; i < MY_TZ_TABLES_COUNT; i++) { - tz_tabs[i].alias= tz_tabs[i].table_name= tz_tables_names[i].str; - tz_tabs[i].table_name_length= tz_tables_names[i].length; - tz_tabs[i].db= tz_tables_db_name.str; - tz_tabs[i].db_length= tz_tables_db_name.length; - tz_tabs[i].lock_type= TL_READ; - + tz_tabs[i].init_one_table(tz_tables_db_name.str, tz_tables_db_name.length, + tz_tables_names[i].str, tz_tables_names[i].length, + NULL, TL_READ); if (i != MY_TZ_TABLES_COUNT - 1) tz_tabs[i].next_global= tz_tabs[i].next_local= &tz_tabs[i+1]; if (i != 0) -- cgit v1.2.1