summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorbar@bar.mysql.r18.ru <>2003-04-08 11:33:54 +0500
committerbar@bar.mysql.r18.ru <>2003-04-08 11:33:54 +0500
commit2cdc21d24aee9bf895b95d71a060ea128bb731d7 (patch)
treefaf8fdda4e9c197a56ed3c5a0b588775c5d1c745 /sql/set_var.cc
parent06febc8df3d956d7eaa9f2e82835a7d9087ce853 (diff)
downloadmariadb-git-2cdc21d24aee9bf895b95d71a060ea128bb731d7.tar.gz
SET NAMES doesn't start recoding
SET CHARACTER SET does
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index ddebf47a25d..b5094e6403a 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1237,7 +1237,7 @@ void sys_var_client_collation::set_default(THD *thd, enum_var_type type)
global_system_variables.client_collation= default_charset_info;
else
{
- thd->variables.client_collation= thd->db_charset;
+ thd->variables.client_collation= global_system_variables.client_collation;
}
}
@@ -1264,7 +1264,7 @@ void sys_var_literal_collation::set_default(THD *thd, enum_var_type type)
if (type == OPT_GLOBAL)
global_system_variables.literal_collation= default_charset_info;
else
- thd->variables.literal_collation= thd->db_charset;
+ thd->variables.literal_collation= global_system_variables.literal_collation;
}
@@ -1274,7 +1274,8 @@ void sys_var_literal_collation::set_default(THD *thd, enum_var_type type)
int set_var_client_collation::check(THD *thd)
{
- client_charset= client_charset ? client_charset : thd->db_charset;
+ client_charset= client_charset ?
+ client_charset : global_system_variables.client_collation;
client_collation= client_collation ? client_collation : client_charset;
if (!my_charset_same(client_charset, client_collation))
{
@@ -1288,7 +1289,8 @@ 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= client_collation;
+ thd->variables.literal_collation= convert_result_charset ?
+ thd->db_charset: client_collation;
thd->variables.convert_result_charset= convert_result_charset;
thd->protocol_simple.init(thd);
thd->protocol_prep.init(thd);