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 --- client/mysqlbinlog.cc | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'client/mysqlbinlog.cc') diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 2c05bb806a9..4ba76cb3ba1 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2867,16 +2867,25 @@ void *sql_alloc(size_t size) return alloc_root(&s_mem_root, size); } +uint e_key_get_latest_version_func(uint) { return 1; } +uint e_key_get_func(uint, uint, uchar*, uint*) { return 1; } +uint e_ctx_size_func(uint, uint) { return 1; } +int e_ctx_init_func(void *, const uchar*, uint, const uchar*, uint, + int, uint, uint) { return 1; } +int e_ctx_update_func(void *, const uchar*, uint, uchar*, uint*) { return 1; } +int e_ctx_finish_func(void *, uchar*, uint*) { return 1; } +uint e_encrypted_length_func(uint, uint, uint) { return 1; } + uint dummy1() { return 1; } struct encryption_service_st encryption_handler= { - (uint(*)(uint))dummy1, - (uint(*)(uint, uint, uchar*, uint*))dummy1, - (uint(*)(uint, uint))dummy1, - (int (*)(void*, const uchar*, uint, const uchar*, uint, int, uint, uint))dummy1, - (int (*)(void*, const uchar*, uint, uchar*, uint*))dummy1, - (int (*)(void*, uchar*, uint*))dummy1, - (uint (*)(uint, uint, uint))dummy1 + e_key_get_latest_version_func, + e_key_get_func, + e_ctx_size_func, + e_ctx_init_func, + e_ctx_update_func, + e_ctx_finish_func, + e_encrypted_length_func }; /* -- cgit v1.2.1