Commit 8231f082 authored by Tor Didriksen's avatar Tor Didriksen

Bug #49829 Many "hides virtual function" warnings with SunStudio

Backport from mysql-pe (of those parts which have not been upmerged from 5.1)



sql/field.cc:
  Local scope variable or method argument same as class attribute.
sql/item.cc:
  Rename auto variable to avoid name clash.
sql/item.h:
  Item_ref::basic_const_item had wrong signature (missing const)
  and was thus never called.
sql/partition_info.cc:
  Rename, to avoid name clashes.
sql/sql_load.cc:
  Rename, to avoid name clashes.
parent 07f07ffe
...@@ -9125,7 +9125,7 @@ void Create_field::create_length_to_internal_length(void) ...@@ -9125,7 +9125,7 @@ void Create_field::create_length_to_internal_length(void)
void Create_field::init_for_tmp_table(enum_field_types sql_type_arg, void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
uint32 length_arg, uint32 decimals_arg, uint32 length_arg, uint32 decimals_arg,
bool maybe_null, bool is_unsigned, bool maybe_null, bool is_unsigned,
uint pack_length) uint pack_length_arg)
{ {
DBUG_ENTER("Create_field::init_for_tmp_table"); DBUG_ENTER("Create_field::init_for_tmp_table");
...@@ -9138,7 +9138,7 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg, ...@@ -9138,7 +9138,7 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
geom_type= Field::GEOM_GEOMETRY; geom_type= Field::GEOM_GEOMETRY;
DBUG_PRINT("enter", ("sql_type: %d, length: %u, pack_length: %u", DBUG_PRINT("enter", ("sql_type: %d, length: %u, pack_length: %u",
sql_type_arg, length_arg, pack_length)); sql_type_arg, length_arg, pack_length_arg));
/* /*
These pack flags are crafted to get it correctly through the These pack flags are crafted to get it correctly through the
...@@ -9202,8 +9202,8 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg, ...@@ -9202,8 +9202,8 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
case MYSQL_TYPE_GEOMETRY: case MYSQL_TYPE_GEOMETRY:
// If you are going to use the above types, you have to pass a // If you are going to use the above types, you have to pass a
// pack_length as parameter. Assert that is really done. // pack_length as parameter. Assert that is really done.
DBUG_ASSERT(pack_length != ~0U); DBUG_ASSERT(pack_length_arg != ~0U);
pack_flag|= pack_length_to_packflag(pack_length); pack_flag|= pack_length_to_packflag(pack_length_arg);
break; break;
default: default:
/* Nothing */ /* Nothing */
......
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. /* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -3434,9 +3434,9 @@ Item_param::set_param_type_and_swap_value(Item_param *src) ...@@ -3434,9 +3434,9 @@ Item_param::set_param_type_and_swap_value(Item_param *src)
bool bool
Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it) Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
{ {
Item *value= *it; Item *arg= *it;
if (value->is_null()) if (arg->is_null())
{ {
set_null(); set_null();
return FALSE; return FALSE;
...@@ -3444,12 +3444,12 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it) ...@@ -3444,12 +3444,12 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
null_value= FALSE; null_value= FALSE;
switch (value->result_type()) { switch (arg->result_type()) {
case STRING_RESULT: case STRING_RESULT:
{ {
char str_buffer[STRING_BUFFER_USUAL_SIZE]; char str_buffer[STRING_BUFFER_USUAL_SIZE];
String sv_buffer(str_buffer, sizeof(str_buffer), &my_charset_bin); String sv_buffer(str_buffer, sizeof(str_buffer), &my_charset_bin);
String *sv= value->val_str(&sv_buffer); String *sv= arg->val_str(&sv_buffer);
if (!sv) if (!sv)
return TRUE; return TRUE;
...@@ -3466,19 +3466,19 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it) ...@@ -3466,19 +3466,19 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
} }
case REAL_RESULT: case REAL_RESULT:
set_double(value->val_real()); set_double(arg->val_real());
param_type= MYSQL_TYPE_DOUBLE; param_type= MYSQL_TYPE_DOUBLE;
break; break;
case INT_RESULT: case INT_RESULT:
set_int(value->val_int(), value->max_length); set_int(arg->val_int(), arg->max_length);
param_type= MYSQL_TYPE_LONG; param_type= MYSQL_TYPE_LONG;
break; break;
case DECIMAL_RESULT: case DECIMAL_RESULT:
{ {
my_decimal dv_buf; my_decimal dv_buf;
my_decimal *dv= value->val_decimal(&dv_buf); my_decimal *dv= arg->val_decimal(&dv_buf);
if (!dv) if (!dv)
return TRUE; return TRUE;
...@@ -3498,8 +3498,8 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it) ...@@ -3498,8 +3498,8 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
return FALSE; return FALSE;
} }
item_result_type= value->result_type(); item_result_type= arg->result_type();
item_type= value->type(); item_type= arg->type();
return FALSE; return FALSE;
} }
......
...@@ -2506,7 +2506,7 @@ class Item_ref :public Item_ident ...@@ -2506,7 +2506,7 @@ class Item_ref :public Item_ident
DBUG_ASSERT(fixed); DBUG_ASSERT(fixed);
return (*ref)->get_time(ltime); return (*ref)->get_time(ltime);
} }
bool basic_const_item() { return (*ref)->basic_const_item(); } virtual bool basic_const_item() const { return (*ref)->basic_const_item(); }
}; };
...@@ -3367,6 +3367,7 @@ class Item_cache_datetime: public Item_cache ...@@ -3367,6 +3367,7 @@ class Item_cache_datetime: public Item_cache
cmp_context= STRING_RESULT; cmp_context= STRING_RESULT;
} }
virtual void store(Item *item) { Item_cache::store(item); }
void store(Item *item, longlong val_arg); void store(Item *item, longlong val_arg);
double val_real(); double val_real();
longlong val_int(); longlong val_int();
......
/* Copyright (C) 2006-2008 MySQL AB, Sun Microsystems Inc. 2008-2009 /* Copyright (c) 2006, 2010 Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -603,12 +603,12 @@ bool partition_info::check_engine_mix(handlerton *engine_type, ...@@ -603,12 +603,12 @@ bool partition_info::check_engine_mix(handlerton *engine_type,
{ {
handlerton *old_engine_type= engine_type; handlerton *old_engine_type= engine_type;
bool first= TRUE; bool first= TRUE;
uint num_parts= partitions.elements; uint n_parts= partitions.elements;
DBUG_ENTER("partition_info::check_engine_mix"); DBUG_ENTER("partition_info::check_engine_mix");
DBUG_PRINT("info", ("in: engine_type = %s, table_engine_set = %u", DBUG_PRINT("info", ("in: engine_type = %s, table_engine_set = %u",
ha_resolve_storage_engine_name(engine_type), ha_resolve_storage_engine_name(engine_type),
table_engine_set)); table_engine_set));
if (num_parts) if (n_parts)
{ {
List_iterator<partition_element> part_it(partitions); List_iterator<partition_element> part_it(partitions);
uint i= 0; uint i= 0;
...@@ -621,7 +621,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type, ...@@ -621,7 +621,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type,
if (is_sub_partitioned() && if (is_sub_partitioned() &&
part_elem->subpartitions.elements) part_elem->subpartitions.elements)
{ {
uint num_subparts= part_elem->subpartitions.elements; uint n_subparts= part_elem->subpartitions.elements;
uint j= 0; uint j= 0;
List_iterator<partition_element> sub_it(part_elem->subpartitions); List_iterator<partition_element> sub_it(part_elem->subpartitions);
do do
...@@ -633,7 +633,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type, ...@@ -633,7 +633,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type,
if (check_engine_condition(sub_elem, table_engine_set, if (check_engine_condition(sub_elem, table_engine_set,
&engine_type, &first)) &engine_type, &first))
goto error; goto error;
} while (++j < num_subparts); } while (++j < n_subparts);
/* ensure that the partition also has correct engine */ /* ensure that the partition also has correct engine */
if (check_engine_condition(part_elem, table_engine_set, if (check_engine_condition(part_elem, table_engine_set,
&engine_type, &first)) &engine_type, &first))
...@@ -642,7 +642,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type, ...@@ -642,7 +642,7 @@ bool partition_info::check_engine_mix(handlerton *engine_type,
else if (check_engine_condition(part_elem, table_engine_set, else if (check_engine_condition(part_elem, table_engine_set,
&engine_type, &first)) &engine_type, &first))
goto error; goto error;
} while (++i < num_parts); } while (++i < n_parts);
} }
DBUG_PRINT("info", ("engine_type = %s", DBUG_PRINT("info", ("engine_type = %s",
ha_resolve_storage_engine_name(engine_type))); ha_resolve_storage_engine_name(engine_type)));
...@@ -1315,15 +1315,15 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, ...@@ -1315,15 +1315,15 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
RETURN VALUES RETURN VALUES
*/ */
void partition_info::print_no_partition_found(TABLE *table) void partition_info::print_no_partition_found(TABLE *table_arg)
{ {
char buf[100]; char buf[100];
char *buf_ptr= (char*)&buf; char *buf_ptr= (char*)&buf;
TABLE_LIST table_list; TABLE_LIST table_list;
bzero(&table_list, sizeof(table_list)); bzero(&table_list, sizeof(table_list));
table_list.db= table->s->db.str; table_list.db= table_arg->s->db.str;
table_list.table_name= table->s->table_name.str; table_list.table_name= table_arg->s->table_name.str;
if (check_single_table_access(current_thd, if (check_single_table_access(current_thd,
SELECT_ACL, &table_list, TRUE)) SELECT_ACL, &table_list, TRUE))
...@@ -1337,13 +1337,13 @@ void partition_info::print_no_partition_found(TABLE *table) ...@@ -1337,13 +1337,13 @@ void partition_info::print_no_partition_found(TABLE *table)
buf_ptr= (char*)"from column_list"; buf_ptr= (char*)"from column_list";
else else
{ {
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set); my_bitmap_map *old_map= dbug_tmp_use_all_columns(table_arg, table_arg->read_set);
if (part_expr->null_value) if (part_expr->null_value)
buf_ptr= (char*)"NULL"; buf_ptr= (char*)"NULL";
else else
longlong2str(err_value, buf, longlong2str(err_value, buf,
part_expr->unsigned_flag ? 10 : -10); part_expr->unsigned_flag ? 10 : -10);
dbug_tmp_restore_column_map(table->read_set, old_map); dbug_tmp_restore_column_map(table_arg->read_set, old_map);
} }
my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), buf_ptr); my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, MYF(0), buf_ptr);
} }
...@@ -2003,7 +2003,7 @@ bool partition_info::fix_column_value_functions(THD *thd, ...@@ -2003,7 +2003,7 @@ bool partition_info::fix_column_value_functions(THD *thd,
part_elem_value *val, part_elem_value *val,
uint part_id) uint part_id)
{ {
uint num_columns= part_field_list.elements; uint n_columns= part_field_list.elements;
bool result= FALSE; bool result= FALSE;
uint i; uint i;
part_column_list_val *col_val= val->col_val_array; part_column_list_val *col_val= val->col_val_array;
...@@ -2013,7 +2013,7 @@ bool partition_info::fix_column_value_functions(THD *thd, ...@@ -2013,7 +2013,7 @@ bool partition_info::fix_column_value_functions(THD *thd,
{ {
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
for (i= 0; i < num_columns; col_val++, i++) for (i= 0; i < n_columns; col_val++, i++)
{ {
Item *column_item= col_val->item_expression; Item *column_item= col_val->item_expression;
Field *field= part_field_array[i]; Field *field= part_field_array[i];
......
/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc /* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -1708,7 +1708,7 @@ bool READ_INFO::find_start_of_fields() ...@@ -1708,7 +1708,7 @@ bool READ_INFO::find_start_of_fields()
/* /*
Clear taglist from tags with a specified level Clear taglist from tags with a specified level
*/ */
int READ_INFO::clear_level(int level) int READ_INFO::clear_level(int level_arg)
{ {
DBUG_ENTER("READ_INFO::read_xml clear_level"); DBUG_ENTER("READ_INFO::read_xml clear_level");
List_iterator<XML_TAG> xmlit(taglist); List_iterator<XML_TAG> xmlit(taglist);
...@@ -1717,7 +1717,7 @@ int READ_INFO::clear_level(int level) ...@@ -1717,7 +1717,7 @@ int READ_INFO::clear_level(int level)
while ((tag= xmlit++)) while ((tag= xmlit++))
{ {
if(tag->level >= level) if(tag->level >= level_arg)
{ {
xmlit.remove(); xmlit.remove();
delete tag; delete tag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment