diff options
author | Michael Widenius <monty@mariadb.org> | 2018-04-11 02:20:22 +0300 |
---|---|---|
committer | Michael Widenius <monty@mariadb.org> | 2018-04-16 20:16:43 +0300 |
commit | ddc5764303dd72f68d2c69cc574a6f42e8bcf86d (patch) | |
tree | ce22119346b027d359a909f7e272330dabd4c19b /sql | |
parent | dbbe70e1cfe9d7635d9dba774a2c9dc61163b542 (diff) | |
download | mariadb-git-ddc5764303dd72f68d2c69cc574a6f42e8bcf86d.tar.gz |
Remove compiler warnings
- Remove unused variables
- Mark variables unused
- Fix wrong types
- Add no-strict-aliasing to BUILD scripts
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_jsonfunc.cc | 2 | ||||
-rw-r--r-- | sql/item_sum.cc | 6 | ||||
-rw-r--r-- | sql/opt_split.cc | 2 | ||||
-rw-r--r-- | sql/rpl_rli.cc | 2 | ||||
-rw-r--r-- | sql/slave.cc | 4 | ||||
-rw-r--r-- | sql/sql_base.cc | 4 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 |
7 files changed, 12 insertions, 10 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 4b2de7cf28b..58e50f5d3a1 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -2615,7 +2615,7 @@ String *Item_func_json_remove::val_str(String *str) { uint array_counters[JSON_DEPTH_LIMIT]; json_path_with_flags *c_path= paths + n_path; - const char *rem_start, *rem_end; + const char *rem_start= 0, *rem_end; const json_path_step_t *lp; uint n_item= 0; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 2ec7e3c338f..2d47aeb179d 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2456,7 +2456,7 @@ Item *Item_sum_max::copy_or_same(THD* thd) bool Item_sum_max::add() { - Item *tmp_item; + Item * UNINIT_VAR(tmp_item); DBUG_ENTER("Item_sum_max::add"); DBUG_PRINT("enter", ("this: %p", this)); @@ -2661,7 +2661,7 @@ void Item_sum_num::reset_field() void Item_sum_hybrid::reset_field() { - Item *tmp_item, *arg0; + Item *UNINIT_VAR(tmp_item), *arg0; DBUG_ENTER("Item_sum_hybrid::reset_field"); arg0= args[0]; @@ -3018,7 +3018,7 @@ Item *Item_sum_avg::result_item(THD *thd, Field *field) void Item_sum_hybrid::update_field() { DBUG_ENTER("Item_sum_hybrid::update_field"); - Item *tmp_item; + Item *UNINIT_VAR(tmp_item); if (unlikely(direct_added)) { tmp_item= args[0]; diff --git a/sql/opt_split.cc b/sql/opt_split.cc index 6467706bc0b..063ca9fd940 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -862,7 +862,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, table_map tables_usable_for_splitting= spl_opt_info->tables_usable_for_splitting; KEYUSE_EXT *keyuse_ext= &join->ext_keyuses_for_splitting->at(0); - KEYUSE_EXT *best_key_keyuse_ext_start; + KEYUSE_EXT *UNINIT_VAR(best_key_keyuse_ext_start); TABLE *best_table= 0; double best_rec_per_key= DBL_MAX; SplM_plan_info *spl_plan= 0; diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 04109ddadb4..c79a6440e84 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1520,7 +1520,7 @@ scan_one_gtid_slave_pos_table(THD *thd, HASH *hash, DYNAMIC_ARRAY *array, LEX_CSTRING *tablename, void **out_hton) { TABLE_LIST tlist; - TABLE *table; + TABLE *UNINIT_VAR(table); bool table_opened= false; bool table_scanned= false; struct gtid_pos_element tmp_entry, *entry; diff --git a/sql/slave.cc b/sql/slave.cc index bf70db66f35..05b9c519017 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -356,7 +356,7 @@ end: static void handle_gtid_pos_auto_create_request(THD *thd, void *hton) { - int err; + int UNINIT_VAR(err); plugin_ref engine= NULL, *auto_engines; rpl_slave_state::gtid_pos_table *entry; StringBuffer<FN_REFLEN> loc_table_name; @@ -6069,7 +6069,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) { int error= 0; StringBuffer<1024> error_msg; - ulonglong inc_pos; + ulonglong inc_pos= 0; ulonglong event_pos; Relay_log_info *rli= &mi->rli; mysql_mutex_t *log_lock= rli->relay_log.get_log_lock(); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 5ce6a6b001c..3de45b0ad66 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6548,7 +6548,7 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2, Query_arena *arena, backup; bool result= TRUE; bool first_outer_loop= TRUE; - Field *field_1, *field_2; + Field *field_1; field_visibility_t field_1_invisible, field_2_invisible; /* Leaf table references to which new natural join columns are added @@ -6572,6 +6572,8 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2, { bool found= FALSE; const LEX_CSTRING *field_name_1; + Field *field_2= 0; + /* true if field_name_1 is a member of using_fields */ bool is_using_column_1; if (!(nj_col_1= it_1.get_or_create_column_ref(thd, leaf_1))) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index fbcf09758e6..2593bac7462 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4891,7 +4891,7 @@ end_with_restore_list: unit->set_limit(select_lex); MYSQL_DELETE_START(thd->query()); - Protocol *save_protocol; + Protocol * UNINIT_VAR(save_protocol); bool replaced_protocol= false; if (!select_lex->item_list.is_empty()) |