summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_recoding.result24
-rw-r--r--mysql-test/t/ctype_recoding.test16
2 files changed, 36 insertions, 4 deletions
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index 646dcb76f96..571c89ef467 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -1,7 +1,8 @@
SET CHARACTER SET koi8r;
-DROP TABLE IF EXISTS таблица, t1;
+DROP TABLE IF EXISTS таблица, t1, t2;
SET CHARACTER SET koi8r;
CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'проба' AS a;
+CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -13,7 +14,26 @@ a
SELECT HEX(a) FROM t1;
HEX(a)
EFF0EEE1E0
-DROP TABLE t1;
+INSERT t2 SELECT * FROM t1;
+SELECT HEX(a) FROM t2;
+HEX(a)
+D0BFD180D0BED0B1D0B0
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'проба' AS a;
+CREATE TABLE t2 (a TEXT CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text character set cp1251
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(a) FROM t1;
+HEX(a)
+EFF0EEE1E0
+INSERT t2 SELECT * FROM t1;
+SELECT HEX(a) FROM t2;
+HEX(a)
+D0BFD180D0BED0B1D0B0
+DROP TABLE t1, t2;
CREATE TABLE `таблица`
(
поле CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "комментарий поля"
diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test
index 2f08e021df2..0b901009041 100644
--- a/mysql-test/t/ctype_recoding.test
+++ b/mysql-test/t/ctype_recoding.test
@@ -1,15 +1,27 @@
SET CHARACTER SET koi8r;
--disable_warnings
-DROP TABLE IF EXISTS таблица, t1;
+DROP TABLE IF EXISTS таблица, t1, t2;
--enable_warnings
SET CHARACTER SET koi8r;
CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'проба' AS a;
+CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8);
SHOW CREATE TABLE t1;
SELECT a FROM t1;
SELECT HEX(a) FROM t1;
-DROP TABLE t1;
+INSERT t2 SELECT * FROM t1;
+SELECT HEX(a) FROM t2;
+DROP TABLE t1, t2;
+
+# same with TEXT
+CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'проба' AS a;
+CREATE TABLE t2 (a TEXT CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+SELECT HEX(a) FROM t1;
+INSERT t2 SELECT * FROM t1;
+SELECT HEX(a) FROM t2;
+DROP TABLE t1, t2;
CREATE TABLE `таблица`
(