summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-04-27 21:58:10 +0400
committerAlexander Barkov <bar@mariadb.org>2017-04-27 21:58:10 +0400
commita147eea62c7ad0462f1ee85e50c7628a734c33ae (patch)
treeda5b6427e3726e2cfc35a07ffe1b54da387af5e7 /mysql-test
parent9346939545a513abee09b2c65e27737a66cb1864 (diff)
downloadmariadb-git-a147eea62c7ad0462f1ee85e50c7628a734c33ae.tar.gz
MDEV-12607 Hybrid functions create wrong VARBINARY length when mixing character and binary data
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_utf8.result16
-rw-r--r--mysql-test/t/ctype_utf8.test12
2 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 573799ff6e5..f6a88d49579 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -11184,5 +11184,21 @@ SET NAMES utf8;
CREATE TABLE t1 (a SET('a,bü'));
ERROR 22007: Illegal set 'a,bü' value found during parsing
#
+# MDEV-12607 Hybrid functions create wrong VARBINARY length when mixing character and binary data
+#
+SET sql_mode='';
+SET NAMES utf8;
+CREATE OR REPLACE TABLE t1 AS SELECT COALESCE('ßa',_binary 'a');
+SELECT * FROM t1;
+COALESCE('ßa',_binary 'a')
+ßa
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `COALESCE('ßa',_binary 'a')` varbinary(6) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
# End of 10.3 tests
#
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 5e747bc4b3c..b191b27d367 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -2110,5 +2110,17 @@ SET NAMES utf8;
CREATE TABLE t1 (a SET('a,bü'));
--echo #
+--echo # MDEV-12607 Hybrid functions create wrong VARBINARY length when mixing character and binary data
+--echo #
+SET sql_mode='';
+SET NAMES utf8;
+CREATE OR REPLACE TABLE t1 AS SELECT COALESCE('ßa',_binary 'a');
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+
+--echo #
--echo # End of 10.3 tests
--echo #