summaryrefslogtreecommitdiff
path: root/mysql-test/r/ctype_utf16le.result
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-10-25 15:01:03 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-10-25 15:01:03 +0400
commit71f8ca654eceea835d6330eb511ce41643dfaeb5 (patch)
tree2e87ceb27347664cd9317b7ba24a6cbc0f47749a /mysql-test/r/ctype_utf16le.result
parenta6e28ce5e6a1cb2c5e4eaf9e900e7d6339094a75 (diff)
downloadmariadb-git-71f8ca654eceea835d6330eb511ce41643dfaeb5.tar.gz
MDEV-5180 Data type for WEIGHT_STRING is too short in some cases
(a bug in upstream)
Diffstat (limited to 'mysql-test/r/ctype_utf16le.result')
-rw-r--r--mysql-test/r/ctype_utf16le.result132
1 files changed, 132 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_utf16le.result b/mysql-test/r/ctype_utf16le.result
index a8407001ce2..a2ac921af0c 100644
--- a/mysql-test/r/ctype_utf16le.result
+++ b/mysql-test/r/ctype_utf16le.result
@@ -1578,6 +1578,72 @@ SET NAMES utf8, collation_connection=utf16le_general_ci;
select @@collation_connection;
@@collation_connection
utf16le_general_ci
+CREATE TABLE t1 AS SELECT 'a' AS a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(1) CHARACTER SET utf16le NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ws` varbinary(2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(WEIGHT_STRING(a)) FROM t1;
+HEX(WEIGHT_STRING(a))
+0041
+SELECT HEX(ws) FROM t2;
+HEX(ws)
+0041
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(5) CHARACTER SET utf16le NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ws` varbinary(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(WEIGHT_STRING(a)) FROM t1;
+HEX(WEIGHT_STRING(a))
+00410041004100410041
+SELECT HEX(ws) FROM t2;
+HEX(ws)
+00410041004100410041
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ws` varbinary(6) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
+HEX(WEIGHT_STRING(a AS CHAR(3)))
+004100410041
+SELECT HEX(ws) FROM t2;
+HEX(ws)
+004100410041
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ws` varbinary(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
+HEX(WEIGHT_STRING(a AS CHAR(10)))
+0041004100410041004100200020002000200020
+SELECT HEX(ws) FROM t2;
+HEX(ws)
+0041004100410041004100200020002000200020
+DROP TABLE t2;
+DROP TABLE t1;
select hex(weight_string('a'));
hex(weight_string('a'))
0041
@@ -1762,6 +1828,72 @@ SET NAMES utf8, collation_connection=utf16le_bin;
select @@collation_connection;
@@collation_connection
utf16le_bin
+CREATE TABLE t1 AS SELECT 'a' AS a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(1) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ws` varbinary(3) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(WEIGHT_STRING(a)) FROM t1;
+HEX(WEIGHT_STRING(a))
+000061
+SELECT HEX(ws) FROM t2;
+HEX(ws)
+000061
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(5) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ws` varbinary(15) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(WEIGHT_STRING(a)) FROM t1;
+HEX(WEIGHT_STRING(a))
+000061000061000061000061000061
+SELECT HEX(ws) FROM t2;
+HEX(ws)
+000061000061000061000061000061
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ws` varbinary(9) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
+HEX(WEIGHT_STRING(a AS CHAR(3)))
+000061000061000061
+SELECT HEX(ws) FROM t2;
+HEX(ws)
+000061000061000061
+DROP TABLE t2;
+CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ws` varbinary(30) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
+HEX(WEIGHT_STRING(a AS CHAR(10)))
+000061000061000061000061000061000020000020000020000020000020
+SELECT HEX(ws) FROM t2;
+HEX(ws)
+000061000061000061000061000061000020000020000020000020000020
+DROP TABLE t2;
+DROP TABLE t1;
select hex(weight_string('a'));
hex(weight_string('a'))
000061