Skip to content

Commit 95f3933

Browse files
committed
Fixed compiler warnings
Only warnings, should not have caused any bugs in old code
1 parent 8ff5dda commit 95f3933

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

sql/opt_subselect.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,8 +2701,8 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx,
27012701
LooseScan detector in best_access_path)
27022702
*/
27032703
remaining_tables &= ~new_join_tab->table->map;
2704-
table_map dups_producing_tables, prev_dups_producing_tables,
2705-
prev_sjm_lookup_tables;
2704+
table_map dups_producing_tables, UNINIT_VAR(prev_dups_producing_tables),
2705+
UNINIT_VAR(prev_sjm_lookup_tables);
27062706

27072707
if (idx == join->const_tables)
27082708
dups_producing_tables= 0;
@@ -2713,7 +2713,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx,
27132713
if ((emb_sj_nest= new_join_tab->emb_sj_nest))
27142714
dups_producing_tables |= emb_sj_nest->sj_inner_tables;
27152715

2716-
Semi_join_strategy_picker **strategy, **prev_strategy;
2716+
Semi_join_strategy_picker **strategy, **prev_strategy= 0;
27172717
if (idx == join->const_tables)
27182718
{
27192719
/* First table, initialize pickers */

sql/table.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
11741174
char *keynames, *names, *comment_pos;
11751175
const uchar *forminfo, *extra2;
11761176
const uchar *frm_image_end = frm_image + frm_length;
1177-
uchar *record, *null_flags, *null_pos, *mysql57_vcol_null_pos;
1177+
uchar *record, *null_flags, *null_pos, *UNINIT_VAR(mysql57_vcol_null_pos);
11781178
const uchar *disk_buff, *strpos;
11791179
ulong pos, record_offset;
11801180
ulong rec_buff_length;
@@ -2407,6 +2407,11 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
24072407
DBUG_ASSERT(field_nr < share->fields);
24082408
reg_field= share->field[field_nr];
24092409
}
2410+
else
2411+
{
2412+
reg_field= 0;
2413+
DBUG_ASSERT(name_length);
2414+
}
24102415

24112416
vcol_screen_pos+= FRM_VCOL_NEW_HEADER_SIZE;
24122417
vcol_info->set_vcol_type((enum_vcol_info_type) type);
@@ -7411,7 +7416,7 @@ int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
74117416
DBUG_ASSERT(vcol_info);
74127417
DBUG_ASSERT(vcol_info->expr);
74137418

7414-
bool update, swap_values= 0;
7419+
bool update= 0, swap_values= 0;
74157420
switch (update_mode) {
74167421
case VCOL_UPDATE_FOR_READ:
74177422
update= !vcol_info->stored_in_db

storage/maria/ma_create.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
7676
uint internal_table= flags & HA_CREATE_INTERNAL_TABLE;
7777
ulong reclength, real_reclength,min_pack_length;
7878
char kfilename[FN_REFLEN], klinkname[FN_REFLEN], *klinkname_ptr;
79-
char dfilename[FN_REFLEN], dlinkname[FN_REFLEN], *dlinkname_ptr;
79+
char dfilename[FN_REFLEN], dlinkname[FN_REFLEN], *dlinkname_ptr= 0;
8080
ulong pack_reclength;
8181
ulonglong tot_length,max_rows, tmp;
8282
enum en_fieldtype type;
@@ -1197,7 +1197,6 @@ int maria_create(const char *name, enum data_file_type datafile_type,
11971197
{
11981198
fn_format(dfilename,name,"", MARIA_NAME_DEXT,
11991199
MY_UNPACK_FILENAME | MY_APPEND_EXT);
1200-
dlinkname_ptr= NullS;
12011200
create_flag= (flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD;
12021201
}
12031202
if ((dfile=
@@ -1251,8 +1250,6 @@ int maria_create(const char *name, enum data_file_type datafile_type,
12511250
switch (errpos) {
12521251
case 3:
12531252
mysql_file_close(dfile, MYF(0));
1254-
/* fall through */
1255-
case 2:
12561253
if (! (flags & HA_DONT_TOUCH_DATA))
12571254
{
12581255
mysql_file_delete(key_file_dfile, dfilename, MYF(sync_dir));

0 commit comments

Comments
 (0)