Commit a3d08eaa authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

I renamed system variable literal_collation into connection_collation

parent 292f7954
......@@ -172,7 +172,7 @@ bool Item::get_time(TIME *ltime)
CHARSET_INFO * Item::default_charset() const
{
return current_thd->db_charset;
return current_thd->variables.connection_collation;
}
bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
......
......@@ -2094,7 +2094,7 @@ static int init_common_variables(const char *conf_file_name, int argc,
return 1;
global_system_variables.result_collation= default_charset_info;
global_system_variables.client_collation= default_charset_info;
global_system_variables.literal_collation= default_charset_info;
global_system_variables.connection_collation= default_charset_info;
charsets_list= list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG));
......@@ -4577,7 +4577,7 @@ static void set_options(void)
/* Set default values for some variables */
global_system_variables.result_collation= default_charset_info;
global_system_variables.client_collation= default_charset_info;
global_system_variables.literal_collation= default_charset_info;
global_system_variables.connection_collation= default_charset_info;
global_system_variables.table_type= DB_TYPE_MYISAM;
global_system_variables.tx_isolation= ISO_REPEATABLE_READ;
global_system_variables.select_limit= (ulonglong) HA_POS_ERROR;
......
......@@ -110,6 +110,7 @@ sys_var_bool_ptr sys_concurrent_insert("concurrent_insert",
&myisam_concurrent_insert);
sys_var_long_ptr sys_connect_timeout("connect_timeout",
&connect_timeout);
sys_var_connection_collation sys_connection_collation("connection_collation");
sys_var_enum sys_delay_key_write("delay_key_write",
&delay_key_write_options,
&delay_key_write_typelib,
......@@ -131,7 +132,6 @@ sys_var_thd_ulong sys_join_buffer_size("join_buffer_size",
sys_var_ulonglong_ptr sys_key_buffer_size("key_buffer_size",
&keybuff_size,
fix_key_buffer_size);
sys_var_literal_collation sys_literal_collation("literal_collation");
sys_var_bool_ptr sys_local_infile("local_infile",
&opt_local_infile);
sys_var_thd_bool sys_log_warnings("log_warnings", &SV::log_warnings);
......@@ -346,6 +346,7 @@ sys_var *sys_variables[]=
&sys_client_collation,
&sys_concurrent_insert,
&sys_connect_timeout,
&sys_connection_collation,
&sys_default_week_format,
&sys_delay_key_write,
&sys_delayed_insert_limit,
......@@ -362,7 +363,6 @@ sys_var *sys_variables[]=
&sys_interactive_timeout,
&sys_join_buffer_size,
&sys_key_buffer_size,
&sys_literal_collation,
&sys_last_insert_id,
&sys_local_infile,
&sys_log_binlog,
......@@ -458,6 +458,7 @@ struct show_var_st init_vars[]= {
{sys_client_collation.name, (char*) &sys_client_collation, SHOW_SYS},
{sys_concurrent_insert.name,(char*) &sys_concurrent_insert, SHOW_SYS},
{sys_connect_timeout.name, (char*) &sys_connect_timeout, SHOW_SYS},
{sys_connection_collation.name,(char*) &sys_connection_collation, SHOW_SYS},
{"datadir", mysql_real_data_home, SHOW_CHAR},
{"default_week_format", (char*) &sys_default_week_format, SHOW_SYS},
{sys_delay_key_write.name, (char*) &sys_delay_key_write, SHOW_SYS},
......@@ -508,7 +509,6 @@ struct show_var_st init_vars[]= {
{sys_key_buffer_size.name, (char*) &sys_key_buffer_size, SHOW_SYS},
{"language", language, SHOW_CHAR},
{"large_files_support", (char*) &opt_large_files, SHOW_BOOL},
{sys_literal_collation.name,(char*) &sys_literal_collation, SHOW_SYS},
{sys_local_infile.name, (char*) &sys_local_infile, SHOW_SYS},
#ifdef HAVE_MLOCKALL
{"locked_in_memory", (char*) &locked_in_memory, SHOW_BOOL},
......@@ -1242,29 +1242,29 @@ void sys_var_client_collation::set_default(THD *thd, enum_var_type type)
}
bool sys_var_literal_collation::update(THD *thd, set_var *var)
bool sys_var_connection_collation::update(THD *thd, set_var *var)
{
if (var->type == OPT_GLOBAL)
global_system_variables.literal_collation= var->save_result.charset;
global_system_variables.connection_collation= var->save_result.charset;
else
thd->variables.literal_collation= var->save_result.charset;
thd->variables.connection_collation= var->save_result.charset;
return 0;
}
byte *sys_var_literal_collation::value_ptr(THD *thd, enum_var_type type)
byte *sys_var_connection_collation::value_ptr(THD *thd, enum_var_type type)
{
CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
global_system_variables.literal_collation :
thd->variables.literal_collation);
global_system_variables.connection_collation :
thd->variables.connection_collation);
return cs ? (byte*) cs->name : (byte*) "";
}
void sys_var_literal_collation::set_default(THD *thd, enum_var_type type)
void sys_var_connection_collation::set_default(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
global_system_variables.literal_collation= default_charset_info;
global_system_variables.connection_collation= default_charset_info;
else
thd->variables.literal_collation= global_system_variables.literal_collation;
thd->variables.connection_collation= global_system_variables.connection_collation;
}
bool sys_var_result_collation::update(THD *thd, set_var *var)
......@@ -1305,7 +1305,7 @@ int set_var_client_collation::check(THD *thd)
int set_var_client_collation::update(THD *thd)
{
thd->variables.client_collation= client_collation;
thd->variables.literal_collation= literal_collation;
thd->variables.connection_collation= connection_collation;
thd->variables.result_collation= result_collation;
thd->protocol_simple.init(thd);
thd->protocol_prep.init(thd);
......
......@@ -429,10 +429,10 @@ public:
byte *value_ptr(THD *thd, enum_var_type type);
};
class sys_var_literal_collation :public sys_var_collation
class sys_var_connection_collation :public sys_var_collation
{
public:
sys_var_literal_collation(const char *name_arg) :sys_var_collation(name_arg) {}
sys_var_connection_collation(const char *name_arg) :sys_var_collation(name_arg) {}
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
byte *value_ptr(THD *thd, enum_var_type type);
......@@ -556,14 +556,14 @@ public:
class set_var_client_collation: public set_var_base
{
CHARSET_INFO *client_collation;
CHARSET_INFO *literal_collation;
CHARSET_INFO *connection_collation;
CHARSET_INFO *result_collation;
public:
set_var_client_collation(CHARSET_INFO *client_coll_arg,
CHARSET_INFO *literal_coll_arg,
CHARSET_INFO *connection_coll_arg,
CHARSET_INFO *result_coll_arg)
:client_collation(client_coll_arg),
literal_collation(literal_coll_arg),
connection_collation(connection_coll_arg),
result_collation(result_coll_arg)
{}
int check(THD *thd);
......
......@@ -383,7 +383,7 @@ struct system_variables
my_bool new_mode;
CHARSET_INFO *client_collation;
CHARSET_INFO *literal_collation;
CHARSET_INFO *connection_collation;
CHARSET_INFO *result_collation;
};
......
......@@ -3924,7 +3924,7 @@ text_literal:
TEXT_STRING_literal
{
THD *thd= YYTHD;
$$ = new Item_string($1.str,$1.length,thd->variables.literal_collation);
$$ = new Item_string($1.str,$1.length,thd->variables.connection_collation);
}
| NCHAR_STRING
{ $$= new Item_string($1.str,$1.length,national_charset_info); }
......@@ -3936,7 +3936,7 @@ text_literal:
text_string:
TEXT_STRING_literal
{ $$= new String($1.str,$1.length,YYTHD->variables.literal_collation); }
{ $$= new String($1.str,$1.length,YYTHD->variables.connection_collation); }
| HEX_NUM
{
Item *tmp = new Item_varbinary($1.str,$1.length);
......@@ -4106,14 +4106,14 @@ TEXT_STRING_literal:
TEXT_STRING
{
THD *thd= YYTHD;
if (my_charset_same(thd->charset(),thd->variables.literal_collation))
if (my_charset_same(thd->charset(),thd->variables.connection_collation))
{
$$=$1;
}
else
{
String ident;
ident.copy($1.str,$1.length,thd->charset(),thd->variables.literal_collation);
ident.copy($1.str,$1.length,thd->charset(),thd->variables.connection_collation);
$$.str= thd->strmake(ident.ptr(),ident.length());
$$.length= ident.length();
}
......
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