summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-08-13 19:06:24 +0500
committerunknown <bar@mysql.com>2004-08-13 19:06:24 +0500
commit467f5956ebc178d71ed8cd1727e915ba8a047920 (patch)
treec63eb883070d6c7bab7fe9d47dc2e71bfd546aed /mysql-test
parente2cfe7b60771610aff0d287ad243249099f4f629 (diff)
downloadmariadb-git-467f5956ebc178d71ed8cd1727e915ba8a047920.tar.gz
CSC issue # 3299 fix:
ENUM and SET type didn't compute their length correctly. That showed up for example while converting into a CHAR column.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_utf8.result23
-rw-r--r--mysql-test/t/ctype_utf8.test16
2 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 55b7f5f9035..17059e6e2a9 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+drop table if exists t2;
set names utf8;
select left(_utf8 0xD0B0D0B1D0B2,1);
left(_utf8 0xD0B0D0B1D0B2,1)
@@ -246,6 +247,28 @@ select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
DROP TABLE t1;
+set names utf8;
+create table t1 (a enum('aaaa','проба') character set utf8);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` enum('aaaa','проба') character set utf8 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('проба');
+select * from t1;
+a
+проба
+create table t2 select ifnull(a,a) from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ifnull(a,a)` char(5) character set utf8 default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t2;
+ifnull(a,a)
+проба
+drop table t1;
+drop table t2;
create table t1 (c varchar(30) character set utf8, unique(c(10)));
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 82908fde75e..9a383e66603 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -4,6 +4,7 @@
--disable_warnings
drop table if exists t1;
+drop table if exists t2;
--enable_warnings
set names utf8;
@@ -172,6 +173,20 @@ CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
DROP TABLE t1;
+# Customer Support Center issue # 3299
+# ENUM and SET multibyte fields computed their length wronly
+# when converted into a char field
+set names utf8;
+create table t1 (a enum('aaaa','проба') character set utf8);
+show create table t1;
+insert into t1 values ('проба');
+select * from t1;
+create table t2 select ifnull(a,a) from t1;
+show create table t2;
+select * from t2;
+drop table t1;
+drop table t2;
+
#
# Bug 4521: unique key prefix interacts poorly with utf8
# Check keys with prefix compression
@@ -220,3 +235,4 @@ insert into t1 values ('ꪪꪪ');
--error 1062
insert into t1 values ('ꪪꪪꪪ');
drop table t1;
+