Skip to content

Commit d199166

Browse files
committed
Bug#24296291: FIX -WUNUSED-PARAMETER WARNINGS
Patch #13: Fix -Wunused-parameter warnings in sql*, part 3.
1 parent 879148b commit d199166

File tree

8 files changed

+106
-123
lines changed

8 files changed

+106
-123
lines changed

sql/sys_vars.cc

Lines changed: 80 additions & 89 deletions
Large diffs are not rendered by default.

sql/table.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
133133
const char *name,
134134
Name_resolution_context *context);
135135
static void open_table_error(THD *thd, TABLE_SHARE *share,
136-
int error, int db_errno, int errarg);
136+
int error, int db_errno);
137137

138138
inline bool is_system_table_name(const char *name, size_t length);
139139

@@ -2539,7 +2539,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share,
25392539
delete handler_file;
25402540
my_hash_free(&share->name_hash);
25412541

2542-
open_table_error(thd, share, error, my_errno(), errarg);
2542+
open_table_error(thd, share, error, my_errno());
25432543
DBUG_RETURN(error);
25442544
} /*open_binary_frm*/
25452545

@@ -3400,7 +3400,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
34003400

34013401
err:
34023402
if (! error_reported)
3403-
open_table_error(thd, share, error, my_errno(), 0);
3403+
open_table_error(thd, share, error, my_errno());
34043404
delete outparam->file;
34053405
if (outparam->part_info)
34063406
free_items(outparam->part_info->item_free_list);
@@ -3512,7 +3512,7 @@ void free_blob_buffers_and_reset(TABLE *table, uint32 size)
35123512
/* error message when opening a table defintion */
35133513

35143514
static void open_table_error(THD *thd, TABLE_SHARE *share,
3515-
int error, int db_errno, int errarg)
3515+
int error, int db_errno)
35163516
{
35173517
int err_no;
35183518
char buff[FN_REFLEN];
@@ -7253,7 +7253,7 @@ bool TABLE_LIST::update_derived_keys(Field *field, Item **values,
72537253
See TABLE_LIST::generate_keys.
72547254
*/
72557255

7256-
static int Derived_key_comp(Derived_key *e1, Derived_key *e2, void *arg)
7256+
static int Derived_key_comp(Derived_key *e1, Derived_key *e2, void*)
72577257
{
72587258
/* Move entries for tables with greater table bit to the end. */
72597259
return ((e1->referenced_by < e2->referenced_by) ? -1 :
@@ -7740,7 +7740,6 @@ st_lex_user::alloc(THD *thd, LEX_STRING *user_arg, LEX_STRING *host_arg)
77407740
@param share TABLE_SHARE object to be filled.
77417741
@param frm_context FRM_context for structures removed from
77427742
TABLE_SHARE
7743-
@param db database name
77447743
@param table table name
77457744
@param is_fix_view_cols_and_deps Flag to indicate that we are recreating view
77467745
to create view dependency entry in DD tables
@@ -7751,7 +7750,6 @@ st_lex_user::alloc(THD *thd, LEX_STRING *user_arg, LEX_STRING *host_arg)
77517750
static bool read_frm_file(THD *thd,
77527751
TABLE_SHARE *share,
77537752
FRM_context *frm_context,
7754-
const std::string &db,
77557753
const std::string &table,
77567754
bool is_fix_view_cols_and_deps)
77577755
{
@@ -7875,7 +7873,7 @@ bool create_table_share_for_upgrade(THD *thd,
78757873
mysql_mutex_init(key_TABLE_SHARE_LOCK_ha_data,
78767874
&share->LOCK_ha_data, MY_MUTEX_INIT_FAST);
78777875

7878-
if (read_frm_file(thd, share, frm_context, db_name,
7876+
if (read_frm_file(thd, share, frm_context,
78797877
table_name, is_fix_view_cols_and_deps))
78807878
{
78817879
free_table_share(share);

sql/trigger.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class Deprecated_trigger_syntax_handler : public Internal_error_handler
7171

7272
virtual bool handle_condition(THD *thd,
7373
uint sql_errno,
74-
const char *sqlstate,
75-
Sql_condition::enum_severity_level *level,
74+
const char*,
75+
Sql_condition::enum_severity_level*,
7676
const char *message)
7777
{
7878
if (sql_errno != EE_OUTOFMEMORY &&
@@ -152,7 +152,6 @@ static bool construct_definer_value(MEM_ROOT *mem_root, LEX_CSTRING *definer,
152152
execution order on master and slave will be the same.
153153
154154
@param thd thread context
155-
@param mem_root mem-root where needed strings will be allocated
156155
@param[out] binlog_query well-formed CREATE TRIGGER statement for putting
157156
into binlog (after successful execution)
158157
@param def_user user part of a definer value
@@ -165,7 +164,6 @@ static bool construct_definer_value(MEM_ROOT *mem_root, LEX_CSTRING *definer,
165164

166165
static bool construct_create_trigger_stmt_with_definer(
167166
THD *thd,
168-
MEM_ROOT *mem_root,
169167
String *binlog_query,
170168
const LEX_CSTRING &def_user,
171169
const LEX_CSTRING &def_host)
@@ -296,7 +294,6 @@ Trigger *Trigger::create_from_parser(THD *thd,
296294
definer_host= lex->definer->host;
297295

298296
if (construct_create_trigger_stmt_with_definer(thd,
299-
&subject_table->mem_root,
300297
binlog_create_trigger_stmt,
301298
definer_user,
302299
definer_host))

sql/tztime.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,9 @@ class Time_zone_utc : public Time_zone
11991199
0
12001200
*/
12011201
my_time_t
1202-
Time_zone_utc::TIME_to_gmt_sec(const MYSQL_TIME *t, bool *in_dst_time_gap) const
1202+
Time_zone_utc::TIME_to_gmt_sec(
1203+
const MYSQL_TIME *t MY_ATTRIBUTE((unused)),
1204+
bool *in_dst_time_gap MY_ATTRIBUTE((unused))) const
12031205
{
12041206
/* Should be never called */
12051207
DBUG_ASSERT(0);
@@ -1412,7 +1414,9 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg):
14121414
Corresponding my_time_t value or 0 in case of error
14131415
*/
14141416
my_time_t
1415-
Time_zone_offset::TIME_to_gmt_sec(const MYSQL_TIME *t, bool *in_dst_time_gap) const
1417+
Time_zone_offset::TIME_to_gmt_sec(
1418+
const MYSQL_TIME *t,
1419+
bool *in_dst_time_gap MY_ATTRIBUTE((unused))) const
14161420
{
14171421
my_time_t local_t;
14181422
int shift= 0;

sql/uniques.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ merge_buffers(THD *thd, Uniq_param *param, IO_CACHE *from_file,
361361

362362

363363

364-
int unique_write_to_file(uchar* key, element_count count, Unique *unique)
364+
int unique_write_to_file(uchar* key, element_count, Unique *unique)
365365
{
366366
/*
367367
Use unique->size (size of element stored in the tree) and not
@@ -372,7 +372,7 @@ int unique_write_to_file(uchar* key, element_count count, Unique *unique)
372372
return my_b_write(&unique->file, key, unique->size) ? 1 : 0;
373373
}
374374

375-
int unique_write_to_ptrs(uchar* key, element_count count, Unique *unique)
375+
int unique_write_to_ptrs(uchar* key, element_count, Unique *unique)
376376
{
377377
memcpy(unique->record_pointers, key, unique->size);
378378
unique->record_pointers+=unique->size;

sql/xa.cc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ void xid_t::set(my_xid xid)
104104
}
105105

106106

107-
static bool xacommit_handlerton(THD *unused1, plugin_ref plugin,
108-
void *arg)
107+
static bool xacommit_handlerton(THD*, plugin_ref plugin, void *arg)
109108
{
110109
handlerton *hton= plugin_data<handlerton*>(plugin);
111110
if (hton->state == SHOW_OPTION_YES && hton->recover)
@@ -115,8 +114,7 @@ static bool xacommit_handlerton(THD *unused1, plugin_ref plugin,
115114
}
116115

117116

118-
static bool xarollback_handlerton(THD *unused1, plugin_ref plugin,
119-
void *arg)
117+
static bool xarollback_handlerton(THD*, plugin_ref plugin, void *arg)
120118
{
121119
handlerton *hton= plugin_data<handlerton*>(plugin);
122120
if (hton->state == SHOW_OPTION_YES && hton->recover)
@@ -126,7 +124,7 @@ static bool xarollback_handlerton(THD *unused1, plugin_ref plugin,
126124
}
127125

128126

129-
static void ha_commit_or_rollback_by_xid(THD *thd, XID *xid, bool commit)
127+
static void ha_commit_or_rollback_by_xid(THD*, XID *xid, bool commit)
130128
{
131129
plugin_foreach(NULL, commit ? xacommit_handlerton : xarollback_handlerton,
132130
MYSQL_STORAGE_ENGINE_PLUGIN, xid);
@@ -142,8 +140,7 @@ struct xarecover_st
142140
};
143141

144142

145-
static bool xarecover_handlerton(THD *unused, plugin_ref plugin,
146-
void *arg)
143+
static bool xarecover_handlerton(THD*, plugin_ref plugin, void *arg)
147144
{
148145
handlerton *hton= plugin_data<handlerton*>(plugin);
149146
struct xarecover_st *info= (struct xarecover_st *) arg;
@@ -1319,12 +1316,11 @@ bool applier_reset_xa_trans(THD *thd)
13191316
13201317
@param[in,out] thd Thread context
13211318
@param plugin Reference to handlerton
1322-
@param unused Unused
13231319
13241320
@return FALSE on success, TRUE otherwise.
13251321
*/
13261322

1327-
bool detach_native_trx(THD *thd, plugin_ref plugin, void *unused)
1323+
bool detach_native_trx(THD *thd, plugin_ref plugin, void*)
13281324
{
13291325
handlerton *hton= plugin_data<handlerton *>(plugin);
13301326

sql/xa.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,13 +647,11 @@ struct st_plugin_int *plugin_find_by_type(const LEX_CSTRING &plugin, int type);
647647
648648
@param[in,out] thd Thread context
649649
@param plugin Reference to handlerton
650-
@param unused Unused
651650
652651
@return FALSE on success, TRUE otherwise.
653652
*/
654653

655-
bool detach_native_trx(THD *thd, plugin_ref plugin,
656-
void *unused);
654+
bool detach_native_trx(THD *thd, plugin_ref plugin, void *);
657655

658656
/**
659657
Reset some transaction state information and delete corresponding

strings/ctype-uca.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4371,7 +4371,7 @@ apply_tertiary_shift_900(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules,
43714371

43724372
static bool
43734373
apply_shift_900(MY_CHARSET_LOADER *loader,
4374-
MY_COLL_RULES *rules, MY_COLL_RULE *r, int level,
4374+
MY_COLL_RULES *rules, MY_COLL_RULE *r,
43754375
uint16 *to, size_t to_stride, size_t nweights)
43764376
{
43774377
// nweights should not less than 1 because of the extra CE.
@@ -4397,7 +4397,7 @@ apply_shift(MY_CHARSET_LOADER *loader,
43974397
uint16 *to, size_t to_stride, size_t nweights)
43984398
{
43994399
if (rules->uca->version == UCA_V900)
4400-
return apply_shift_900(loader, rules, r, level, to, to_stride, nweights);
4400+
return apply_shift_900(loader, rules, r, to, to_stride, nweights);
44014401

44024402
DBUG_ASSERT(to_stride == 1);
44034403

@@ -5081,8 +5081,7 @@ static int my_prepare_reorder(CHARSET_INFO *cs)
50815081
return rec_ind;
50825082
}
50835083

5084-
static void adjust_japanese_weight(CHARSET_INFO *cs, MY_COLL_RULES *rules,
5085-
int rec_ind)
5084+
static void adjust_japanese_weight(CHARSET_INFO *cs, int rec_ind)
50865085
{
50875086
/*
50885087
Per CLDR 30, Japanese collations need to reorder characters as
@@ -5140,7 +5139,7 @@ static bool my_prepare_coll_param(CHARSET_INFO *cs, MY_COLL_RULES *rules)
51405139
return true;
51415140

51425141
if (cs->coll_param == &ja_coll_param)
5143-
adjust_japanese_weight(cs, rules, rec_ind);
5142+
adjust_japanese_weight(cs, rec_ind);
51445143
/* Might add other parametric tailoring rules later. */
51455144
return false;
51465145
}

0 commit comments

Comments
 (0)