Skip to content

Commit 038a05a

Browse files
committed
Fixed compiler warnings about using unitialized variables
1 parent b8a7728 commit 038a05a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

sql/gcalc_tools.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int Gcalc_function::count_internal(const char *cur_func, uint set_type,
131131
uint n_ops= c_op & ~(op_any | op_not | v_mask);
132132
uint n_shape= c_op & ~(op_any | op_not | v_mask); /* same as n_ops */
133133
op_type v_state= (op_type) (c_op & v_mask);
134-
int result= 0, t_counter;
134+
int result= 0, t_counter= 0;
135135
const char *sav_cur_func= cur_func;
136136

137137
// GCALC_DBUG_ENTER("Gcalc_function::count_internal");

sql/handler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6506,7 +6506,7 @@ int ha_create_table(THD *thd, const char *path, const char *db,
65066506
DBUG_ASSERT(share.key_info[share.keys].algorithm == HA_KEY_ALG_VECTOR);
65076507
TABLE_SHARE index_share;
65086508
char file_name[FN_REFLEN+1];
6509-
char index_file_name[FN_REFLEN+1], *index_file_name_end;
6509+
char index_file_name[FN_REFLEN+1], *UNINIT_VAR(index_file_name_end);
65106510
Alter_info index_ainfo;
65116511
HA_CREATE_INFO index_cinfo;
65126512
char *path_end= strmov(file_name, path);

sql/spatial.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ int Gis_line_string::is_valid(int *valid) const
16161616
if (not_enough_points(m_data, num_points))
16171617
return 1;
16181618

1619-
double x, y, previous_x, previous_y;
1619+
double x, y, UNINIT_VAR(previous_x), UNINIT_VAR(previous_y);
16201620
for (uint32 i = 1; i <= num_points; i++)
16211621
{
16221622
String wkb= 0;

sql/sql_table.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8828,7 +8828,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
88288828
{
88298829
StringBuffer<NAME_LEN*3> tmp;
88308830
append_drop_column(thd, &tmp, field);
8831-
my_error(ER_MISSING, MYF(0), table->s->table_name.str, tmp.c_ptr());
8831+
my_error(ER_MISSING, MYF(0), table->s->table_name.str, tmp.c_ptr_safe());
88328832
goto err;
88338833
}
88348834
else if (drop && field->invisible < INVISIBLE_SYSTEM &&
@@ -8989,7 +8989,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
89898989
append_drop_column(thd, &tmp, table->vers_start_field());
89908990
if (!(dropped_sys_vers_fields & VERS_ROW_END))
89918991
append_drop_column(thd, &tmp, table->vers_end_field());
8992-
my_error(ER_MISSING, MYF(0), table->s->table_name.str, tmp.c_ptr());
8992+
my_error(ER_MISSING, MYF(0), table->s->table_name.str, tmp.c_ptr_safe());
89938993
goto err;
89948994
}
89958995
else if (alter_info->flags & ALTER_DROP_PERIOD && vers_system_invisible)
@@ -9993,7 +9993,7 @@ static bool fk_prepare_copy_alter_table(THD *thd, TABLE *table,
99939993
buff.append('.');
99949994
append_identifier(thd, &buff, tbl);
99959995
my_error(ER_FK_COLUMN_CANNOT_DROP_CHILD, MYF(0), bad_column_name,
9996-
f_key->foreign_id->str, buff.c_ptr());
9996+
f_key->foreign_id->str, buff.c_ptr_safe());
99979997
DBUG_RETURN(true);
99989998
}
99999999
/* FK_COLUMN_NOT_NULL error happens only when changing

0 commit comments

Comments
 (0)