Skip to content

Commit

Permalink
cleanup: more 'const' qualifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Oct 10, 2014
1 parent 9ccaa62 commit d508ef7
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 63 deletions.
2 changes: 1 addition & 1 deletion sql/keycaches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ LEX_STRING default_key_cache_base= {C_STRING_WITH_LEN("default")};

KEY_CACHE zero_key_cache; ///< @@nonexistent_cache.param->value_ptr() points here

KEY_CACHE *get_key_cache(LEX_STRING *cache_name)
KEY_CACHE *get_key_cache(const LEX_STRING *cache_name)
{
if (!cache_name || ! cache_name->length)
cache_name= &default_key_cache_base;
Expand Down
2 changes: 1 addition & 1 deletion sql/keycaches.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern KEY_CACHE zero_key_cache;
extern NAMED_ILIST key_caches;

KEY_CACHE *create_key_cache(const char *name, uint length);
KEY_CACHE *get_key_cache(LEX_STRING *cache_name);
KEY_CACHE *get_key_cache(const LEX_STRING *cache_name);
KEY_CACHE *get_or_create_key_cache(const char *name, uint length);
void free_key_cache(const char *name, KEY_CACHE *key_cache);
bool process_key_caches(process_key_cache_t func, void *param);
Expand Down
2 changes: 1 addition & 1 deletion sql/rpl_mi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ bool Master_info_index::write_master_name_to_index_file(LEX_STRING *name,
*/

Master_info *
Master_info_index::get_master_info(LEX_STRING *connection_name,
Master_info_index::get_master_info(const LEX_STRING *connection_name,
Sql_condition::enum_warning_level warning)
{
Master_info *mi;
Expand Down
2 changes: 1 addition & 1 deletion sql/rpl_mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class Master_info_index
const char *host, uint port);
bool add_master_info(Master_info *mi, bool write_to_file);
bool remove_master_info(LEX_STRING *connection_name);
Master_info *get_master_info(LEX_STRING *connection_name,
Master_info *get_master_info(const LEX_STRING *connection_name,
Sql_condition::enum_warning_level warning);
bool give_error_if_slave_running();
bool start_all_slaves(THD *thd);
Expand Down
6 changes: 3 additions & 3 deletions sql/set_var.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ bool sys_var::update(THD *thd, set_var *var)
(on_update && on_update(this, thd, OPT_SESSION));
}

uchar *sys_var::session_value_ptr(THD *thd, LEX_STRING *base)
uchar *sys_var::session_value_ptr(THD *thd, const LEX_STRING *base)
{
return session_var_ptr(thd);
}

uchar *sys_var::global_value_ptr(THD *thd, LEX_STRING *base)
uchar *sys_var::global_value_ptr(THD *thd, const LEX_STRING *base)
{
return global_var_ptr();
}
Expand Down Expand Up @@ -238,7 +238,7 @@ bool sys_var::check(THD *thd, set_var *var)
return false;
}

uchar *sys_var::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
uchar *sys_var::value_ptr(THD *thd, enum_var_type type, const LEX_STRING *base)
{
if (type == OPT_GLOBAL || scope() == GLOBAL)
{
Expand Down
6 changes: 3 additions & 3 deletions sql/set_var.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class sys_var
virtual sys_var_pluginvar *cast_pluginvar() { return 0; }

bool check(THD *thd, set_var *var);
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
uchar *value_ptr(THD *thd, enum_var_type type, const LEX_STRING *base);

/**
Update the system variable with the default value from either
Expand Down Expand Up @@ -208,8 +208,8 @@ class sys_var
It must be of show_val_type type (bool for SHOW_BOOL, int for SHOW_INT,
longlong for SHOW_LONGLONG, etc).
*/
virtual uchar *session_value_ptr(THD *thd, LEX_STRING *base);
virtual uchar *global_value_ptr(THD *thd, LEX_STRING *base);
virtual uchar *session_value_ptr(THD *thd, const LEX_STRING *base);
virtual uchar *global_value_ptr(THD *thd, const LEX_STRING *base);

/**
A pointer to a storage area of the variable, to the raw data.
Expand Down
8 changes: 4 additions & 4 deletions sql/sql_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ class sys_var_pluginvar: public sys_var, public Sql_alloc
sys_var_pluginvar *cast_pluginvar() { return this; }
uchar* real_value_ptr(THD *thd, enum_var_type type);
TYPELIB* plugin_var_typelib(void);
uchar* do_value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
uchar* session_value_ptr(THD *thd, LEX_STRING *base)
uchar* do_value_ptr(THD *thd, enum_var_type type, const LEX_STRING *base);
uchar* session_value_ptr(THD *thd, const LEX_STRING *base)
{ return do_value_ptr(thd, OPT_SESSION, base); }
uchar* global_value_ptr(THD *thd, LEX_STRING *base)
uchar* global_value_ptr(THD *thd, const LEX_STRING *base)
{ return do_value_ptr(thd, OPT_GLOBAL, base); }
bool do_check(THD *thd, set_var *var);
virtual void session_save_default(THD *thd, set_var *var) {}
Expand Down Expand Up @@ -3270,7 +3270,7 @@ TYPELIB* sys_var_pluginvar::plugin_var_typelib(void)


uchar* sys_var_pluginvar::do_value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
const LEX_STRING *base)
{
uchar* result;

Expand Down
12 changes: 6 additions & 6 deletions sql/sys_vars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ static Sys_var_gtid_binlog_pos Sys_gtid_binlog_pos(


uchar *
Sys_var_gtid_binlog_pos::global_value_ptr(THD *thd, LEX_STRING *base)
Sys_var_gtid_binlog_pos::global_value_ptr(THD *thd, const LEX_STRING *base)
{
char buf[128];
String str(buf, sizeof(buf), system_charset_info);
Expand Down Expand Up @@ -1505,7 +1505,7 @@ static Sys_var_gtid_current_pos Sys_gtid_current_pos(


uchar *
Sys_var_gtid_current_pos::global_value_ptr(THD *thd, LEX_STRING *base)
Sys_var_gtid_current_pos::global_value_ptr(THD *thd, const LEX_STRING *base)
{
String str;
char *p;
Expand Down Expand Up @@ -1590,7 +1590,7 @@ Sys_var_gtid_slave_pos::global_update(THD *thd, set_var *var)


uchar *
Sys_var_gtid_slave_pos::global_value_ptr(THD *thd, LEX_STRING *base)
Sys_var_gtid_slave_pos::global_value_ptr(THD *thd, const LEX_STRING *base)
{
String str;
char *p;
Expand Down Expand Up @@ -1708,7 +1708,7 @@ Sys_var_gtid_binlog_state::global_update(THD *thd, set_var *var)


uchar *
Sys_var_gtid_binlog_state::global_value_ptr(THD *thd, LEX_STRING *base)
Sys_var_gtid_binlog_state::global_value_ptr(THD *thd, const LEX_STRING *base)
{
char buf[512];
String str(buf, sizeof(buf), system_charset_info);
Expand Down Expand Up @@ -1741,7 +1741,7 @@ static Sys_var_last_gtid Sys_last_gtid(


uchar *
Sys_var_last_gtid::session_value_ptr(THD *thd, LEX_STRING *base)
Sys_var_last_gtid::session_value_ptr(THD *thd, const LEX_STRING *base)
{
char buf[10+1+10+1+20+1];
String str(buf, sizeof(buf), system_charset_info);
Expand Down Expand Up @@ -4123,7 +4123,7 @@ bool Sys_var_rpl_filter::set_filter_value(const char *value, Master_info *mi)
return status;
}

uchar *Sys_var_rpl_filter::global_value_ptr(THD *thd, LEX_STRING *base)
uchar *Sys_var_rpl_filter::global_value_ptr(THD *thd, const LEX_STRING *base)
{
char buf[256];
String tmp(buf, sizeof(buf), &my_charset_bin);
Expand Down
Loading

0 comments on commit d508ef7

Please sign in to comment.