Skip to content

Commit 1844ab6

Browse files
committed
Bug#24296291: FIX -WUNUSED-PARAMETER WARNINGS
Patch #21: Fix recently introduced -Wunused-parameter warnings.
1 parent 95f683c commit 1844ab6

File tree

12 files changed

+51
-39
lines changed

12 files changed

+51
-39
lines changed

sql/dd/impl/sdi.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ String_type generic_serialize(THD *thd, const char *dd_object_type,
198198
}
199199

200200

201-
const String_type &lookup_tablespace_name(Sdi_wcontext *wctx, dd::Object_id id)
201+
const String_type&
202+
lookup_tablespace_name(Sdi_wcontext *wctx MY_ATTRIBUTE((unused)),
203+
dd::Object_id id MY_ATTRIBUTE((unused)))
202204
{
203205
// TODO: WL#9538 Remove this when SDI is enabled for InnoDB
204206
return empty_;

sql/dd/impl/sdi_tablespace.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
using namespace dd::sdi_utils;
4141

4242
namespace {
43-
bool is_valid(const dd::Tablespace *ts)
43+
bool is_valid(const dd::Tablespace *ts MY_ATTRIBUTE((unused)))
4444
{
4545
// return ts && ts->se_private_data().exists("id");
4646
// TODO: WL#9538 Remove this when SDI is enabled for InnoDB

sql/dd/upgrade/upgrade.cc

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@ static bool check_file_extension(const String_type &extn)
108108
will be created from scratch with other dictionary tables. Data from
109109
5.7 stats table will be inserted in new created stats table
110110
via INSERT...SELECT statement.
111-
112-
@param[in] thd Thread handle.
113111
*/
114-
void rename_stats_tables(THD *thd)
112+
113+
static void rename_stats_tables()
115114
{
116115
/*
117116
Rename mysql/innodb_index_stats.ibd and mysql/innodb_table_stats.ibd.
@@ -393,7 +392,8 @@ void rename_back_stats_tables(THD *thd)
393392
/**
394393
Drop all .SDI files created during upgrade.
395394
*/
396-
void drop_sdi_files(THD *thd)
395+
396+
static void drop_sdi_files()
397397
{
398398
uint i, j;
399399
// Iterate in data directory and delete all .SDI files
@@ -745,7 +745,7 @@ bool terminate(THD *thd)
745745
rename_back_stats_tables(thd);
746746

747747
// Drop SDI files.
748-
drop_sdi_files(thd);
748+
drop_sdi_files();
749749

750750
return false;
751751
}
@@ -756,14 +756,13 @@ bool terminate(THD *thd)
756756
757757
@param[in] thd Thread Handle
758758
@param[in] plugin Handlerton Plugin
759-
@param[in] unused unused parameter list
760759
761760
@retval false ON SUCCESS
762761
@retval true ON FAILURE
763762
*/
764763
static bool ha_migrate_tablespaces(THD *thd,
765764
plugin_ref plugin,
766-
void *unused)
765+
void*)
767766
{
768767
handlerton *hton= plugin_data<handlerton*>(plugin);
769768

@@ -873,15 +872,13 @@ static bool restart_dictionary(THD *thd)
873872
874873
@param[in] thd Thread Handle
875874
@param[in] plugin Handlerton Plugin
876-
@param[in] unused unused parameter list
877-
878875
879876
@retval false ON SUCCESS
880877
@retval true ON FAILURE
881878
*/
882879
static bool upgrade_logs(THD *thd,
883-
plugin_ref plugin,
884-
void *unused)
880+
plugin_ref plugin,
881+
void*)
885882
{
886883
handlerton *hton= plugin_data<handlerton*>(plugin);
887884

@@ -905,7 +902,7 @@ static bool upgrade_logs(THD *thd,
905902
static bool ha_upgrade_engine_logs(THD *thd)
906903
{
907904
if (plugin_foreach(thd, upgrade_logs,
908-
MYSQL_STORAGE_ENGINE_PLUGIN, 0))
905+
MYSQL_STORAGE_ENGINE_PLUGIN, 0))
909906
return true;
910907

911908
return false;
@@ -1186,7 +1183,7 @@ bool do_pre_checks_and_initialize_dd(THD *thd)
11861183
sql_print_information("Created Data Dictionary for upgrade");
11871184

11881185
// Rename .ibd files for innodb stats tables
1189-
rename_stats_tables(thd);
1186+
rename_stats_tables();
11901187

11911188
// Mark opt_initiazlize false after creating dictionary tables.
11921189
opt_initialize= false;

sql/dd_table_share.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,11 +2337,11 @@ bool open_table_def(THD *thd, TABLE_SHARE *share, bool open_view,
23372337
class Open_table_error_handler : public Internal_error_handler
23382338
{
23392339
public:
2340-
virtual bool handle_condition(THD *thd,
2340+
virtual bool handle_condition(THD*,
23412341
uint sql_errno,
2342-
const char* sqlstate,
2343-
Sql_condition::enum_severity_level *level,
2344-
const char* msg)
2342+
const char*,
2343+
Sql_condition::enum_severity_level*,
2344+
const char*)
23452345
{
23462346
return (sql_errno == ER_UNKNOWN_COLLATION ||
23472347
sql_errno == ER_PLUGIN_IS_NOT_LOADED);

sql/ha_ndbcluster_binlog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6324,7 +6324,7 @@ handle_data_event(THD* thd, Ndb *ndb, NdbEventOperation *pOp,
63246324

63256325
ret = trans.update_row(logged_server_id,
63266326
injector::transaction::table(table, true),
6327-
&col_bitmap_before_update, &b, n_fields,
6327+
&col_bitmap_before_update, &b,
63286328
table->record[1], // before values
63296329
table->record[0], // after values
63306330
extra_row_info_ptr);

sql/handler.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5202,10 +5202,10 @@ class handler :public Sql_alloc
52025202
{ *max_rows= 0; return false; }
52035203

52045204
// Set se_private_id and se_private_data during upgrade
5205-
virtual bool upgrade_table(THD *thd,
5206-
const char* dbname,
5207-
const char* table_name,
5208-
dd::Table *dd_table)
5205+
virtual bool upgrade_table(THD *thd MY_ATTRIBUTE((unused)),
5206+
const char* dbname MY_ATTRIBUTE((unused)),
5207+
const char* table_name MY_ATTRIBUTE((unused)),
5208+
dd::Table *dd_table MY_ATTRIBUTE((unused)))
52095209
{ return false; }
52105210

52115211
virtual int sample_init();

sql/opt_range.cc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,9 +1531,16 @@ static void append_range_all_keyparts(Opt_trace_array *range_trace,
15311531
SEL_ROOT *keypart,
15321532
const KEY_PART_INFO *key_parts,
15331533
const bool print_full);
1534-
static inline void dbug_print_tree(const char *tree_name MY_ATTRIBUTE((unused)),
1535-
SEL_TREE *tree MY_ATTRIBUTE((unused)),
1536-
const RANGE_OPT_PARAM *param MY_ATTRIBUTE((unused)));
1534+
#ifndef DBUG_OFF
1535+
static inline void dbug_print_tree(const char *tree_name,
1536+
SEL_TREE *tree,
1537+
const RANGE_OPT_PARAM *param);
1538+
#else
1539+
static inline void dbug_print_tree(const char*,
1540+
SEL_TREE*,
1541+
const RANGE_OPT_PARAM*)
1542+
{}
1543+
#endif
15371544

15381545
static inline void print_tree(String *out,
15391546
const char *tree_name,
@@ -15531,16 +15538,16 @@ static void append_range_all_keyparts(Opt_trace_array *range_trace,
1553115538
@param tree The SEL_TREE that will be printed to debug log
1553215539
@param param PARAM from test_quick_select
1553315540
*/
15541+
#ifndef DBUG_OFF
1553415542
static inline
1553515543
void dbug_print_tree(const char *tree_name,
1553615544
SEL_TREE *tree,
1553715545
const RANGE_OPT_PARAM *param)
1553815546
{
15539-
#ifndef DBUG_OFF
1554015547
if (_db_enabled_())
1554115548
print_tree(NULL, tree_name, tree, param, true);
15542-
#endif
1554315549
}
15550+
#endif
1554415551

1554515552

1554615553
static inline void print_tree(String *out,

sql/rpl_injector.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ int injector::transaction::delete_row(server_id_type sid, table tbl,
236236
int injector::transaction::update_row(server_id_type sid, table tbl,
237237
MY_BITMAP const* before_cols,
238238
MY_BITMAP const* after_cols,
239-
size_t colcnt,
240239
record_type before, record_type after,
241240
const uchar* extra_row_info)
242241
{
@@ -258,10 +257,10 @@ int injector::transaction::update_row(server_id_type sid, table tbl,
258257
}
259258

260259
int injector::transaction::update_row(server_id_type sid, table tbl,
261-
MY_BITMAP const* cols, size_t colcnt,
260+
MY_BITMAP const* cols,
262261
record_type before, record_type after)
263262
{
264-
return update_row(sid, tbl, cols, cols, colcnt, before, after, NULL);
263+
return update_row(sid, tbl, cols, cols, before, after, NULL);
265264
}
266265

267266
injector::transaction::binlog_pos injector::transaction::start_pos() const

sql/rpl_injector.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,10 @@ class injector
231231
int update_row(server_id_type sid, table tbl,
232232
MY_BITMAP const *before_cols,
233233
MY_BITMAP const *after_cols,
234-
size_t colcnt,
235234
record_type before, record_type after,
236235
const uchar* extra_row_info);
237236
int update_row(server_id_type sid, table tbl,
238-
MY_BITMAP const *cols, size_t colcnt,
237+
MY_BITMAP const *cols,
239238
record_type before, record_type after);
240239

241240
/*

sql/sql_table.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7878,11 +7878,11 @@ make_unique_key_name(const char *field_name,KEY *start,KEY *end)
78787878
class Rename_table_error_handler : public Internal_error_handler
78797879
{
78807880
public:
7881-
virtual bool handle_condition(THD *thd,
7881+
virtual bool handle_condition(THD*,
78827882
uint sql_errno,
7883-
const char* sqlstate,
7884-
Sql_condition::enum_severity_level *level,
7885-
const char* msg)
7883+
const char*,
7884+
Sql_condition::enum_severity_level*,
7885+
const char*)
78867886
{
78877887
return (sql_errno == ER_UNKNOWN_COLLATION ||
78887888
sql_errno == ER_PLUGIN_IS_NOT_LOADED);

sql/udf_example.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ bool myfunc_argument_name_init(UDF_INIT *initid, UDF_ARGS *args,
10191019
return 0;
10201020
}
10211021

1022-
char *myfunc_argument_name(UDF_INIT *initid,
1022+
char *myfunc_argument_name(UDF_INIT *,
10231023
UDF_ARGS *args, char *result,
10241024
unsigned long *length, char *null_value,
10251025
char *)

unittest/gunit/yassl/yassl-t.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@
2525
#include <pthread.h>
2626
#endif
2727

28+
#ifdef __GNUC__
29+
// YaSSL code has unused parameter warnings, ignore them.
30+
#pragma GCC diagnostic ignored "-Wunused-parameter"
31+
#pragma GCC diagnostic push
32+
#endif
2833
#include "runtime.hpp"
2934
#include "yassl_int.hpp"
35+
#ifdef __GNUC__
36+
#pragma GCC diagnostic pop
37+
#endif
3038
#include "thread_utils.h"
3139

3240
namespace {

0 commit comments

Comments
 (0)