summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/ctype_recoding.result8
-rw-r--r--mysql-test/t/ctype_recoding.test5
-rw-r--r--sql/set_var.cc1
3 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index 564b5f8ea8f..5a53c1db2e1 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -70,3 +70,11 @@ SHOW TABLES IN ςερς;
Tables_in_ςερς
SET CHARACTER SET koi8r;
DROP DATABASE ΤΕΣΤ;
+SET NAMES koi8r;
+SELECT hex('ΤΕΣΤ');
+hex('ΤΕΣΤ')
+D4C5D3D4
+SET character_set_connection=cp1251;
+SELECT hex('ΤΕΣΤ');
+hex('ΤΕΣΤ')
+F2E5F1F2
diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test
index bbb0d963a9d..325a8f075ed 100644
--- a/mysql-test/t/ctype_recoding.test
+++ b/mysql-test/t/ctype_recoding.test
@@ -45,3 +45,8 @@ SHOW TABLES;
SHOW TABLES IN ςερς;
SET CHARACTER SET koi8r;
DROP DATABASE ΤΕΣΤ;
+
+SET NAMES koi8r;
+SELECT hex('ΤΕΣΤ');
+SET character_set_connection=cp1251;
+SELECT hex('ΤΕΣΤ');
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 199a398b497..382d23fa6a2 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1343,6 +1343,7 @@ bool sys_var_character_set::check(THD *thd, set_var *var)
bool sys_var_character_set::update(THD *thd, set_var *var)
{
ci_ptr(thd,var->type)[0]= var->save_result.charset;
+ thd->update_charset();
return 0;
}