Skip to content

Commit e25ba7e

Browse files
committed
Bug#24296291: FIX -WUNUSED-PARAMETER WARNINGS
Patch #8: Fix -Wunused-parameter warnings in sys_vars
1 parent bca8ab8 commit e25ba7e

File tree

15 files changed

+225
-223
lines changed

15 files changed

+225
-223
lines changed

extra/RAPIDJSON-README

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
1+
Copyright (c) 2015, 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
@@ -23,3 +23,6 @@ There is one change made to the library:
2323

2424
1) Rapidjson-specific changes from bug#19504183 have been applied, so that
2525
negative zero is handled properly.
26+
27+
2) RAPIDJSON_DIAG_OFF(unused-parameter) is added to rapidjson.h to silence some
28+
compiler warnings.

extra/rapidjson/include/rapidjson/rapidjson.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,4 +608,8 @@ enum Type {
608608

609609
RAPIDJSON_NAMESPACE_END
610610

611+
#if defined(__clang__) || defined(__GNUC__)
612+
RAPIDJSON_DIAG_OFF(unused-parameter)
613+
#endif
614+
611615
#endif // RAPIDJSON_RAPIDJSON_H_

include/mysql/psi/mysql_mdl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2012, 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
@@ -108,7 +108,7 @@ static inline void inline_mysql_mdl_set_status(
108108

109109
static inline void inline_mysql_mdl_destroy(
110110
PSI_metadata_lock *psi,
111-
const char *src_file, uint src_line)
111+
const char*, uint)
112112
{
113113
if (psi != NULL)
114114
PSI_METADATA_CALL(destroy_metadata_lock)(psi);

sql/json_dom.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ class Rapid_json_handler
597597
return false;
598598
}
599599

600-
bool String(const char* str, SizeType length, bool copy)
600+
bool String(const char* str, SizeType length, bool)
601601
{
602602
DUMP_CALLBACK("string", state);
603603
return seeing_value(new (std::nothrow) Json_string(str, length));
@@ -641,7 +641,7 @@ class Rapid_json_handler
641641
return true;
642642
}
643643

644-
bool Key(const char* str, SizeType len, bool copy)
644+
bool Key(const char* str, SizeType len, bool)
645645
{
646646
if (check_json_depth(m_depth + 1))
647647
return false;
@@ -746,7 +746,8 @@ class Syntax_check_handler
746746
bool Uint(unsigned) { return seeing_scalar(); }
747747
bool Int64(int64_t) { return seeing_scalar(); }
748748
bool Uint64(uint64_t) { return seeing_scalar(); }
749-
bool Double(double, bool is_int= false) { return seeing_scalar(); }
749+
bool Double(double, bool is_int MY_ATTRIBUTE((unused)) = false)
750+
{ return seeing_scalar(); }
750751
bool String(const char*, SizeType, bool) { return seeing_scalar(); }
751752
bool Key(const char*, SizeType, bool) { return seeing_scalar(); }
752753
bool RawNumber(const char*, SizeType, bool)

sql/key.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,12 @@ bool key_cmp_if_same(TABLE *table,const uchar *key,uint idx,uint key_length)
335335
336336
@param[in,out] to String to append the field contents to.
337337
@param field Field to unpack.
338-
@param rec Record which contains the field data.
339338
@param max_length Maximum length of field to unpack
340339
or 0 for unlimited.
341340
@param prefix_key The field is used as a prefix key.
342341
*/
343342

344-
void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
345-
bool prefix_key)
343+
void field_unpack(String *to, Field *field, uint max_length, bool prefix_key)
346344
{
347345
String tmp;
348346
DBUG_ENTER("field_unpack");
@@ -428,7 +426,7 @@ void key_unpack(String *to, TABLE *table, KEY *key)
428426
continue;
429427
}
430428
}
431-
field_unpack(to, key_part->field, table->record[0], key_part->length,
429+
field_unpack(to, key_part->field, key_part->length,
432430
MY_TEST(key_part->key_part_flag & HA_PART_KEY_SEG));
433431
}
434432
dbug_tmp_restore_column_map(table->read_set, old_map);

sql/key.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2006, 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
@@ -337,8 +337,7 @@ void key_restore(uchar *to_record, uchar *from_key, KEY *key_info,
337337
uint key_length);
338338
bool key_cmp_if_same(TABLE *form,const uchar *key,uint index,uint key_length);
339339
void key_unpack(String *to, TABLE *table, KEY *key);
340-
void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
341-
bool prefix_key);
340+
void field_unpack(String *to, Field *field, uint max_length, bool prefix_key);
342341
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields);
343342
int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length);
344343
int key_cmp2(KEY_PART_INFO *key_part,

sql/locking_service.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2015, 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
@@ -42,11 +42,11 @@
4242
class Locking_service_deadlock_error_handler: public Internal_error_handler
4343
{
4444
public:
45-
virtual bool handle_condition(THD *thd,
45+
virtual bool handle_condition(THD*,
4646
uint sql_errno,
47-
const char *sqlstate,
48-
Sql_condition::enum_severity_level *level,
49-
const char *msg)
47+
const char*,
48+
Sql_condition::enum_severity_level*,
49+
const char*)
5050
{
5151
if (sql_errno == ER_LOCK_DEADLOCK)
5252
{

sql/log.cc

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ class Silence_log_table_errors : public Internal_error_handler
277277
public:
278278
Silence_log_table_errors() { m_message[0]= '\0'; }
279279

280-
virtual bool handle_condition(THD *thd,
281-
uint sql_errno,
282-
const char* sql_state,
283-
Sql_condition::enum_severity_level *level,
280+
virtual bool handle_condition(THD*,
281+
uint,
282+
const char*,
283+
Sql_condition::enum_severity_level*,
284284
const char* msg)
285285
{
286286
strmake(m_message, msg, sizeof(m_message)-1);
@@ -838,8 +838,6 @@ void File_query_log::check_and_print_write_error()
838838

839839

840840
bool File_query_log::write_general(ulonglong event_utime,
841-
const char *user_host,
842-
size_t user_host_len,
843841
my_thread_id thread_id,
844842
const char *command_type,
845843
size_t command_type_len,
@@ -892,9 +890,8 @@ bool File_query_log::write_general(ulonglong event_utime,
892890

893891

894892
bool File_query_log::write_slow(THD *thd, ulonglong current_utime,
895-
ulonglong query_start_arg,
896893
const char *user_host,
897-
size_t user_host_len, ulonglong query_utime,
894+
size_t, ulonglong query_utime,
898895
ulonglong lock_utime, bool is_command,
899896
const char *sql_text, size_t sql_text_len)
900897
{
@@ -1143,7 +1140,7 @@ bool Log_to_csv_event_handler::log_slow(THD *thd, ulonglong current_utime,
11431140
const char *user_host,
11441141
size_t user_host_len,
11451142
ulonglong query_utime,
1146-
ulonglong lock_utime, bool is_command,
1143+
ulonglong lock_utime, bool,
11471144
const char *sql_text,
11481145
size_t sql_text_len)
11491146
{
@@ -1351,7 +1348,7 @@ bool Log_to_csv_event_handler::activate_log(THD *thd,
13511348

13521349

13531350
bool Log_to_file_event_handler::log_slow(THD *thd, ulonglong current_utime,
1354-
ulonglong query_start_arg,
1351+
ulonglong,
13551352
const char *user_host,
13561353
size_t user_host_len,
13571354
ulonglong query_utime,
@@ -1365,7 +1362,7 @@ bool Log_to_file_event_handler::log_slow(THD *thd, ulonglong current_utime,
13651362

13661363
Silence_log_table_errors error_handler;
13671364
thd->push_internal_handler(&error_handler);
1368-
bool retval= mysql_slow_log.write_slow(thd, current_utime, query_start_arg,
1365+
bool retval= mysql_slow_log.write_slow(thd, current_utime,
13691366
user_host, user_host_len,
13701367
query_utime, lock_utime, is_command,
13711368
sql_text, sql_text_len);
@@ -1375,22 +1372,21 @@ bool Log_to_file_event_handler::log_slow(THD *thd, ulonglong current_utime,
13751372

13761373

13771374
bool Log_to_file_event_handler::log_general(THD *thd, ulonglong event_utime,
1378-
const char *user_host,
1379-
size_t user_host_len,
1375+
const char*,
1376+
size_t,
13801377
my_thread_id thread_id,
13811378
const char *command_type,
13821379
size_t command_type_len,
13831380
const char *sql_text,
13841381
size_t sql_text_len,
1385-
const CHARSET_INFO *client_cs)
1382+
const CHARSET_INFO*)
13861383
{
13871384
if (!mysql_general_log.is_open())
13881385
return false;
13891386

13901387
Silence_log_table_errors error_handler;
13911388
thd->push_internal_handler(&error_handler);
1392-
bool retval= mysql_general_log.write_general(event_utime, user_host,
1393-
user_host_len, thread_id,
1389+
bool retval= mysql_general_log.write_general(event_utime, thread_id,
13941390
command_type, command_type_len,
13951391
sql_text, sql_text_len);
13961392
thd->pop_internal_handler();

sql/log.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2005, 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
@@ -141,9 +141,6 @@ class File_query_log
141141
Log given command to normal (not rotatable) log file.
142142
143143
@param event_utime Command start timestamp in micro seconds
144-
@param user_host The pointer to the string with user\@host info
145-
@param user_host_len Length of the user_host string. this is computed once
146-
and passed to all general log event handlers
147144
@param thread_id Id of the thread that issued the query
148145
@param command_type The type of the command being logged
149146
@param command_type_len The length of the string above
@@ -152,8 +149,7 @@ class File_query_log
152149
153150
@return true if error, false otherwise.
154151
*/
155-
bool write_general(ulonglong event_utime, const char *user_host,
156-
size_t user_host_len, my_thread_id thread_id,
152+
bool write_general(ulonglong event_utime, my_thread_id thread_id,
157153
const char *command_type, size_t command_type_len,
158154
const char *sql_text, size_t sql_text_len);
159155

@@ -162,7 +158,6 @@ class File_query_log
162158
163159
@param thd THD of the query
164160
@param current_utime Current timestamp in micro seconds
165-
@param query_start_arg Command start timestamp
166161
@param user_host The pointer to the string with user\@host info
167162
@param user_host_len Length of the user_host string. this is computed once
168163
and passed to all general log event handlers
@@ -176,7 +171,7 @@ class File_query_log
176171
177172
@return true if error, false otherwise.
178173
*/
179-
bool write_slow(THD *thd, ulonglong current_utime, ulonglong query_start_arg,
174+
bool write_slow(THD *thd, ulonglong current_utime,
180175
const char *user_host, size_t user_host_len,
181176
ulonglong query_utime, ulonglong lock_utime, bool is_command,
182177
const char *sql_text, size_t sql_text_len);

0 commit comments

Comments
 (0)