summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authortsmith@maint1.mysql.com <>2007-07-04 21:22:35 +0200
committertsmith@maint1.mysql.com <>2007-07-04 21:22:35 +0200
commit8c8883aeb6b50cd859d6cd5cd1e41509751792a9 (patch)
treeb9486f8c30ebfa7de4e0cb336600162a6e18c593 /mysql-test
parent2bfa624a52e7d03beff6c2f88425928acd66e420 (diff)
parentf8bf427ba41df2aa4b19667e7b8c2d64a85b6074 (diff)
downloadmariadb-git-8c8883aeb6b50cd859d6cd5cd1e41509751792a9.tar.gz
Merge maint1.mysql.com:/data/localhome/tsmith/bk/41
into maint1.mysql.com:/data/localhome/tsmith/bk/maint/41
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_enum.result23
-rw-r--r--mysql-test/t/type_enum.test17
2 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index b5ec72ffe5a..415c391ebb8 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1778,4 +1778,27 @@ drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
ERROR 42000: Field separator argument is not what is expected; check the manual
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 ENUM('a', '', 'b')
+);
+INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+SELECT id, c1 + 0, c1 FROM t1;
+id c1 + 0 c1
+1 0
+2 1 a
+3 2
+4 3 b
+ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 4
+SELECT id, c1 + 0, c1 FROM t1;
+id c1 + 0 c1
+1 0
+2 1 a
+3 2
+4 0
+DROP TABLE t1;
End of 4.1 tests
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 4b3429d9ea0..765c3b6d7cc 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -156,4 +156,21 @@ drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
 !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
+#
+# Bug #29251: MySQL coerces special 0 enum values to normal '' value
+# when ALTERing the column
+#
+
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 ENUM('a', '', 'b')
+);
+INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b');
+SELECT id, c1 + 0, c1 FROM t1;
+
+ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL;
+SELECT id, c1 + 0, c1 FROM t1;
+
+DROP TABLE t1;
+
--echo End of 4.1 tests