diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 65d6d72f25b..75876d2efad 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -505,5 +505,63 @@ Warnings: Warning 1264 Out of range value for column 'a' at row 1 DROP TABLE t1; # +# Various widths of the YEAR +# +create or replace table t1 (a YEAR(0)); +Warnings: +Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(1)); +Warnings: +Note 1287 'YEAR(1)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(3)); +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(4)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(5)); +Warnings: +Note 1287 'YEAR(5)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create or replace table t1 (a YEAR(100)); +Warnings: +Note 1287 'YEAR(100)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` year(4) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +# # End of 10.2 tests # diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index ba77f8f5a62..34c417d9026 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -265,6 +265,17 @@ SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR ALTER TABLE t1 MODIFY a YEAR; DROP TABLE t1; +--echo # +--echo # Various widths of the YEAR +--echo # +create or replace table t1 (a YEAR(0)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(1)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(2)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(3)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(4)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(5)); SHOW CREATE TABLE t1; +create or replace table t1 (a YEAR(100)); SHOW CREATE TABLE t1; +drop table t1; --echo # --echo # End of 10.2 tests