Skip to content

Commit c786f91

Browse files
committed
Bug#24296291: FIX -WUNUSED-PARAMETER WARNINGS
Patch #11: Fix -Wunused-parameter warnings in sql*, part 1.
1 parent 78d21a9 commit c786f91

37 files changed

+155
-211
lines changed

sql/dd/dd_upgrade.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ static bool create_unlinked_view(THD *thd,
11131113
TABLE_LIST *saved_query_tables= thd->lex->query_tables;
11141114
SQL_I_List<Sroutine_hash_entry> saved_sroutines_list;
11151115
// For creation of view without column information.
1116-
SELECT_LEX select(NULL, NULL, NULL, NULL, NULL, NULL);
1116+
SELECT_LEX select(nullptr, nullptr);
11171117

11181118
// Backup
11191119
thd->lex->select_lex= &select;

sql/dd/impl/sdi_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ template <typename CONDITION_HANDLER_CLOS>
8888
class Closure_error_handler : public Internal_error_handler
8989
{
9090
CONDITION_HANDLER_CLOS *m_ch;
91-
bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate,
91+
bool handle_condition(THD*, uint sql_errno, const char* sqlstate,
9292
Sql_condition::enum_severity_level *level,
9393
const char* msg)
9494
{

sql/handler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5336,7 +5336,7 @@ class handler :public Sql_alloc
53365336
@param [in] key_info Array of KEY objects describing table
53375337
indexes.
53385338
@param [in] key_count Number of indexes in the table.
5339-
@param [in,out] table dd::Table object describing the table
5339+
@param [in,out] table_obj dd::Table object describing the table
53405340
to be created. Implicit columns and
53415341
indexes are to be added to this object.
53425342
Adjusted table description will be
@@ -5352,7 +5352,7 @@ class handler :public Sql_alloc
53525352
*create_list MY_ATTRIBUTE((unused)),
53535353
const KEY *key_info MY_ATTRIBUTE((unused)),
53545354
uint key_count MY_ATTRIBUTE((unused)),
5355-
dd::Table *table MY_ATTRIBUTE((unused)))
5355+
dd::Table *table_obj MY_ATTRIBUTE((unused)))
53565356
{ return 0; }
53575357

53585358
virtual bool set_ha_share_ref(Handler_share **arg_ha_share)

sql/item.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9076,7 +9076,6 @@ void Item_insert_value::print(String *str, enum_query_type query_type)
90769076
Find index of Field object which will be appropriate for item
90779077
representing field of row being changed in trigger.
90789078
9079-
@param thd current thread context
90809079
@param table_triggers Table_trigger_field_support instance. Do not use
90819080
TABLE::triggers as it might be not initialized at
90829081
the moment.
@@ -9095,15 +9094,14 @@ void Item_insert_value::print(String *str, enum_query_type query_type)
90959094
Another difference is that the field is not marked in read_set/write_set.
90969095
*/
90979096

9098-
void Item_trigger_field::setup_field(THD *thd,
9099-
Table_trigger_field_support *table_triggers,
9097+
void Item_trigger_field::setup_field(Table_trigger_field_support *table_triggers,
91009098
GRANT_INFO *table_grant_info)
91019099
{
91029100
/*
91039101
Try to find field by its name and if it will be found
91049102
set field_idx properly.
91059103
*/
9106-
(void) find_field_in_table(thd, table_triggers->get_subject_table(),
9104+
(void) find_field_in_table(table_triggers->get_subject_table(),
91079105
field_name, strlen(field_name),
91089106
0, &field_idx);
91099107
triggers= table_triggers;

sql/item.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5406,8 +5406,7 @@ class Item_trigger_field final : public Item_field,
54065406
field_idx((uint)-1), original_privilege(priv),
54075407
want_privilege(priv), table_grants(NULL), read_only (ro)
54085408
{}
5409-
void setup_field(THD *thd,
5410-
Table_trigger_field_support *table_triggers,
5409+
void setup_field(Table_trigger_field_support *table_triggers,
54115410
GRANT_INFO *table_grant_info);
54125411
enum Type type() const override { return TRIGGER_FIELD_ITEM; }
54135412
bool eq(const Item *item, bool binary_cmp) const override;

sql/parse_tree_nodes.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ bool PT_table_factor_joined_table::contextualize(Parse_context *pc)
11201120
return true;
11211121
value= m_joined_table->value;
11221122

1123-
if (outer_select->end_nested_join(pc->thd) == NULL)
1123+
if (outer_select->end_nested_join() == nullptr)
11241124
return true;
11251125

11261126
return false;

sql/sp_head.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ bool sp_head::setup_trigger_fields(THD *thd,
18661866
for (Item_trigger_field *f= trig_field_list->first; f;
18671867
f= f->next_trg_field)
18681868
{
1869-
f->setup_field(thd, tfs, subject_table_grant);
1869+
f->setup_field(tfs, subject_table_grant);
18701870

18711871
if (need_fix_fields &&
18721872
!f->fixed &&

sql/sp_instr.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ LEX *sp_lex_instr::parse_expr(THD *thd, sp_head *sp)
607607
trg_fld;
608608
trg_fld= trg_fld->next_trg_field)
609609
{
610-
trg_fld->setup_field(thd, sp->m_trg_list->get_trigger_field_support(),
610+
trg_fld->setup_field(sp->m_trg_list->get_trigger_field_support(),
611611
t->get_subject_table_grant());
612612
}
613613

sql/sql_alter_instance.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
3535
@brief
3636
Log current command to binlog
3737
38-
@param [IN] is_transactional - Whether statement is transactional or not
39-
4038
@returns false on success,
4139
true on error
4240
4341
In case of failure, appropriate error is logged.
4442
*/
4543

4644
bool
47-
Alter_instance::log_to_binlog(bool is_transactional)
45+
Alter_instance::log_to_binlog()
4846
{
4947
bool res= false;
5048
if (!m_thd->lex->no_write_to_binlog)
@@ -101,7 +99,7 @@ Rotate_innodb_master_key::execute()
10199
return true;
102100
}
103101

104-
if (log_to_binlog(false))
102+
if (log_to_binlog())
105103
{
106104
/*
107105
Though we failed to write to binlog,

sql/sql_alter_instance.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2016, 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
@@ -29,7 +29,7 @@ class Alter_instance
2929
: m_thd(thd)
3030
{}
3131
virtual bool execute()= 0;
32-
bool log_to_binlog(bool is_transactional);
32+
bool log_to_binlog();
3333
virtual ~Alter_instance() {};
3434
};
3535

sql/sql_analyse.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ int collect_real(double *element, element_count count MY_ATTRIBUTE((unused)),
10821082
} // collect_real
10831083

10841084

1085-
int collect_decimal(uchar *element, element_count count,
1085+
int collect_decimal(uchar *element, element_count,
10861086
TREE_INFO *info)
10871087
{
10881088
char buff[DECIMAL_MAX_STR_LENGTH + 1];

0 commit comments

Comments
 (0)