summaryrefslogtreecommitdiff
path: root/sql/opt_range.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/opt_range.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/opt_range.cc')
-rw-r--r--sql/opt_range.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 46b10b559b2..2f76f918e34 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1340,8 +1340,7 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
- Use rowids from unique to run a disk-ordered sweep
*/
-QUICK_INDEX_SORT_SELECT::QUICK_INDEX_SORT_SELECT(THD *thd_param,
- TABLE *table)
+QUICK_INDEX_SORT_SELECT::QUICK_INDEX_SORT_SELECT(THD *thd_param, TABLE *table)
:unique(NULL), pk_quick_select(NULL), thd(thd_param)
{
DBUG_ENTER("QUICK_INDEX_SORT_SELECT::QUICK_INDEX_SORT_SELECT");
@@ -5111,6 +5110,16 @@ typedef struct st_partial_index_intersect_info
key_map filtered_scans; /* scans to be filtered by cpk conditions */
MY_BITMAP *intersect_fields; /* bitmap of fields used in intersection */
+
+ void init()
+ {
+ common_info= NULL;
+ intersect_fields= NULL;
+ records_sent_to_unique= records= length= in_memory= use_cpk_filter= 0;
+ cost= index_read_cost= in_memory_cost= 0.0;
+ filtered_scans.init();
+ filtered_scans.clear_all();
+ }
} PARTIAL_INDEX_INTERSECT_INFO;
@@ -5247,8 +5256,7 @@ bool prepare_search_best_index_intersect(PARAM *param,
if (!n_index_scans)
return 1;
- bzero(init, sizeof(*init));
- init->filtered_scans.init();
+ init->init();
init->common_info= common;
init->cost= cutoff_cost;