Commit 322c637c authored by Monty's avatar Monty

Fixed compiler warnings about possible uninitialized variables

parent 7703095d
...@@ -2420,7 +2420,7 @@ static int find_uniq_filename(char *name, ulong next_log_number) ...@@ -2420,7 +2420,7 @@ static int find_uniq_filename(char *name, ulong next_log_number)
char buff[FN_REFLEN], ext_buf[FN_REFLEN]; char buff[FN_REFLEN], ext_buf[FN_REFLEN];
struct st_my_dir *dir_info; struct st_my_dir *dir_info;
reg1 struct fileinfo *file_info; reg1 struct fileinfo *file_info;
ulong max_found, next, number; ulong max_found, next, UNINIT_VAR(number);
size_t buf_length, length; size_t buf_length, length;
char *start, *end; char *start, *end;
int error= 0; int error= 0;
......
...@@ -6729,7 +6729,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, ...@@ -6729,7 +6729,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
bool update_tbl_stats, bool update_tbl_stats,
double read_time) double read_time)
{ {
uint idx, best_idx; uint idx, UNINIT_VAR(best_idx);
SEL_ARG *key_to_read= NULL; SEL_ARG *key_to_read= NULL;
ha_rows UNINIT_VAR(best_records); /* protected by key_to_read */ ha_rows UNINIT_VAR(best_records); /* protected by key_to_read */
uint UNINIT_VAR(best_mrr_flags), /* protected by key_to_read */ uint UNINIT_VAR(best_mrr_flags), /* protected by key_to_read */
......
...@@ -664,7 +664,7 @@ void With_element::move_anchors_ahead() ...@@ -664,7 +664,7 @@ void With_element::move_anchors_ahead()
{ {
st_select_lex *next_sl; st_select_lex *next_sl;
st_select_lex *new_pos= spec->first_select(); 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; new_pos->linkage= UNION_TYPE;
for (st_select_lex *sl= new_pos; sl; sl= next_sl) for (st_select_lex *sl= new_pos; sl; sl= next_sl)
{ {
......
...@@ -8071,8 +8071,11 @@ int create_partition_name(char *out, size_t outlen, const char *in1, ...@@ -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); end= strxnmov(out, outlen-1, in1, "#P#", transl_part, NullS);
else if (name_variant == TEMP_PART_NAME) else if (name_variant == TEMP_PART_NAME)
end= strxnmov(out, outlen-1, in1, "#P#", transl_part, "#TMP#", NullS); 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); end= strxnmov(out, outlen-1, in1, "#P#", transl_part, "#REN#", NullS);
}
if (end - out == static_cast<ptrdiff_t>(outlen-1)) if (end - out == static_cast<ptrdiff_t>(outlen-1))
{ {
my_error(ER_PATH_LENGTH, MYF(0), longest_str(in1, transl_part)); 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, ...@@ -8112,9 +8115,12 @@ int create_subpartition_name(char *out, size_t outlen,
else if (name_variant == TEMP_PART_NAME) else if (name_variant == TEMP_PART_NAME)
end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name, end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name,
"#SP#", transl_subpart_name, "#TMP#", NullS); "#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, end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name,
"#SP#", transl_subpart_name, "#REN#", NullS); "#SP#", transl_subpart_name, "#REN#", NullS);
}
if (end - out == static_cast<ptrdiff_t>(outlen-1)) if (end - out == static_cast<ptrdiff_t>(outlen-1))
{ {
my_error(ER_PATH_LENGTH, MYF(0), my_error(ER_PATH_LENGTH, MYF(0),
......
...@@ -997,7 +997,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, ...@@ -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; Virtual_column_info **check_constraint_ptr= table->check_constraints;
sql_mode_t saved_mode= thd->variables.sql_mode; sql_mode_t saved_mode= thd->variables.sql_mode;
Query_arena backup_arena; Query_arena backup_arena;
Virtual_column_info *vcol; Virtual_column_info *vcol= 0;
StringBuffer<MAX_FIELD_WIDTH> expr_str; StringBuffer<MAX_FIELD_WIDTH> expr_str;
bool res= 1; bool res= 1;
DBUG_ENTER("parse_vcol_defs"); DBUG_ENTER("parse_vcol_defs");
...@@ -1168,7 +1168,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, ...@@ -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 new_frm_ver, field_pack_length, new_field_pack_flag;
uint interval_count, interval_parts, read_length, int_length; uint interval_count, interval_parts, read_length, int_length;
uint db_create_options, keys, key_parts, n_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; uint i;
bool use_hash, mysql57_null_bits= 0; bool use_hash, mysql57_null_bits= 0;
char *keynames, *names, *comment_pos; char *keynames, *names, *comment_pos;
...@@ -2104,6 +2104,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, ...@@ -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++) for (uint key=0 ; key < keys ; key++,keyinfo++)
{ {
uint usable_parts= 0; uint usable_parts= 0;
...@@ -2121,9 +2122,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, ...@@ -2121,9 +2122,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
keyinfo->name_length+1); keyinfo->name_length+1);
} }
if (!key)
key_first_info= keyinfo;
if (ext_key_parts > share->key_parts && key) if (ext_key_parts > share->key_parts && key)
{ {
KEY_PART_INFO *new_key_part= (keyinfo-1)->key_part + KEY_PART_INFO *new_key_part= (keyinfo-1)->key_part +
......
...@@ -280,7 +280,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) ...@@ -280,7 +280,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
size_t info_length; size_t info_length;
char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN], char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
data_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_HA info, *UNINIT_VAR(m_info), *old_info;
MARIA_SHARE share_buff,*share; MARIA_SHARE share_buff,*share;
double *rec_per_key_part; double *rec_per_key_part;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment