diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-03-12 16:27:19 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-03-14 16:33:17 +0100 |
commit | 3d2d060b626a94a19480db55feecc3020440b5c3 (patch) | |
tree | 52a1c7c7add53908023d23f90a95a764bbc23d06 /sql/sql_alter.cc | |
parent | ddfa722a03ab3649783f8798df02d94a8a8ef6e3 (diff) | |
download | mariadb-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_alter.cc')
-rw-r--r-- | sql/sql_alter.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc index 243cf4c790f..ddac271146e 100644 --- a/sql/sql_alter.cc +++ b/sql/sql_alter.cc @@ -233,7 +233,7 @@ bool Sql_cmd_alter_table::execute(THD *thd) DBUG_RETURN(TRUE); /* purecov: inspected */ /* If it is a merge table, check privileges for merge children. */ - if (create_info.merge_list.first) + if (create_info.merge_list) { /* The user must have (SELECT_ACL | UPDATE_ACL | DELETE_ACL) on the @@ -271,7 +271,7 @@ bool Sql_cmd_alter_table::execute(THD *thd) */ if (check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL, - create_info.merge_list.first, FALSE, UINT_MAX, FALSE)) + create_info.merge_list, FALSE, UINT_MAX, FALSE)) DBUG_RETURN(TRUE); } @@ -282,9 +282,9 @@ bool Sql_cmd_alter_table::execute(THD *thd) { // Rename of table TABLE_LIST tmp_table; - memset(&tmp_table, 0, sizeof(tmp_table)); - tmp_table.table_name= lex->name.str; - tmp_table.db= select_lex->db; + tmp_table.init_one_table(select_lex->db, strlen(select_lex->db), + lex->name.str, lex->name.length, + lex->name.str, TL_IGNORE); tmp_table.grant.privilege= priv; if (check_grant(thd, INSERT_ACL | CREATE_ACL, &tmp_table, FALSE, UINT_MAX, FALSE)) |