summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-06-23 14:41:51 +0200
committerSergei Golubchik <serg@mariadb.org>2016-07-12 22:18:33 +0200
commitef125e232d1f1700210977c8a774adb3698a857a (patch)
tree94fbc4050d352c02e158d1195c84046eadca7a3f
parent3e8ae6ef4f08937332e6ad317f37a9c0c9a717d3 (diff)
downloadmariadb-git-ef125e232d1f1700210977c8a774adb3698a857a.tar.gz
add a test case vcol.charsets
a test case for a broken vcols behavior with different charsets. this is fixed in 10.2
-rw-r--r--mysql-test/suite/vcol/r/charsets.result31
-rw-r--r--mysql-test/suite/vcol/t/charsets.test24
2 files changed, 55 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/charsets.result b/mysql-test/suite/vcol/r/charsets.result
new file mode 100644
index 00000000000..d06edc544d9
--- /dev/null
+++ b/mysql-test/suite/vcol/r/charsets.result
@@ -0,0 +1,31 @@
+set names utf8;
+create table t1 (
+a int,
+b varchar(100) as (if(a,collation('й'),hex('ю')))
+) character set koi8r;
+insert t1 (a) values (0),(1);
+select * from t1;
+a b
+0 D18E
+1 utf8_general_ci
+set names latin1;
+select * from t1;
+a b
+0 D18E
+1 utf8_general_ci
+flush tables;
+select * from t1;
+a b
+0 D18E
+1 latin1_swedish_ci
+set names koi8r;
+select * from t1;
+a b
+0 D18E
+1 latin1_swedish_ci
+flush tables;
+select * from t1;
+a b
+0 D18E
+1 koi8r_general_ci
+drop table t1;
diff --git a/mysql-test/suite/vcol/t/charsets.test b/mysql-test/suite/vcol/t/charsets.test
new file mode 100644
index 00000000000..32fb9a7741c
--- /dev/null
+++ b/mysql-test/suite/vcol/t/charsets.test
@@ -0,0 +1,24 @@
+#
+# This shows a bug in vcol charset handling.
+# vcol definition is stored in the connection charset when a table was created
+# vcol is parsed in the connection charset when a table was opened
+#
+# this cannot be fixed without changing frm format, so we only
+# fix it in 10.2.
+#
+set names utf8;
+create table t1 (
+ a int,
+ b varchar(100) as (if(a,collation('й'),hex('ю')))
+) character set koi8r;
+insert t1 (a) values (0),(1);
+select * from t1;
+set names latin1;
+select * from t1;
+flush tables;
+select * from t1;
+set names koi8r;
+select * from t1;
+flush tables;
+select * from t1;
+drop table t1;