summaryrefslogtreecommitdiff
path: root/sql/sql_select.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_select.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_select.cc')
-rw-r--r--sql/sql_select.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 155e261ac34..280de2b2ef1 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2329,7 +2329,7 @@ void JOIN::restore_tmp()
{
DBUG_PRINT("info", ("restore_tmp this %p tmp_join %p", this, tmp_join));
DBUG_ASSERT(tmp_join != this);
- memcpy(tmp_join, this, (size_t) sizeof(JOIN));
+ memcpy((void*)tmp_join, this, (size_t) sizeof(JOIN));
}
@@ -3610,7 +3610,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
DBUG_RETURN(1);
/* The following should be optimized to only clear critical things */
- bzero(stat, sizeof(JOIN_TAB)* table_count);
+ bzero((void*)stat, sizeof(JOIN_TAB)* table_count);
/* Initialize POSITION objects */
for (i=0 ; i <= table_count ; i++)
(void) new ((char*) (join->positions + i)) POSITION;
@@ -8758,7 +8758,7 @@ get_best_combination(JOIN *join)
1. Put into main join order a JOIN_TAB that represents a lookup or scan
in the temptable.
*/
- bzero(j, sizeof(JOIN_TAB));
+ bzero((void*)j, sizeof(JOIN_TAB));
j->join= join;
j->table= NULL; //temporary way to tell SJM tables from others.
j->ref.key = -1;
@@ -9360,7 +9360,7 @@ JOIN::make_simple_join(JOIN *parent, TABLE *temp_table)
row_limit= unit->select_limit_cnt;
do_send_rows= row_limit ? 1 : 0;
- bzero(join_tab, sizeof(JOIN_TAB));
+ bzero((void*)join_tab, sizeof(JOIN_TAB));
join_tab->table=temp_table;
join_tab->set_select_cond(NULL, __LINE__);
join_tab->type= JT_ALL; /* Map through all records */
@@ -17275,11 +17275,11 @@ TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list)
NullS))
return 0;
- bzero(table, sizeof(*table));
- bzero(share, sizeof(*share));
+ table->reset();
table->field= field;
table->s= share;
table->temp_pool_slot= MY_BIT_NONE;
+ share->reset();
share->blob_field= blob_field;
share->fields= field_count;
setup_tmp_table_column_bitmaps(table, bitmaps);