diff options
-rw-r--r-- | sql/log.cc | 2 | ||||
-rw-r--r-- | sql/opt_range.cc | 2 | ||||
-rw-r--r-- | sql/sql_cte.cc | 2 | ||||
-rw-r--r-- | sql/sql_partition.cc | 10 | ||||
-rw-r--r-- | sql/table.cc | 8 | ||||
-rw-r--r-- | storage/maria/ma_open.c | 2 |
6 files changed, 15 insertions, 11 deletions
diff --git a/sql/log.cc b/sql/log.cc index a905e2b8caf..23873922368 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2420,7 +2420,7 @@ static int find_uniq_filename(char *name, ulong next_log_number) char buff[FN_REFLEN], ext_buf[FN_REFLEN]; struct st_my_dir *dir_info; reg1 struct fileinfo *file_info; - ulong max_found, next, number; + ulong max_found, next, UNINIT_VAR(number); size_t buf_length, length; char *start, *end; int error= 0; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 04d2059eb62..7d57bbf4cb8 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -6729,7 +6729,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, bool update_tbl_stats, double read_time) { - uint idx, best_idx; + uint idx, UNINIT_VAR(best_idx); SEL_ARG *key_to_read= NULL; ha_rows UNINIT_VAR(best_records); /* protected by key_to_read */ uint UNINIT_VAR(best_mrr_flags), /* protected by key_to_read */ diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index e1bd455830d..601c1928d58 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -664,7 +664,7 @@ void With_element::move_anchors_ahead() { st_select_lex *next_sl; st_select_lex *new_pos= spec->first_select(); - st_select_lex *last_sl; + st_select_lex *UNINIT_VAR(last_sl); new_pos->linkage= UNION_TYPE; for (st_select_lex *sl= new_pos; sl; sl= next_sl) { diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index de14829329b..fd8d23f5187 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -8071,8 +8071,11 @@ int create_partition_name(char *out, size_t outlen, const char *in1, end= strxnmov(out, outlen-1, in1, "#P#", transl_part, NullS); else if (name_variant == TEMP_PART_NAME) end= strxnmov(out, outlen-1, in1, "#P#", transl_part, "#TMP#", NullS); - else if (name_variant == RENAMED_PART_NAME) + else + { + DBUG_ASSERT(name_variant == RENAMED_PART_NAME); end= strxnmov(out, outlen-1, in1, "#P#", transl_part, "#REN#", NullS); + } if (end - out == static_cast<ptrdiff_t>(outlen-1)) { my_error(ER_PATH_LENGTH, MYF(0), longest_str(in1, transl_part)); @@ -8112,9 +8115,12 @@ int create_subpartition_name(char *out, size_t outlen, else if (name_variant == TEMP_PART_NAME) end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name, "#SP#", transl_subpart_name, "#TMP#", NullS); - else if (name_variant == RENAMED_PART_NAME) + else + { + DBUG_ASSERT(name_variant == RENAMED_PART_NAME); end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name, "#SP#", transl_subpart_name, "#REN#", NullS); + } if (end - out == static_cast<ptrdiff_t>(outlen-1)) { my_error(ER_PATH_LENGTH, MYF(0), diff --git a/sql/table.cc b/sql/table.cc index 811094ccc76..00debaec84e 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -997,7 +997,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, Virtual_column_info **check_constraint_ptr= table->check_constraints; sql_mode_t saved_mode= thd->variables.sql_mode; Query_arena backup_arena; - Virtual_column_info *vcol; + Virtual_column_info *vcol= 0; StringBuffer<MAX_FIELD_WIDTH> expr_str; bool res= 1; DBUG_ENTER("parse_vcol_defs"); @@ -1168,7 +1168,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, uint new_frm_ver, field_pack_length, new_field_pack_flag; uint interval_count, interval_parts, read_length, int_length; uint db_create_options, keys, key_parts, n_length; - uint com_length, null_bit_pos, mysql57_vcol_null_bit_pos, bitmap_count; + uint com_length, null_bit_pos, UNINIT_VAR(mysql57_vcol_null_bit_pos), bitmap_count; uint i; bool use_hash, mysql57_null_bits= 0; char *keynames, *names, *comment_pos; @@ -2104,6 +2104,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, } } + key_first_info= keyinfo; for (uint key=0 ; key < keys ; key++,keyinfo++) { uint usable_parts= 0; @@ -2121,9 +2122,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, keyinfo->name_length+1); } - if (!key) - key_first_info= keyinfo; - if (ext_key_parts > share->key_parts && key) { KEY_PART_INFO *new_key_part= (keyinfo-1)->key_part + diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index 5a0c81d3e3e..8b3fa921cf1 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -280,7 +280,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) size_t info_length; char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN], data_name[FN_REFLEN]; - uchar *disk_cache, *disk_pos, *end_pos; + uchar *UNINIT_VAR(disk_cache), *disk_pos, *end_pos; MARIA_HA info, *UNINIT_VAR(m_info), *old_info; MARIA_SHARE share_buff,*share; double *rec_per_key_part; |