summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
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/sql_insert.cc
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/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 6455818993d..1745c6b4aaa 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4319,14 +4319,12 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
DBUG_ASSERT(thd->is_current_stmt_binlog_format_row());
DBUG_ASSERT(tables && *tables && count > 0);
- char buf[2048];
- String query(buf, sizeof(buf), system_charset_info);
+ StringBuffer<2048> query(system_charset_info);
int result;
TABLE_LIST tmp_table_list;
- memset(&tmp_table_list, 0, sizeof(tmp_table_list));
+ tmp_table_list.reset();
tmp_table_list.table = *tables;
- query.length(0); // Have to zero it since constructor doesn't
result= show_create_table(thd, &tmp_table_list, &query,
create_info, WITH_DB_NAME);