Commit d508ef78 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: more 'const' qualifiers

parent 9ccaa62d
...@@ -103,7 +103,7 @@ LEX_STRING default_key_cache_base= {C_STRING_WITH_LEN("default")}; ...@@ -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 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) if (!cache_name || ! cache_name->length)
cache_name= &default_key_cache_base; cache_name= &default_key_cache_base;
......
...@@ -40,7 +40,7 @@ extern KEY_CACHE zero_key_cache; ...@@ -40,7 +40,7 @@ extern KEY_CACHE zero_key_cache;
extern NAMED_ILIST key_caches; extern NAMED_ILIST key_caches;
KEY_CACHE *create_key_cache(const char *name, uint length); 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); KEY_CACHE *get_or_create_key_cache(const char *name, uint length);
void free_key_cache(const char *name, KEY_CACHE *key_cache); void free_key_cache(const char *name, KEY_CACHE *key_cache);
bool process_key_caches(process_key_cache_t func, void *param); bool process_key_caches(process_key_cache_t func, void *param);
......
...@@ -1078,7 +1078,7 @@ bool Master_info_index::write_master_name_to_index_file(LEX_STRING *name, ...@@ -1078,7 +1078,7 @@ bool Master_info_index::write_master_name_to_index_file(LEX_STRING *name,
*/ */
Master_info * 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) Sql_condition::enum_warning_level warning)
{ {
Master_info *mi; Master_info *mi;
......
...@@ -209,7 +209,7 @@ class Master_info_index ...@@ -209,7 +209,7 @@ class Master_info_index
const char *host, uint port); const char *host, uint port);
bool add_master_info(Master_info *mi, bool write_to_file); bool add_master_info(Master_info *mi, bool write_to_file);
bool remove_master_info(LEX_STRING *connection_name); 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); Sql_condition::enum_warning_level warning);
bool give_error_if_slave_running(); bool give_error_if_slave_running();
bool start_all_slaves(THD *thd); bool start_all_slaves(THD *thd);
......
...@@ -200,12 +200,12 @@ bool sys_var::update(THD *thd, set_var *var) ...@@ -200,12 +200,12 @@ bool sys_var::update(THD *thd, set_var *var)
(on_update && on_update(this, thd, OPT_SESSION)); (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); 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(); return global_var_ptr();
} }
...@@ -238,7 +238,7 @@ bool sys_var::check(THD *thd, set_var *var) ...@@ -238,7 +238,7 @@ bool sys_var::check(THD *thd, set_var *var)
return false; 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) if (type == OPT_GLOBAL || scope() == GLOBAL)
{ {
......
...@@ -107,7 +107,7 @@ class sys_var ...@@ -107,7 +107,7 @@ class sys_var
virtual sys_var_pluginvar *cast_pluginvar() { return 0; } virtual sys_var_pluginvar *cast_pluginvar() { return 0; }
bool check(THD *thd, set_var *var); 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 Update the system variable with the default value from either
...@@ -208,8 +208,8 @@ class sys_var ...@@ -208,8 +208,8 @@ class sys_var
It must be of show_val_type type (bool for SHOW_BOOL, int for SHOW_INT, It must be of show_val_type type (bool for SHOW_BOOL, int for SHOW_INT,
longlong for SHOW_LONGLONG, etc). longlong for SHOW_LONGLONG, etc).
*/ */
virtual uchar *session_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, 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. A pointer to a storage area of the variable, to the raw data.
......
...@@ -261,10 +261,10 @@ class sys_var_pluginvar: public sys_var, public Sql_alloc ...@@ -261,10 +261,10 @@ class sys_var_pluginvar: public sys_var, public Sql_alloc
sys_var_pluginvar *cast_pluginvar() { return this; } sys_var_pluginvar *cast_pluginvar() { return this; }
uchar* real_value_ptr(THD *thd, enum_var_type type); uchar* real_value_ptr(THD *thd, enum_var_type type);
TYPELIB* plugin_var_typelib(void); TYPELIB* plugin_var_typelib(void);
uchar* do_value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); uchar* do_value_ptr(THD *thd, enum_var_type type, const LEX_STRING *base);
uchar* session_value_ptr(THD *thd, LEX_STRING *base) uchar* session_value_ptr(THD *thd, const LEX_STRING *base)
{ return do_value_ptr(thd, OPT_SESSION, 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); } { return do_value_ptr(thd, OPT_GLOBAL, base); }
bool do_check(THD *thd, set_var *var); bool do_check(THD *thd, set_var *var);
virtual void session_save_default(THD *thd, set_var *var) {} virtual void session_save_default(THD *thd, set_var *var) {}
...@@ -3270,7 +3270,7 @@ TYPELIB* sys_var_pluginvar::plugin_var_typelib(void) ...@@ -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, uchar* sys_var_pluginvar::do_value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base) const LEX_STRING *base)
{ {
uchar* result; uchar* result;
......
...@@ -1477,7 +1477,7 @@ static Sys_var_gtid_binlog_pos Sys_gtid_binlog_pos( ...@@ -1477,7 +1477,7 @@ static Sys_var_gtid_binlog_pos Sys_gtid_binlog_pos(
uchar * 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]; char buf[128];
String str(buf, sizeof(buf), system_charset_info); String str(buf, sizeof(buf), system_charset_info);
...@@ -1505,7 +1505,7 @@ static Sys_var_gtid_current_pos Sys_gtid_current_pos( ...@@ -1505,7 +1505,7 @@ static Sys_var_gtid_current_pos Sys_gtid_current_pos(
uchar * 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; String str;
char *p; char *p;
...@@ -1590,7 +1590,7 @@ Sys_var_gtid_slave_pos::global_update(THD *thd, set_var *var) ...@@ -1590,7 +1590,7 @@ Sys_var_gtid_slave_pos::global_update(THD *thd, set_var *var)
uchar * 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; String str;
char *p; char *p;
...@@ -1708,7 +1708,7 @@ Sys_var_gtid_binlog_state::global_update(THD *thd, set_var *var) ...@@ -1708,7 +1708,7 @@ Sys_var_gtid_binlog_state::global_update(THD *thd, set_var *var)
uchar * 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]; char buf[512];
String str(buf, sizeof(buf), system_charset_info); String str(buf, sizeof(buf), system_charset_info);
...@@ -1741,7 +1741,7 @@ static Sys_var_last_gtid Sys_last_gtid( ...@@ -1741,7 +1741,7 @@ static Sys_var_last_gtid Sys_last_gtid(
uchar * 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]; char buf[10+1+10+1+20+1];
String str(buf, sizeof(buf), system_charset_info); String str(buf, sizeof(buf), system_charset_info);
...@@ -4123,7 +4123,7 @@ bool Sys_var_rpl_filter::set_filter_value(const char *value, Master_info *mi) ...@@ -4123,7 +4123,7 @@ bool Sys_var_rpl_filter::set_filter_value(const char *value, Master_info *mi)
return status; 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]; char buf[256];
String tmp(buf, sizeof(buf), &my_charset_bin); String tmp(buf, sizeof(buf), &my_charset_bin);
......
This diff is collapsed.
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