summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-04-08 11:33:54 +0500
committerunknown <bar@bar.mysql.r18.ru>2003-04-08 11:33:54 +0500
commitf20835c7aa678dfb043d683346bec920ce8895d9 (patch)
treefaf8fdda4e9c197a56ed3c5a0b588775c5d1c745 /sql
parent0695239a64362d6bcf753ea30439320a742ec2fe (diff)
downloadmariadb-git-f20835c7aa678dfb043d683346bec920ce8895d9.tar.gz
SET NAMES doesn't start recoding
SET CHARACTER SET does
Diffstat (limited to 'sql')
-rw-r--r--sql/set_var.cc10
-rw-r--r--sql/sql_db.cc1
-rw-r--r--sql/sql_yacc.yy2
3 files changed, 7 insertions, 6 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);
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 903fcce6350..fe8a945bff8 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -602,7 +602,6 @@ bool mysql_change_db(THD *thd, const char *name)
strmov(path+unpack_dirname(path,path), MY_DB_OPT_FILE);
load_db_opt(path, &create);
thd->db_charset= create.table_charset ? create.table_charset : default_charset_info;
- thd->variables.client_collation=thd->db_charset ? thd->db_charset : default_charset_info;
DBUG_RETURN(0);
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a8c02bf86f2..bb6e445bfc2 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4411,7 +4411,7 @@ option_value:
| NAMES_SYM charset_name_or_default opt_collate
{
LEX *lex= Lex;
- lex->var_list.push_back(new set_var_client_collation($2,$3,1));
+ lex->var_list.push_back(new set_var_client_collation($2,$3,0));
}
| PASSWORD equal text_or_password
{