Skip to content

Commit 6a563b2

Browse files
committed
Bug#24296291: FIX -WUNUSED-PARAMETER WARNINGS
Patch #10: Fix -Wunused-parameter warnings in sp*
1 parent 08317b6 commit 6a563b2

26 files changed

+76
-99
lines changed

sql/lock.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static void track_table_access(THD *thd, TABLE **tables, size_t count)
291291

292292
if (t)
293293
{
294-
s= tst->calc_trx_state(thd, t->reginfo.lock_type,
294+
s= tst->calc_trx_state(t->reginfo.lock_type,
295295
t->file->has_transactions());
296296
tst->add_trx_state(thd, s);
297297
}

sql/mysqld.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6835,7 +6835,7 @@ static int show_slave_last_heartbeat(THD *thd, SHOW_VAR *var, char *buff)
68356835
/**
68366836
Only for default channel. For details, refer to show_slave_running()
68376837
*/
6838-
static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff)
6838+
static int show_heartbeat_period(THD*, SHOW_VAR *var, char *buff)
68396839
{
68406840
channel_map.rdlock();
68416841
Master_info *mi= channel_map.get_default_channel_mi();

sql/parser_service.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class Plugin_error_handler: public Internal_error_handler
122122
thd->push_internal_handler(this);
123123
}
124124

125-
virtual bool handle_condition(THD *thd,
125+
virtual bool handle_condition(THD*,
126126
uint sql_errno_u,
127127
const char* sqlstate,
128128
Sql_condition::enum_severity_level *,

sql/partitioning/partition_handler.cc

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ uint32 Partition_helper::ph_calculate_key_hash_value(Field **field_array)
10981098
}
10991099

11001100

1101-
bool Partition_helper::print_partition_error(int error, myf errflag)
1101+
bool Partition_helper::print_partition_error(int error)
11021102
{
11031103
THD *thd= get_thd();
11041104
DBUG_ENTER("Partition_helper::print_partition_error");
@@ -1248,8 +1248,6 @@ void Partition_helper::prepare_change_partitions()
12481248
@param[in] create_info HA_CREATE_INFO object describing all
12491249
fields and indexes in table
12501250
@param[in] path Complete path of db and table name
1251-
@param[out] copied Output parameter where number of copied
1252-
records are added
12531251
@param[out] deleted Output parameter where number of deleted
12541252
records are added
12551253
@@ -1260,7 +1258,6 @@ void Partition_helper::prepare_change_partitions()
12601258

12611259
int Partition_helper::change_partitions(HA_CREATE_INFO *create_info,
12621260
const char *path,
1263-
ulonglong * const copied,
12641261
ulonglong * const deleted)
12651262
{
12661263
List_iterator<partition_element> part_it(m_part_info->partitions);
@@ -1478,7 +1475,7 @@ int Partition_helper::change_partitions(HA_CREATE_INFO *create_info,
14781475
DBUG_ASSERT(part_elem->part_state == PART_TO_BE_REORGED);
14791476
part_elem->part_state= PART_TO_BE_DROPPED;
14801477
}
1481-
error= copy_partitions(copied, deleted);
1478+
error= copy_partitions(deleted);
14821479
err:
14831480
if (error)
14841481
{
@@ -1500,16 +1497,14 @@ int Partition_helper::change_partitions(HA_CREATE_INFO *create_info,
15001497
actually copy the data from the reorganized partitions to the new
15011498
partitions.
15021499
1503-
@param[out] copied Number of records copied.
15041500
@param[out] deleted Number of records deleted.
15051501
15061502
@return Operation status
15071503
@retval 0 Success
15081504
@retval >0 Error code
15091505
*/
15101506

1511-
int Partition_helper::copy_partitions(ulonglong * const copied,
1512-
ulonglong * const deleted)
1507+
int Partition_helper::copy_partitions(ulonglong * const deleted)
15131508
{
15141509
uint new_part= 0;
15151510
int result= 0;
@@ -2827,15 +2822,14 @@ int Partition_helper::ph_index_next(uchar *buf)
28272822
as supplied in the call.
28282823
28292824
@param[out] buf Read row in MySQL Row Format.
2830-
@param[in] key Key.
28312825
@param[in] keylen Length of key.
28322826
28332827
@return Operation status.
28342828
@retval 0 Success
28352829
@retval != 0 Error code
28362830
*/
28372831

2838-
int Partition_helper::ph_index_next_same(uchar *buf, const uchar *key, uint keylen)
2832+
int Partition_helper::ph_index_next_same(uchar *buf, uint keylen)
28392833
{
28402834
DBUG_ENTER("Partition_helper::ph_index_next_same");
28412835

sql/partitioning/partition_handler.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ class Partition_helper : public Sql_alloc
627627
int ph_index_first(uchar *buf);
628628
int ph_index_last(uchar *buf);
629629
int ph_index_next(uchar *buf);
630-
int ph_index_next_same(uchar *buf, const uchar *key, uint keylen);
630+
int ph_index_next_same(uchar *buf, uint keylen);
631631
int ph_index_prev(uchar *buf);
632632
int ph_index_read_map(uchar *buf,
633633
const uchar *key,
@@ -688,8 +688,6 @@ class Partition_helper : public Sql_alloc
688688
@param[in] create_info HA_CREATE_INFO object describing all
689689
fields and indexes in table
690690
@param[in] path Complete path of db and table name
691-
@param[out] copied Output parameter where number of copied
692-
records are added
693691
@param[out] deleted Output parameter where number of deleted
694692
records are added
695693
@@ -699,7 +697,6 @@ class Partition_helper : public Sql_alloc
699697
*/
700698
virtual int change_partitions(HA_CREATE_INFO *create_info,
701699
const char *path,
702-
ulonglong * const copied,
703700
ulonglong * const deleted);
704701
/** @} */
705702

@@ -779,10 +776,9 @@ class Partition_helper : public Sql_alloc
779776

780777
/** Print partitioning specific error.
781778
@param error Error code.
782-
@param errflag Error flag.
783779
@return false if error is printed else true.
784780
*/
785-
bool print_partition_error(int error, myf errflag);
781+
bool print_partition_error(int error);
786782
/**
787783
Print a message row formatted for ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE.
788784
@@ -832,15 +828,13 @@ class Partition_helper : public Sql_alloc
832828
actually copy the data from the reorganized partitions to the new
833829
partitions.
834830
835-
@param[out] copied Number of records copied.
836831
@param[out] deleted Number of records deleted.
837832
838833
@return Operation status
839834
@retval 0 Success
840835
@retval >0 Error code
841836
*/
842-
virtual int copy_partitions(ulonglong * const copied,
843-
ulonglong * const deleted);
837+
virtual int copy_partitions(ulonglong * const deleted);
844838

845839
private:
846840
enum partition_index_scan_type

sql/protocol_classic.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,7 @@ SSL_handle Protocol_classic::get_ssl()
18331833
}
18341834

18351835

1836-
int Protocol_classic::shutdown(bool server_shutdown)
1836+
int Protocol_classic::shutdown(bool)
18371837
{
18381838
return m_thd->net.vio ? vio_shutdown(m_thd->net.vio) : 0;
18391839
}
@@ -2096,14 +2096,12 @@ bool Protocol_binary::send_parameters(List<Item_param> *parameters,
20962096
Sets OUT-parameters to user variables.
20972097
20982098
@param parameters List of PS/SP parameters (both input and output).
2099-
@param is_sql_prepare not used.
21002099
21012100
@return Error status.
21022101
@retval false Success.
21032102
@retval true Error.
21042103
*/
2105-
bool Protocol_text::send_parameters(List<Item_param> *parameters,
2106-
bool is_sql_prepare)
2104+
bool Protocol_text::send_parameters(List<Item_param> *parameters, bool)
21072105
{
21082106
List_iterator_fast<Item_param> item_param_it(*parameters);
21092107
List_iterator_fast<LEX_STRING> user_var_name_it(

sql/protocol_classic.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ class Protocol_text : public Protocol_classic
232232
virtual bool store_time(MYSQL_TIME *time, uint precision);
233233
virtual bool store(Proto_field *field);
234234
virtual void start_row();
235-
virtual bool send_parameters(List<Item_param> *parameters,
236-
bool is_sql_prepare);
235+
virtual bool send_parameters(List<Item_param> *parameters, bool);
237236

238237
virtual enum enum_protocol_type type() { return PROTOCOL_TEXT; };
239238
protected:

sql/sdi_utils.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -22,9 +22,10 @@
2222

2323

2424
/* purecov: begin deadcode */
25-
bool create_serialized_meta_data(const char *schema_name,
26-
const char *table_name,
27-
uchar **meta_data, size_t *meta_data_length)
25+
bool create_serialized_meta_data(const char *schema_name MY_ATTRIBUTE((unused)),
26+
const char *table_name MY_ATTRIBUTE((unused)),
27+
uchar **meta_data MY_ATTRIBUTE((unused)),
28+
size_t *meta_data_length MY_ATTRIBUTE((unused)))
2829
{
2930
/*
3031
TODO: This function is currently not implemented. The procedure here
@@ -53,9 +54,9 @@ bool create_serialized_meta_data(const char *schema_name,
5354
}
5455

5556

56-
bool import_serialized_meta_data(const uchar *meta_data,
57-
size_t meta_data_length,
58-
bool readonly)
57+
bool import_serialized_meta_data(const uchar *meta_data MY_ATTRIBUTE((unused)),
58+
size_t meta_data_length MY_ATTRIBUTE((unused)),
59+
bool readonly MY_ATTRIBUTE((unused)))
5960
{
6061
// TODO: This function is currently not implemented. Return error so
6162
// that client code will not attempt to open a non-existent table

sql/session_tracker.cc

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class Current_schema_tracker : public State_tracker
235235

236236
bool enable(THD *thd)
237237
{ return update(thd); }
238-
bool check(THD *thd, set_var *var)
238+
bool check(THD*, set_var*)
239239
{ return false; }
240240
bool update(THD *thd);
241241
bool store(THD *thd, String &buf);
@@ -387,7 +387,7 @@ class Session_gtids_tracker : public State_tracker, Session_consistency_gtids_ct
387387

388388
bool enable(THD *thd)
389389
{ return update(thd); }
390-
bool check(THD *thd, set_var *var)
390+
bool check(THD*, set_var*)
391391
{ return false; }
392392
bool update(THD *thd);
393393
bool store(THD *thd, String &buf);
@@ -1243,9 +1243,7 @@ bool Transaction_state_tracker::store(THD *thd, String &buf)
12431243
Mark the tracker as changed.
12441244
*/
12451245

1246-
void Transaction_state_tracker::mark_as_changed(THD *thd,
1247-
LEX_CSTRING *tracked_item_name
1248-
MY_ATTRIBUTE((unused)))
1246+
void Transaction_state_tracker::mark_as_changed(THD*, LEX_CSTRING*)
12491247
{
12501248
m_changed = true;
12511249
}
@@ -1269,14 +1267,12 @@ void Transaction_state_tracker::reset()
12691267
non-transactional), and returns the corresponding access flag
12701268
out of TX_READ_TRX, TX_READ_UNSAFE, TX_WRITE_TRX, TX_WRITE_UNSAFE.
12711269
1272-
@param thd The thd handle
12731270
@param l The table's access/lock type
12741271
@param has_trx Whether the table's engine is transactional
12751272
12761273
@return The table access flag
12771274
*/
1278-
enum_tx_state Transaction_state_tracker::calc_trx_state(THD *thd,
1279-
thr_lock_type l,
1275+
enum_tx_state Transaction_state_tracker::calc_trx_state(thr_lock_type l,
12801276
bool has_trx)
12811277
{
12821278
enum_tx_state s;
@@ -1463,15 +1459,14 @@ bool Session_state_change_tracker::update(THD *thd)
14631459
1byte flag value is 1 then there is a session state change else
14641460
there is no state change information.
14651461
1466-
@param thd The thd handle.
14671462
@param [in,out] buf Buffer to store the information to.
14681463
14691464
@return
14701465
false Success
14711466
true Error
14721467
**/
14731468

1474-
bool Session_state_change_tracker::store(THD *thd, String &buf)
1469+
bool Session_state_change_tracker::store(THD*, String &buf)
14751470
{
14761471
/* since its a boolean tracker length is always 1 */
14771472
const ulonglong length= 1;
@@ -1488,7 +1483,7 @@ bool Session_state_change_tracker::store(THD *thd, String &buf)
14881483
to= net_store_length(to, length);
14891484

14901485
/* boolean tracker will go here */
1491-
*to= (is_state_changed(thd) ? '1' : '0');
1486+
*to= (is_state_changed() ? '1' : '0');
14921487

14931488
reset();
14941489

@@ -1532,7 +1527,7 @@ void Session_state_change_tracker::reset()
15321527
@retval false There is no session state change
15331528
**/
15341529

1535-
bool Session_state_change_tracker::is_state_changed(THD* thd)
1530+
bool Session_state_change_tracker::is_state_changed()
15361531
{
15371532
return m_changed;
15381533
}

sql/session_tracker.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef SESSION_TRACKER_INCLUDED
22
#define SESSION_TRACKER_INCLUDED
33

4-
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -192,9 +192,9 @@ class Session_state_change_tracker : public State_tracker
192192
bool check(THD*, set_var*)
193193
{ return false; }
194194
bool update(THD *thd);
195-
bool store(THD *thd, String &buf);
195+
bool store(THD*, String &buf);
196196
void mark_as_changed(THD *thd, LEX_CSTRING *tracked_item_name);
197-
bool is_state_changed(THD*);
197+
bool is_state_changed();
198198
};
199199

200200

@@ -275,7 +275,7 @@ class Transaction_state_tracker : public State_tracker
275275
void end_trx(THD *thd);
276276

277277
/** Helper function: turn table info into table access flag */
278-
enum_tx_state calc_trx_state(THD *thd, thr_lock_type l, bool has_trx);
278+
enum_tx_state calc_trx_state(thr_lock_type l, bool has_trx);
279279

280280
private:
281281
enum enum_tx_changed {

0 commit comments

Comments
 (0)