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 --- storage/sequence/sequence.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'storage/sequence') diff --git a/storage/sequence/sequence.cc b/storage/sequence/sequence.cc index 8d9465f08c5..6a8625ce9b4 100644 --- a/storage/sequence/sequence.cc +++ b/storage/sequence/sequence.cc @@ -348,7 +348,9 @@ static int discover_table_existence(handlerton *hton, const char *db, return !parse_table_name(table_name, strlen(table_name), &from, &to, &step); } -static int dummy_ret_int() { return 0; } +static int dummy_commit_rollback(handlerton *, THD *, bool) { return 0; } + +static int dummy_savepoint(handlerton *, THD *, void *) { return 0; } /***************************************************************************** Example of a simple group by handler for queries like: @@ -487,10 +489,9 @@ static int init(void *p) hton->create= create_handler; hton->discover_table= discover_table; hton->discover_table_existence= discover_table_existence; - hton->commit= hton->rollback= - (int (*)(handlerton *, THD *, bool)) &dummy_ret_int; + hton->commit= hton->rollback= dummy_commit_rollback; hton->savepoint_set= hton->savepoint_rollback= hton->savepoint_release= - (int (*)(handlerton *, THD *, void *)) &dummy_ret_int; + dummy_savepoint; hton->create_group_by= create_group_by_handler; return 0; } -- cgit v1.2.1