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/mdl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sql/mdl.h') diff --git a/sql/mdl.h b/sql/mdl.h index 7961f1f24b2..15a1976876b 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -475,6 +475,16 @@ public: DBUG_ASSERT(ticket == NULL); type= type_arg; } + void move_from(MDL_request &from) + { + type= from.type; + duration= from.duration; + ticket= from.ticket; + next_in_list= from.next_in_list; + prev_in_list= from.prev_in_list; + key.mdl_key_init(&from.key); + from.ticket= NULL; // that's what "move" means + } /* This is to work around the ugliness of TABLE_LIST -- cgit v1.2.1