summaryrefslogtreecommitdiff
path: root/mysql-test/r/create.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/create.result')
-rw-r--r--mysql-test/r/create.result55
1 files changed, 55 insertions, 0 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index f4684c181d2..19b3adc9bf5 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1545,6 +1545,20 @@ Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 7
drop table t1,t2;
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1));
+DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE);
+DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 c1 1 c1 NULL 0 NULL NULL YES HASH
+DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 c1 1 c1 A NULL NULL NULL YES BTREE
+DROP TABLE t1;
End of 5.0 tests
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
@@ -1834,4 +1848,45 @@ DROP TABLE t3;
# -- End of Bug#18834.
+# --
+# -- Bug#34274: Invalid handling of 'DEFAULT 0' for YEAR data type.
+# --
+
+DROP TABLE IF EXISTS t1;
+
+CREATE TABLE t1(c1 YEAR DEFAULT 2008, c2 YEAR DEFAULT 0);
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` year(4) DEFAULT '2008',
+ `c2` year(4) DEFAULT '0000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+INSERT INTO t1 VALUES();
+
+SELECT * FROM t1;
+c1 c2
+2008 0000
+
+ALTER TABLE t1 MODIFY c1 YEAR DEFAULT 0;
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` year(4) DEFAULT '0000',
+ `c2` year(4) DEFAULT '0000'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+INSERT INTO t1 VALUES();
+
+SELECT * FROM t1;
+c1 c2
+2008 0000
+0000 0000
+
+DROP TABLE t1;
+
+# -- End of Bug#34274
+
End of 5.1 tests