diff options
author | Daniel Black <daniel@mariadb.org> | 2021-05-14 04:39:53 +1000 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2021-05-15 11:38:48 +1000 |
commit | 66677842d1257271ef096e3293cd3ac0f965d6b2 (patch) | |
tree | 949f3599c8d1ee4a4f424bc6e2840a26498042aa | |
parent | 79940208253a49da0f1a4e00b2853553283b90d9 (diff) | |
download | mariadb-git-bb-10.6-danielblack-MDEV-14096-deprecate-year-parentheses.tar.gz |
MDEV-14096: YEAR(X) treat as YEAR(4)bb-10.6-danielblack-MDEV-14096-deprecate-year-parentheses
33 files changed, 480 insertions, 565 deletions
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index 889c80cc477..0cb3e2fed70 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -1145,13 +1145,6 @@ insert into t1 values (1.1), (10.1), (100.1), (1000.1), (10000.1); select hex(concat(a)), a from t1; drop table t1; -create table t1 (a year(2)); -insert into t1 values (1); -select hex(concat(a)) from t1; -create table t2 as select concat(a) from t1; -show create table t2; -drop table t1, t2; - create table t1 (a year); insert into t1 values (1); select hex(concat(a)) from t1; diff --git a/mysql-test/main/ctype_binary.result b/mysql-test/main/ctype_binary.result index dd4b6a40d61..287e2fd2933 100644 --- a/mysql-test/main/ctype_binary.result +++ b/mysql-test/main/ctype_binary.result @@ -2038,20 +2038,6 @@ hex(concat(a)) a 30303030303030303030303030303030313030302E31 00000000000000001000.1 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; -create table t1 (a year(2)); -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead -insert into t1 values (1); -select hex(concat(a)) from t1; -hex(concat(a)) -3031 -create table t2 as select concat(a) from t1; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `concat(a)` varbinary(2) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1, t2; create table t1 (a year); insert into t1 values (1); select hex(concat(a)) from t1; @@ -2360,10 +2346,10 @@ insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; Field Type Null Key Default Extra -a varbinary(2) YES NULL +a varbinary(4) YES NULL select hex(a) from v1; hex(a) -3031 +32303031 drop table t1; drop view v1; create table t1 (a year); diff --git a/mysql-test/main/ctype_cp1251.result b/mysql-test/main/ctype_cp1251.result index a62f9005424..b6b04f172a6 100644 --- a/mysql-test/main/ctype_cp1251.result +++ b/mysql-test/main/ctype_cp1251.result @@ -2450,20 +2450,6 @@ hex(concat(a)) a 30303030303030303030303030303030313030302E31 00000000000000001000.1 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; -create table t1 (a year(2)); -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead -insert into t1 values (1); -select hex(concat(a)) from t1; -hex(concat(a)) -3031 -create table t2 as select concat(a) from t1; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `concat(a)` varchar(2) CHARACTER SET cp1251 DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1, t2; create table t1 (a year); insert into t1 values (1); select hex(concat(a)) from t1; @@ -2772,10 +2758,10 @@ insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; Field Type Null Key Default Extra -a varchar(2) YES NULL +a varchar(4) YES NULL select hex(a) from v1; hex(a) -3031 +32303031 drop table t1; drop view v1; create table t1 (a year); diff --git a/mysql-test/main/ctype_latin1.result b/mysql-test/main/ctype_latin1.result index 96008ef77cd..a2f826f5160 100644 --- a/mysql-test/main/ctype_latin1.result +++ b/mysql-test/main/ctype_latin1.result @@ -2759,20 +2759,6 @@ hex(concat(a)) a 30303030303030303030303030303030313030302E31 00000000000000001000.1 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; -create table t1 (a year(2)); -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead -insert into t1 values (1); -select hex(concat(a)) from t1; -hex(concat(a)) -3031 -create table t2 as select concat(a) from t1; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `concat(a)` varchar(2) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1, t2; create table t1 (a year); insert into t1 values (1); select hex(concat(a)) from t1; @@ -3081,10 +3067,10 @@ insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; Field Type Null Key Default Extra -a varchar(2) YES NULL +a varchar(4) YES NULL select hex(a) from v1; hex(a) -3031 +32303031 drop table t1; drop view v1; create table t1 (a year); diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result index 9e9e33354ff..ba480b638b6 100644 --- a/mysql-test/main/ctype_ucs.result +++ b/mysql-test/main/ctype_ucs.result @@ -3643,20 +3643,6 @@ hex(concat(a)) a 00300030003000300030003000300030003000300030003000300030003000300031003000300030002E0031 00000000000000001000.1 00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 00000000000000010000.1 drop table t1; -create table t1 (a year(2)); -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead -insert into t1 values (1); -select hex(concat(a)) from t1; -hex(concat(a)) -00300031 -create table t2 as select concat(a) from t1; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `concat(a)` varchar(2) CHARACTER SET ucs2 DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1, t2; create table t1 (a year); insert into t1 values (1); select hex(concat(a)) from t1; @@ -3965,10 +3951,10 @@ insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; Field Type Null Key Default Extra -a varchar(2) YES NULL +a varchar(4) YES NULL select hex(a) from v1; hex(a) -00300031 +0032003000300031 drop table t1; drop view v1; create table t1 (a year); diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result index 0539467afdd..1e1369b51ca 100644 --- a/mysql-test/main/ctype_utf8.result +++ b/mysql-test/main/ctype_utf8.result @@ -4510,20 +4510,6 @@ hex(concat(a)) a 30303030303030303030303030303030313030302E31 00000000000000001000.1 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; -create table t1 (a year(2)); -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead -insert into t1 values (1); -select hex(concat(a)) from t1; -hex(concat(a)) -3031 -create table t2 as select concat(a) from t1; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `concat(a)` varchar(2) CHARACTER SET utf8 DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t1, t2; create table t1 (a year); insert into t1 values (1); select hex(concat(a)) from t1; @@ -4832,10 +4818,10 @@ insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; Field Type Null Key Default Extra -a varchar(2) YES NULL +a varchar(4) YES NULL select hex(a) from v1; hex(a) -3031 +32303031 drop table t1; drop view v1; create table t1 (a year); diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result index c830f8e2082..4a79b02ec16 100644 --- a/mysql-test/main/func_group.result +++ b/mysql-test/main/func_group.result @@ -1550,7 +1550,7 @@ insert into t1 values (71,1971,19710101,"1971-11-11 22:22:22"); select min(f1),max(f1) from t1; min(f1) max(f1) -70 60 +0 2060 select min(f2),max(f2) from t1; min(f2) max(f2) 1970 2060 @@ -1564,223 +1564,223 @@ select a.f1 as a, b.f1 as b, a.f1 > b.f1 as gt, a.f1 < b.f1 as lt, a.f1<=>b.f1 as eq from t1 a, t1 b; a b gt lt eq -98 98 0 0 1 -00 98 1 0 0 -02 98 1 0 0 -60 98 1 0 0 -70 98 0 1 0 -NULL 98 NULL NULL 0 -71 98 0 1 0 -98 00 0 1 0 -00 00 0 0 1 -02 00 1 0 0 -60 00 1 0 0 -70 00 0 1 0 -NULL 00 NULL NULL 0 -71 00 0 1 0 -98 02 0 1 0 -00 02 0 1 0 -02 02 0 0 1 -60 02 1 0 0 -70 02 0 1 0 -NULL 02 NULL NULL 0 -71 02 0 1 0 -98 60 0 1 0 -00 60 0 1 0 -02 60 0 1 0 -60 60 0 0 1 -70 60 0 1 0 -NULL 60 NULL NULL 0 -71 60 0 1 0 -98 70 1 0 0 -00 70 1 0 0 -02 70 1 0 0 -60 70 1 0 0 -70 70 0 0 1 -NULL 70 NULL NULL 0 -71 70 1 0 0 -98 NULL NULL NULL 0 -00 NULL NULL NULL 0 -02 NULL NULL NULL 0 -60 NULL NULL NULL 0 -70 NULL NULL NULL 0 +1998 1998 0 0 1 +0000 1998 0 1 0 +2002 1998 1 0 0 +2060 1998 1 0 0 +1970 1998 0 1 0 +NULL 1998 NULL NULL 0 +1971 1998 0 1 0 +1998 0000 1 0 0 +0000 0000 0 0 1 +2002 0000 1 0 0 +2060 0000 1 0 0 +1970 0000 1 0 0 +NULL 0000 NULL NULL 0 +1971 0000 1 0 0 +1998 2002 0 1 0 +0000 2002 0 1 0 +2002 2002 0 0 1 +2060 2002 1 0 0 +1970 2002 0 1 0 +NULL 2002 NULL NULL 0 +1971 2002 0 1 0 +1998 2060 0 1 0 +0000 2060 0 1 0 +2002 2060 0 1 0 +2060 2060 0 0 1 +1970 2060 0 1 0 +NULL 2060 NULL NULL 0 +1971 2060 0 1 0 +1998 1970 1 0 0 +0000 1970 0 1 0 +2002 1970 1 0 0 +2060 1970 1 0 0 +1970 1970 0 0 1 +NULL 1970 NULL NULL 0 +1971 1970 1 0 0 +1998 NULL NULL NULL 0 +0000 NULL NULL NULL 0 +2002 NULL NULL NULL 0 +2060 NULL NULL NULL 0 +1970 NULL NULL NULL 0 NULL NULL NULL NULL 1 -71 NULL NULL NULL 0 -98 71 1 0 0 -00 71 1 0 0 -02 71 1 0 0 -60 71 1 0 0 -70 71 0 1 0 -NULL 71 NULL NULL 0 -71 71 0 0 1 +1971 NULL NULL NULL 0 +1998 1971 1 0 0 +0000 1971 0 1 0 +2002 1971 1 0 0 +2060 1971 1 0 0 +1970 1971 0 1 0 +NULL 1971 NULL NULL 0 +1971 1971 0 0 1 select a.f1 as a, b.f2 as b, a.f1 > b.f2 as gt, a.f1 < b.f2 as lt, a.f1<=>b.f2 as eq from t1 a, t1 b; a b gt lt eq -98 1998 0 0 1 -00 1998 1 0 0 -02 1998 1 0 0 -60 1998 1 0 0 -70 1998 0 1 0 +1998 1998 0 0 1 +0000 1998 0 1 0 +2002 1998 1 0 0 +2060 1998 1 0 0 +1970 1998 0 1 0 NULL 1998 NULL NULL 0 -71 1998 0 1 0 -98 2000 0 1 0 -00 2000 0 0 1 -02 2000 1 0 0 -60 2000 1 0 0 -70 2000 0 1 0 +1971 1998 0 1 0 +1998 2000 0 1 0 +0000 2000 0 1 0 +2002 2000 1 0 0 +2060 2000 1 0 0 +1970 2000 0 1 0 NULL 2000 NULL NULL 0 -71 2000 0 1 0 -98 2002 0 1 0 -00 2002 0 1 0 -02 2002 0 0 1 -60 2002 1 0 0 -70 2002 0 1 0 +1971 2000 0 1 0 +1998 2002 0 1 0 +0000 2002 0 1 0 +2002 2002 0 0 1 +2060 2002 1 0 0 +1970 2002 0 1 0 NULL 2002 NULL NULL 0 -71 2002 0 1 0 -98 2060 0 1 0 -00 2060 0 1 0 -02 2060 0 1 0 -60 2060 0 0 1 -70 2060 0 1 0 +1971 2002 0 1 0 +1998 2060 0 1 0 +0000 2060 0 1 0 +2002 2060 0 1 0 +2060 2060 0 0 1 +1970 2060 0 1 0 NULL 2060 NULL NULL 0 -71 2060 0 1 0 -98 1970 1 0 0 -00 1970 1 0 0 -02 1970 1 0 0 -60 1970 1 0 0 -70 1970 0 0 1 +1971 2060 0 1 0 +1998 1970 1 0 0 +0000 1970 0 1 0 +2002 1970 1 0 0 +2060 1970 1 0 0 +1970 1970 0 0 1 NULL 1970 NULL NULL 0 -71 1970 1 0 0 -98 NULL NULL NULL 0 -00 NULL NULL NULL 0 -02 NULL NULL NULL 0 -60 NULL NULL NULL 0 -70 NULL NULL NULL 0 +1971 1970 1 0 0 +1998 NULL NULL NULL 0 +0000 NULL NULL NULL 0 +2002 NULL NULL NULL 0 +2060 NULL NULL NULL 0 +1970 NULL NULL NULL 0 NULL NULL NULL NULL 1 -71 NULL NULL NULL 0 -98 1971 1 0 0 -00 1971 1 0 0 -02 1971 1 0 0 -60 1971 1 0 0 -70 1971 0 1 0 +1971 NULL NULL NULL 0 +1998 1971 1 0 0 +0000 1971 0 1 0 +2002 1971 1 0 0 +2060 1971 1 0 0 +1970 1971 0 1 0 NULL 1971 NULL NULL 0 -71 1971 0 0 1 +1971 1971 0 0 1 select a.f1 as a, b.f3 as b, a.f1 > b.f3 as gt, a.f1 < b.f3 as lt, a.f1<=>b.f3 as eq from t1 a, t1 b; a b gt lt eq -98 1998-01-01 0 1 0 -00 1998-01-01 1 0 0 -02 1998-01-01 1 0 0 -60 1998-01-01 1 0 0 -70 1998-01-01 0 1 0 +1998 1998-01-01 0 1 0 +0000 1998-01-01 0 1 0 +2002 1998-01-01 1 0 0 +2060 1998-01-01 1 0 0 +1970 1998-01-01 0 1 0 NULL 1998-01-01 NULL NULL 0 -71 1998-01-01 0 1 0 -98 2000-01-01 0 1 0 -00 2000-01-01 0 1 0 -02 2000-01-01 1 0 0 -60 2000-01-01 1 0 0 -70 2000-01-01 0 1 0 +1971 1998-01-01 0 1 0 +1998 2000-01-01 0 1 0 +0000 2000-01-01 0 1 0 +2002 2000-01-01 1 0 0 +2060 2000-01-01 1 0 0 +1970 2000-01-01 0 1 0 NULL 2000-01-01 NULL NULL 0 -71 2000-01-01 0 1 0 -98 2002-01-01 0 1 0 -00 2002-01-01 0 1 0 -02 2002-01-01 0 1 0 -60 2002-01-01 1 0 0 -70 2002-01-01 0 1 0 +1971 2000-01-01 0 1 0 +1998 2002-01-01 0 1 0 +0000 2002-01-01 0 1 0 +2002 2002-01-01 0 1 0 +2060 2002-01-01 1 0 0 +1970 2002-01-01 0 1 0 NULL 2002-01-01 NULL NULL 0 -71 2002-01-01 0 1 0 -98 2060-01-01 0 1 0 -00 2060-01-01 0 1 0 -02 2060-01-01 0 1 0 -60 2060-01-01 0 1 0 -70 2060-01-01 0 1 0 +1971 2002-01-01 0 1 0 +1998 2060-01-01 0 1 0 +0000 2060-01-01 0 1 0 +2002 2060-01-01 0 1 0 +2060 2060-01-01 0 1 0 +1970 2060-01-01 0 1 0 NULL 2060-01-01 NULL NULL 0 -71 2060-01-01 0 1 0 -98 1970-01-01 1 0 0 -00 1970-01-01 1 0 0 -02 1970-01-01 1 0 0 -60 1970-01-01 1 0 0 -70 1970-01-01 0 1 0 +1971 2060-01-01 0 1 0 +1998 1970-01-01 1 0 0 +0000 1970-01-01 0 1 0 +2002 1970-01-01 1 0 0 +2060 1970-01-01 1 0 0 +1970 1970-01-01 0 1 0 NULL 1970-01-01 NULL NULL 0 -71 1970-01-01 1 0 0 -98 NULL NULL NULL 0 -00 NULL NULL NULL 0 -02 NULL NULL NULL 0 -60 NULL NULL NULL 0 -70 NULL NULL NULL 0 +1971 1970-01-01 1 0 0 +1998 NULL NULL NULL 0 +0000 NULL NULL NULL 0 +2002 NULL NULL NULL 0 +2060 NULL NULL NULL 0 +1970 NULL NULL NULL 0 NULL NULL NULL NULL 1 -71 NULL NULL NULL 0 -98 1971-01-01 1 0 0 -00 1971-01-01 1 0 0 -02 1971-01-01 1 0 0 -60 1971-01-01 1 0 0 -70 1971-01-01 0 1 0 +1971 NULL NULL NULL 0 +1998 1971-01-01 1 0 0 +0000 1971-01-01 0 1 0 +2002 1971-01-01 1 0 0 +2060 1971-01-01 1 0 0 +1970 1971-01-01 0 1 0 NULL 1971-01-01 NULL NULL 0 -71 1971-01-01 0 1 0 +1971 1971-01-01 0 1 0 select a.f1 as a, b.f4 as b, a.f1 > b.f4 as gt, a.f1 < b.f4 as lt, a.f1<=>b.f4 as eq from t1 a, t1 b; a b gt lt eq -98 1998-01-01 00:00:00 0 1 0 -00 1998-01-01 00:00:00 1 0 0 -02 1998-01-01 00:00:00 1 0 0 -60 1998-01-01 00:00:00 1 0 0 -70 1998-01-01 00:00:00 0 1 0 +1998 1998-01-01 00:00:00 0 1 0 +0000 1998-01-01 00:00:00 0 1 0 +2002 1998-01-01 00:00:00 1 0 0 +2060 1998-01-01 00:00:00 1 0 0 +1970 1998-01-01 00:00:00 0 1 0 NULL 1998-01-01 00:00:00 NULL NULL 0 -71 1998-01-01 00:00:00 0 1 0 -98 2000-01-01 00:00:01 0 1 0 -00 2000-01-01 00:00:01 0 1 0 -02 2000-01-01 00:00:01 1 0 0 -60 2000-01-01 00:00:01 1 0 0 -70 2000-01-01 00:00:01 0 1 0 +1971 1998-01-01 00:00:00 0 1 0 +1998 2000-01-01 00:00:01 0 1 0 +0000 2000-01-01 00:00:01 0 1 0 +2002 2000-01-01 00:00:01 1 0 0 +2060 2000-01-01 00:00:01 1 0 0 +1970 2000-01-01 00:00:01 0 1 0 NULL 2000-01-01 00:00:01 NULL NULL 0 -71 2000-01-01 00:00:01 0 1 0 -98 2002-01-01 23:59:59 0 1 0 -00 2002-01-01 23:59:59 0 1 0 -02 2002-01-01 23:59:59 0 1 0 -60 2002-01-01 23:59:59 1 0 0 -70 2002-01-01 23:59:59 0 1 0 +1971 2000-01-01 00:00:01 0 1 0 +1998 2002-01-01 23:59:59 0 1 0 +0000 2002-01-01 23:59:59 0 1 0 +2002 2002-01-01 23:59:59 0 1 0 +2060 2002-01-01 23:59:59 1 0 0 +1970 2002-01-01 23:59:59 0 1 0 NULL 2002-01-01 23:59:59 NULL NULL 0 -71 2002-01-01 23:59:59 0 1 0 -98 2060-01-01 11:11:11 0 1 0 -00 2060-01-01 11:11:11 0 1 0 -02 2060-01-01 11:11:11 0 1 0 -60 2060-01-01 11:11:11 0 1 0 -70 2060-01-01 11:11:11 0 1 0 +1971 2002-01-01 23:59:59 0 1 0 +1998 2060-01-01 11:11:11 0 1 0 +0000 2060-01-01 11:11:11 0 1 0 +2002 2060-01-01 11:11:11 0 1 0 +2060 2060-01-01 11:11:11 0 1 0 +1970 2060-01-01 11:11:11 0 1 0 NULL 2060-01-01 11:11:11 NULL NULL 0 -71 2060-01-01 11:11:11 0 1 0 -98 1970-11-11 22:22:22 1 0 0 -00 1970-11-11 22:22:22 1 0 0 -02 1970-11-11 22:22:22 1 0 0 -60 1970-11-11 22:22:22 1 0 0 -70 1970-11-11 22:22:22 0 1 0 +1971 2060-01-01 11:11:11 0 1 0 +1998 1970-11-11 22:22:22 1 0 0 +0000 1970-11-11 22:22:22 0 1 0 +2002 1970-11-11 22:22:22 1 0 0 +2060 1970-11-11 22:22:22 1 0 0 +1970 1970-11-11 22:22:22 0 1 0 NULL 1970-11-11 22:22:22 NULL NULL 0 -71 1970-11-11 22:22:22 1 0 0 -98 NULL NULL NULL 0 -00 NULL NULL NULL 0 -02 NULL NULL NULL 0 -60 NULL NULL NULL 0 -70 NULL NULL NULL 0 +1971 1970-11-11 22:22:22 1 0 0 +1998 NULL NULL NULL 0 +0000 NULL NULL NULL 0 +2002 NULL NULL NULL 0 +2060 NULL NULL NULL 0 +1970 NULL NULL NULL 0 NULL NULL NULL NULL 1 -71 NULL NULL NULL 0 -98 1971-11-11 22:22:22 1 0 0 -00 1971-11-11 22:22:22 1 0 0 -02 1971-11-11 22:22:22 1 0 0 -60 1971-11-11 22:22:22 1 0 0 -70 1971-11-11 22:22:22 0 1 0 +1971 NULL NULL NULL 0 +1998 1971-11-11 22:22:22 1 0 0 +0000 1971-11-11 22:22:22 0 1 0 +2002 1971-11-11 22:22:22 1 0 0 +2060 1971-11-11 22:22:22 1 0 0 +1970 1971-11-11 22:22:22 0 1 0 NULL 1971-11-11 22:22:22 NULL NULL 0 -71 1971-11-11 22:22:22 0 1 0 +1971 1971-11-11 22:22:22 0 1 0 select *, f1 = f2 from t1; f1 f2 f3 f4 f1 = f2 -98 1998 1998-01-01 1998-01-01 00:00:00 1 -00 2000 2000-01-01 2000-01-01 00:00:01 1 -02 2002 2002-01-01 2002-01-01 23:59:59 1 -60 2060 2060-01-01 2060-01-01 11:11:11 1 -70 1970 1970-01-01 1970-11-11 22:22:22 1 +1998 1998 1998-01-01 1998-01-01 00:00:00 1 +0000 2000 2000-01-01 2000-01-01 00:00:01 0 +2002 2002 2002-01-01 2002-01-01 23:59:59 1 +2060 2060 2060-01-01 2060-01-01 11:11:11 1 +1970 1970 1970-01-01 1970-11-11 22:22:22 1 NULL NULL NULL NULL NULL -71 1971 1971-01-01 1971-11-11 22:22:22 1 +1971 1971 1971-01-01 1971-11-11 22:22:22 1 drop table t1; # # Bug #54465: assert: field_types == 0 || field_types[field_pos] == diff --git a/mysql-test/main/null.result b/mysql-test/main/null.result index 36b0dcb705a..1292bef0ade 100644 --- a/mysql-test/main/null.result +++ b/mysql-test/main/null.result @@ -414,10 +414,10 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas INSERT INTO t1 VALUES (0); SELECT a,NULLIF(a,2000),NULLIF(2000,a) FROM t1; a NULLIF(a,2000) NULLIF(2000,a) -00 NULL NULL +0000 0 2000 SELECT a,NULLIF(a,2001),NULLIF(2001,a) FROM t1; a NULLIF(a,2001) NULLIF(2001,a) -00 0 2001 +0000 0 2001 DROP TABLE t1; # # MDEV-7005 NULLIF does not work as documented diff --git a/mysql-test/main/partition_exchange.result b/mysql-test/main/partition_exchange.result index 8704fd523ab..e042d1c3491 100644 --- a/mysql-test/main/partition_exchange.result +++ b/mysql-test/main/partition_exchange.result @@ -15,16 +15,12 @@ PARTITIONS 2; Warnings: Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead CREATE TABLE t2 LIKE t1; -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead ALTER TABLE t2 REMOVE PARTITIONING; -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead SHOW CREATE TABLE t1; Table t1 Create Table CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT @@ -34,7 +30,7 @@ SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT @@ -53,15 +49,11 @@ ENGINE InnoDB ROW_FORMAT Compact CREATE_OPTIONS row_format=COMPACT ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2; -Warnings: -Level Note -Code 1287 -Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead SHOW CREATE TABLE t1; Table t1 Create Table CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT @@ -71,7 +63,7 @@ SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT @@ -102,15 +94,11 @@ Level Note Code 1287 Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2; -Warnings: -Level Note -Code 1287 -Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead SHOW CREATE TABLE t1; Table t1 Create Table CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT @@ -120,7 +108,7 @@ SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -163,15 +151,11 @@ Level Note Code 1287 Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2; -Warnings: -Level Note -Code 1287 -Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead SHOW CREATE TABLE t1; Table t1 Create Table CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -181,7 +165,7 @@ SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT @@ -224,15 +208,11 @@ Level Note Code 1287 Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2; -Warnings: -Level Note -Code 1287 -Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead SHOW CREATE TABLE t1; Table t1 Create Table CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -242,7 +222,7 @@ SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -285,15 +265,11 @@ Level Note Code 1287 Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2; -Warnings: -Level Note -Code 1287 -Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead SHOW CREATE TABLE t1; Table t1 Create Table CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT @@ -303,7 +279,7 @@ SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT @@ -351,7 +327,7 @@ SHOW CREATE TABLE t1; Table t1 Create Table CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -361,7 +337,7 @@ SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT @@ -409,7 +385,7 @@ SHOW CREATE TABLE t1; Table t1 Create Table CREATE TABLE `t1` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT @@ -419,7 +395,7 @@ SHOW CREATE TABLE t2; Table t2 Create Table CREATE TABLE `t2` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `year` year(2) DEFAULT NULL, + `year` year DEFAULT NULL, `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT diff --git a/mysql-test/main/type_year.result b/mysql-test/main/type_year.result index 77b213cd11c..99f85ec83ce 100644 --- a/mysql-test/main/type_year.result +++ b/mysql-test/main/type_year.result @@ -4,28 +4,28 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); select * from t1; y y2 -0000 00 -1999 99 -2000 00 -2001 01 -1970 70 -2069 69 +0000 0000 +1999 1999 +2000 2000 +2001 2001 +1970 1970 +2069 2069 select * from t1 order by y; y y2 -0000 00 -1970 70 -1999 99 -2000 00 -2001 01 -2069 69 +0000 0000 +1970 1970 +1999 1999 +2000 2000 +2001 2001 +2069 2069 select * from t1 order by y2; y y2 -1970 70 -1999 99 -0000 00 -2000 00 -2001 01 -2069 69 +0000 0000 +1970 1970 +1999 1999 +2000 2000 +2001 2001 +2069 2069 drop table t1; # # Bug 2335 @@ -71,11 +71,11 @@ UPDATE t4 SET yyyy = c4; SELECT * FROM t2; yy c2 NULL NULL -70 1970 -99 1999 -00 2000 -01 2001 -69 2069 +1970 1970 +1999 1999 +2000 2000 +2001 2001 +2069 2069 SELECT * FROM t4; yyyy c4 NULL NULL @@ -87,71 +87,71 @@ NULL NULL # Comparison of YEAR(2) with YEAR(4) SELECT * FROM t2, t4 WHERE yy = yyyy; yy c2 yyyy c4 -70 1970 1970 1970 -99 1999 1999 1999 -00 2000 2000 2000 -01 2001 2001 2001 -69 2069 2069 2069 +1970 1970 1970 1970 +1999 1999 1999 1999 +2000 2000 2000 2000 +2001 2001 2001 2001 +2069 2069 2069 2069 SELECT * FROM t2, t4 WHERE yy <=> yyyy; yy c2 yyyy c4 NULL NULL NULL NULL -70 1970 1970 1970 -99 1999 1999 1999 -00 2000 2000 2000 -01 2001 2001 2001 -69 2069 2069 2069 +1970 1970 1970 1970 +1999 1999 1999 1999 +2000 2000 2000 2000 +2001 2001 2001 2001 +2069 2069 2069 2069 SELECT * FROM t2, t4 WHERE yy < yyyy; yy c2 yyyy c4 -70 1970 1999 1999 -70 1970 2000 2000 -99 1999 2000 2000 -70 1970 2001 2001 -99 1999 2001 2001 -00 2000 2001 2001 -70 1970 2069 2069 -99 1999 2069 2069 -00 2000 2069 2069 -01 2001 2069 2069 +1970 1970 1999 1999 +1970 1970 2000 2000 +1999 1999 2000 2000 +1970 1970 2001 2001 +1999 1999 2001 2001 +2000 2000 2001 2001 +1970 1970 2069 2069 +1999 1999 2069 2069 +2000 2000 2069 2069 +2001 2001 2069 2069 SELECT * FROM t2, t4 WHERE yy > yyyy; yy c2 yyyy c4 -99 1999 1970 1970 -00 2000 1970 1970 -01 2001 1970 1970 -69 2069 1970 1970 -00 2000 1999 1999 -01 2001 1999 1999 -69 2069 1999 1999 -01 2001 2000 2000 -69 2069 2000 2000 -69 2069 2001 2001 +1999 1999 1970 1970 +2000 2000 1970 1970 +2001 2001 1970 1970 +2069 2069 1970 1970 +2000 2000 1999 1999 +2001 2001 1999 1999 +2069 2069 1999 1999 +2001 2001 2000 2000 +2069 2069 2000 2000 +2069 2069 2001 2001 # Comparison of YEAR(2) with YEAR(2) SELECT * FROM t2 a, t2 b WHERE a.yy = b.yy; yy c2 yy c2 -70 1970 70 1970 -99 1999 99 1999 -00 2000 00 2000 -01 2001 01 2001 -69 2069 69 2069 +1970 1970 1970 1970 +1999 1999 1999 1999 +2000 2000 2000 2000 +2001 2001 2001 2001 +2069 2069 2069 2069 SELECT * FROM t2 a, t2 b WHERE a.yy <=> b.yy; yy c2 yy c2 NULL NULL NULL NULL -70 1970 70 1970 -99 1999 99 1999 -00 2000 00 2000 -01 2001 01 2001 -69 2069 69 2069 +1970 1970 1970 1970 +1999 1999 1999 1999 +2000 2000 2000 2000 +2001 2001 2001 2001 +2069 2069 2069 2069 SELECT * FROM t2 a, t2 b WHERE a.yy < b.yy; yy c2 yy c2 -70 1970 99 1999 -70 1970 00 2000 -99 1999 00 2000 -70 1970 01 2001 -99 1999 01 2001 -00 2000 01 2001 -70 1970 69 2069 -99 1999 69 2069 -00 2000 69 2069 -01 2001 69 2069 +1970 1970 1999 1999 +1970 1970 2000 2000 +1999 1999 2000 2000 +1970 1970 2001 2001 +1999 1999 2001 2001 +2000 2000 2001 2001 +1970 1970 2069 2069 +1999 1999 2069 2069 +2000 2000 2069 2069 +2001 2001 2069 2069 # Comparison of YEAR(4) with YEAR(4) SELECT * FROM t4 a, t4 b WHERE a.yyyy = b.yyyy; yyyy c4 yyyy c4 @@ -201,16 +201,15 @@ SELECT * FROM t4 WHERE yyyy = NOW(); yyyy c4 SELECT * FROM t2 WHERE yy = 99; yy c2 -99 1999 +1999 1999 SELECT * FROM t2 WHERE 99 = yy; yy c2 -99 1999 +1999 1999 SELECT * FROM t4 WHERE yyyy = 99; yyyy c4 1999 1999 SELECT * FROM t2 WHERE yy = 'test'; yy c2 -00 2000 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'test' SELECT * FROM t4 WHERE yyyy = 'test'; @@ -219,44 +218,42 @@ Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'test' SELECT * FROM t2 WHERE yy = '1999'; yy c2 -99 1999 +1999 1999 SELECT * FROM t4 WHERE yyyy = '1999'; yyyy c4 1999 1999 SELECT * FROM t2 WHERE yy = 1999; yy c2 -99 1999 +1999 1999 SELECT * FROM t4 WHERE yyyy = 1999; yyyy c4 1999 1999 SELECT * FROM t2 WHERE yy = 1999.1; yy c2 -99 1999 +1999 1999 SELECT * FROM t4 WHERE yyyy = 1999.1; yyyy c4 1999 1999 SELECT * FROM t2 WHERE yy = 1998.9; yy c2 -99 1999 +1999 1999 SELECT * FROM t4 WHERE yyyy = 1998.9; yyyy c4 1999 1999 # Coverage tests for YEAR with zero/2000 constants: SELECT * FROM t2 WHERE yy = 0; yy c2 -00 2000 SELECT * FROM t2 WHERE yy = '0'; yy c2 -00 2000 +2000 2000 SELECT * FROM t2 WHERE yy = '0000'; yy c2 -00 2000 SELECT * FROM t2 WHERE yy = '2000'; yy c2 -00 2000 +2000 2000 SELECT * FROM t2 WHERE yy = 2000; yy c2 -00 2000 +2000 2000 SELECT * FROM t4 WHERE yyyy = 0; yyyy c4 SELECT * FROM t4 WHERE yyyy = '0'; @@ -304,13 +301,13 @@ COUNT(*) 5 SELECT * FROM t2 WHERE yy < 123; yy c2 -70 1970 -99 1999 -00 2000 -01 2001 -69 2069 SELECT * FROM t2 WHERE yy > 123; yy c2 +1970 1970 +1999 1999 +2000 2000 +2001 2001 +2069 2069 SELECT * FROM t4 WHERE yyyy < 123; yyyy c4 SELECT * FROM t4 WHERE yyyy > 123; @@ -382,7 +379,6 @@ Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Pleas ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); Warnings: Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead DROP TABLE t1; # # End of 5.1 tests @@ -394,16 +390,12 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas insert t1 values (0,2000); select a from t1 where a=2000; a -00 select a from t1 where a=1000+1000; a -00 select a from t1 where a=(select 2000 from dual where 1); a -00 select a from t1 where a=y2k(); a -00 select a from t1 where a=b; a drop table t1; @@ -534,7 +526,7 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` year(2) DEFAULT NULL + `a` year DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 create or replace table t1 (a YEAR(3)); Warnings: @@ -601,16 +593,16 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas INSERT INTO t1 VALUES (93),(94); SELECT * FROM t1; a -93 -94 +1993 +1994 SELECT * FROM t1 WHERE a=1993 and a=93; a -93 +1993 EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1993 and a=93; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 93 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1993 DROP TABLE t1; # # MDEV-16926 CAST(COALESCE(year_field)) returns wrong value @@ -633,13 +625,13 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas INSERT INTO t1 VALUES (1970),(1978),(2000),(2069); SELECT a, CAST(a AS DATE), CAST(COALESCE(a) AS DATE) FROM t1; a CAST(a AS DATE) CAST(COALESCE(a) AS DATE) -70 1970-00-00 1970-00-00 -78 1978-00-00 1978-00-00 -00 2000-00-00 2000-00-00 -69 2069-00-00 2069-00-00 +1970 1970-00-00 1970-00-00 +1978 1978-00-00 1978-00-00 +2000 2000-00-00 2000-00-00 +2069 2069-00-00 2069-00-00 SELECT MIN(a), MAX(a) FROM t1; MIN(a) MAX(a) -70 69 +1970 2069 DROP TABLE t1; # # MDEV-17015 Assertion `m_year <= 9999' failed in Year::Year upon bad argument to MAKEDATE @@ -663,15 +655,13 @@ CREATE TABLE t1 (a YEAR(2)); Warnings: Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1; -Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead DESC t2; Field Type Null Key Default Extra -a year(2) YES NULL -ROUND(a) int(2) unsigned YES NULL -TRUNCATE(a,0) int(2) unsigned YES NULL -FLOOR(a) int(2) unsigned YES NULL -CEILING(a) int(2) unsigned YES NULL +a year YES NULL +ROUND(a) int(4) unsigned YES NULL +TRUNCATE(a,0) int(4) unsigned YES NULL +FLOOR(a) int(4) unsigned YES NULL +CEILING(a) int(4) unsigned YES NULL DROP TABLE t2,t1; CREATE TABLE t1 (a YEAR(4)); Warnings: diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result index 4df88b53a56..fc7624eed3b 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result @@ -118,7 +118,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -153,7 +153,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -244,7 +244,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year BEGIN set @x=i1; set @y=@x; @@ -256,7 +256,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year SQL SECURITY INVOKER COMMENT 'created with INVOKER' BEGIN @@ -368,7 +368,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -403,7 +403,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -494,7 +494,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year NO SQL SQL SECURITY INVOKER COMMENT 'new comment, FN changed to INVOKER' @@ -509,7 +509,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year MODIFIES SQL DATA COMMENT 'FN changed to DEFINER' BEGIN @@ -611,7 +611,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -646,7 +646,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -737,7 +737,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year NO SQL SQL SECURITY INVOKER COMMENT 'new comment, FN changed to INVOKER' @@ -752,7 +752,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year COMMENT 'FN changed to DEFINER' BEGIN set @x=i1; diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index 90d72b451b9..8d7cbe011ba 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -54,7 +54,8 @@ f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; DROP DATABASE IF EXISTS test1; @@ -115,7 +116,8 @@ f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result index fbca906a9fb..52ca70f0d80 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result +++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result @@ -133,7 +133,8 @@ f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -265,7 +266,8 @@ f240 varchar(2000), f241 char(100) ) engine = innodb; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb4.txt' into table tb4; USE test1; @@ -324,7 +326,8 @@ f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; USE test; @@ -476,9 +479,9 @@ def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL dat def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL -def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL @@ -626,9 +629,9 @@ def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date sel def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL -def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test tb4 f235 52 NULL YES char 0 0 NULL NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NEVER NULL @@ -643,9 +646,9 @@ def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL da def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL -def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL @@ -946,9 +949,9 @@ NULL test tb2 f101 date NULL NULL NULL NULL date NULL test tb2 f102 time NULL NULL NULL NULL time NULL test tb2 f103 datetime NULL NULL NULL NULL datetime NULL test tb2 f104 timestamp NULL NULL NULL NULL timestamp -NULL test tb2 f105 year NULL NULL NULL NULL year(4) -NULL test tb2 f106 year NULL NULL NULL NULL year(4) -NULL test tb2 f107 year NULL NULL NULL NULL year(4) +NULL test tb2 f105 year NULL NULL NULL NULL year +NULL test tb2 f106 year NULL NULL NULL NULL year +NULL test tb2 f107 year NULL NULL NULL NULL year 1.0000 test tb2 f108 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test tb2 f109 set 9 9 latin1 latin1_swedish_ci set('1set','2set') 1.0000 test tb3 f118 char 1 1 latin1 latin1_swedish_ci char(1) @@ -1055,9 +1058,9 @@ NULL test tb4 f218 date NULL NULL NULL NULL date NULL test tb4 f219 time NULL NULL NULL NULL time NULL test tb4 f220 datetime NULL NULL NULL NULL datetime NULL test tb4 f221 timestamp NULL NULL NULL NULL timestamp -NULL test tb4 f222 year NULL NULL NULL NULL year(4) -NULL test tb4 f223 year NULL NULL NULL NULL year(4) -NULL test tb4 f224 year NULL NULL NULL NULL year(4) +NULL test tb4 f222 year NULL NULL NULL NULL year +NULL test tb4 f223 year NULL NULL NULL NULL year +NULL test tb4 f224 year NULL NULL NULL NULL year 1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set') NULL test tb4 f235 char 0 0 latin1 latin1_swedish_ci char(0) @@ -1113,9 +1116,9 @@ NULL test1 tb2 f101 date NULL NULL NULL NULL date NULL test1 tb2 f102 time NULL NULL NULL NULL time NULL test1 tb2 f103 datetime NULL NULL NULL NULL datetime NULL test1 tb2 f104 timestamp NULL NULL NULL NULL timestamp -NULL test1 tb2 f105 year NULL NULL NULL NULL year(4) -NULL test1 tb2 f106 year NULL NULL NULL NULL year(4) -NULL test1 tb2 f107 year NULL NULL NULL NULL year(4) +NULL test1 tb2 f105 year NULL NULL NULL NULL year +NULL test1 tb2 f106 year NULL NULL NULL NULL year +NULL test1 tb2 f107 year NULL NULL NULL NULL year 1.0000 test1 tb2 f108 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test1 tb2 f109 set 9 9 latin1 latin1_swedish_ci set('1set','2set') 1.0000 test4 t6 f1 char 20 20 latin1 latin1_swedish_ci char(20) diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result index 5eaa5b08cc2..3782ab25d40 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_memory.result +++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result @@ -129,7 +129,8 @@ f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; drop table if exists tb3; @@ -254,7 +255,8 @@ f239 varbinary(0), f240 varchar(1200) ) engine = memory; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb4.txt' into table tb4; USE test1; @@ -313,7 +315,8 @@ f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; USE test; @@ -477,9 +480,9 @@ def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL dat def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL -def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL @@ -621,9 +624,9 @@ def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date sel def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL -def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test tb4 f236 52 NULL YES char 95 95 NULL NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references NEVER NULL @@ -637,9 +640,9 @@ def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL da def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL -def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL @@ -899,9 +902,9 @@ NULL test tb2 f101 date NULL NULL NULL NULL date NULL test tb2 f102 time NULL NULL NULL NULL time NULL test tb2 f103 datetime NULL NULL NULL NULL datetime NULL test tb2 f104 timestamp NULL NULL NULL NULL timestamp -NULL test tb2 f105 year NULL NULL NULL NULL year(4) -NULL test tb2 f106 year NULL NULL NULL NULL year(4) -NULL test tb2 f107 year NULL NULL NULL NULL year(4) +NULL test tb2 f105 year NULL NULL NULL NULL year +NULL test tb2 f106 year NULL NULL NULL NULL year +NULL test tb2 f107 year NULL NULL NULL NULL year 1.0000 test tb2 f108 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test tb2 f109 set 9 9 latin1 latin1_swedish_ci set('1set','2set') 1.0000 test tb3 f118 char 1 1 latin1 latin1_swedish_ci char(1) @@ -1002,9 +1005,9 @@ NULL test tb4 f218 date NULL NULL NULL NULL date NULL test tb4 f219 time NULL NULL NULL NULL time NULL test tb4 f220 datetime NULL NULL NULL NULL datetime NULL test tb4 f221 timestamp NULL NULL NULL NULL timestamp -NULL test tb4 f222 year NULL NULL NULL NULL year(4) -NULL test tb4 f223 year NULL NULL NULL NULL year(4) -NULL test tb4 f224 year NULL NULL NULL NULL year(4) +NULL test tb4 f222 year NULL NULL NULL NULL year +NULL test tb4 f223 year NULL NULL NULL NULL year +NULL test tb4 f224 year NULL NULL NULL NULL year 1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set') 1.0000 test tb4 f236 char 95 95 latin1 latin1_swedish_ci char(95) @@ -1059,9 +1062,9 @@ NULL test1 tb2 f101 date NULL NULL NULL NULL date NULL test1 tb2 f102 time NULL NULL NULL NULL time NULL test1 tb2 f103 datetime NULL NULL NULL NULL datetime NULL test1 tb2 f104 timestamp NULL NULL NULL NULL timestamp -NULL test1 tb2 f105 year NULL NULL NULL NULL year(4) -NULL test1 tb2 f106 year NULL NULL NULL NULL year(4) -NULL test1 tb2 f107 year NULL NULL NULL NULL year(4) +NULL test1 tb2 f105 year NULL NULL NULL NULL year +NULL test1 tb2 f106 year NULL NULL NULL NULL year +NULL test1 tb2 f107 year NULL NULL NULL NULL year 1.0000 test1 tb2 f108 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test1 tb2 f109 set 9 9 latin1 latin1_swedish_ci set('1set','2set') 1.0000 test4 t6 f1 char 20 20 latin1 latin1_swedish_ci char(20) diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result index 4426583ac4c..4e4d907e8ae 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result @@ -145,7 +145,8 @@ f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -286,7 +287,8 @@ f241 char(100), f242 bit(30) ) engine = myisam; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' into table tb4; USE test1; @@ -353,7 +355,8 @@ f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; @@ -525,9 +528,9 @@ def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL dat def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL -def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL @@ -683,9 +686,9 @@ def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date sel def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL -def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL @@ -709,9 +712,9 @@ def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL da def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL -def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL -def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL +def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL +def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year select,insert,update,references NEVER NULL def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL def test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL @@ -996,9 +999,9 @@ NULL test tb2 f101 date NULL NULL NULL NULL date NULL test tb2 f102 time NULL NULL NULL NULL time NULL test tb2 f103 datetime NULL NULL NULL NULL datetime NULL test tb2 f104 timestamp NULL NULL NULL NULL timestamp -NULL test tb2 f105 year NULL NULL NULL NULL year(4) -NULL test tb2 f106 year NULL NULL NULL NULL year(4) -NULL test tb2 f107 year NULL NULL NULL NULL year(4) +NULL test tb2 f105 year NULL NULL NULL NULL year +NULL test tb2 f106 year NULL NULL NULL NULL year +NULL test tb2 f107 year NULL NULL NULL NULL year 1.0000 test tb2 f108 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test tb2 f109 set 9 9 latin1 latin1_swedish_ci set('1set','2set') 1.0000 test tb2 f110 varbinary 64 64 NULL NULL varbinary(64) @@ -1113,9 +1116,9 @@ NULL test tb4 f218 date NULL NULL NULL NULL date NULL test tb4 f219 time NULL NULL NULL NULL time NULL test tb4 f220 datetime NULL NULL NULL NULL datetime NULL test tb4 f221 timestamp NULL NULL NULL NULL timestamp -NULL test tb4 f222 year NULL NULL NULL NULL year(4) -NULL test tb4 f223 year NULL NULL NULL NULL year(4) -NULL test tb4 f224 year NULL NULL NULL NULL year(4) +NULL test tb4 f222 year NULL NULL NULL NULL year +NULL test tb4 f223 year NULL NULL NULL NULL year +NULL test tb4 f224 year NULL NULL NULL NULL year 1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set') 1.0000 test tb4 f227 varbinary 64 64 NULL NULL varbinary(64) @@ -1180,9 +1183,9 @@ NULL test1 tb2 f101 date NULL NULL NULL NULL date NULL test1 tb2 f102 time NULL NULL NULL NULL time NULL test1 tb2 f103 datetime NULL NULL NULL NULL datetime NULL test1 tb2 f104 timestamp NULL NULL NULL NULL timestamp -NULL test1 tb2 f105 year NULL NULL NULL NULL year(4) -NULL test1 tb2 f106 year NULL NULL NULL NULL year(4) -NULL test1 tb2 f107 year NULL NULL NULL NULL year(4) +NULL test1 tb2 f105 year NULL NULL NULL NULL year +NULL test1 tb2 f106 year NULL NULL NULL NULL year +NULL test1 tb2 f107 year NULL NULL NULL NULL year 1.0000 test1 tb2 f108 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test1 tb2 f109 set 9 9 latin1 latin1_swedish_ci set('1set','2set') 1.0000 test1 tb2 f110 varbinary 64 64 NULL NULL varbinary(64) diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_08.result b/mysql-test/suite/funcs_1/r/memory_storedproc_08.result index 1b8a571e481..ecab258c9f8 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_08.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_08.result @@ -118,7 +118,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -153,7 +153,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -244,7 +244,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year BEGIN set @x=i1; set @y=@x; @@ -256,7 +256,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year SQL SECURITY INVOKER COMMENT 'created with INVOKER' BEGIN @@ -368,7 +368,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -403,7 +403,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -494,7 +494,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year NO SQL SQL SECURITY INVOKER COMMENT 'new comment, FN changed to INVOKER' @@ -509,7 +509,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year MODIFIES SQL DATA COMMENT 'FN changed to DEFINER' BEGIN @@ -611,7 +611,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -646,7 +646,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -737,7 +737,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year NO SQL SQL SECURITY INVOKER COMMENT 'new comment, FN changed to INVOKER' @@ -752,7 +752,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year COMMENT 'FN changed to DEFINER' BEGIN set @x=i1; diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index 417c0e85188..d3c9d9f7baf 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -55,7 +55,8 @@ f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; DROP DATABASE IF EXISTS test1; @@ -116,7 +117,8 @@ f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; USE test; diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result index 1b8a571e481..ecab258c9f8 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_08.result @@ -118,7 +118,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -153,7 +153,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -244,7 +244,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year BEGIN set @x=i1; set @y=@x; @@ -256,7 +256,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year SQL SECURITY INVOKER COMMENT 'created with INVOKER' BEGIN @@ -368,7 +368,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -403,7 +403,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -494,7 +494,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year NO SQL SQL SECURITY INVOKER COMMENT 'new comment, FN changed to INVOKER' @@ -509,7 +509,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year MODIFIES SQL DATA COMMENT 'FN changed to DEFINER' BEGIN @@ -611,7 +611,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -646,7 +646,7 @@ NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL -DTD_IDENTIFIER year(4) +DTD_IDENTIFIER year ROUTINE_BODY SQL ROUTINE_DEFINITION BEGIN set @x=i1; @@ -737,7 +737,7 @@ DATABASE_COLLATION latin1_swedish_ci SHOW CREATE FUNCTION fn_1; Function fn_1 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year NO SQL SQL SECURITY INVOKER COMMENT 'new comment, FN changed to INVOKER' @@ -752,7 +752,7 @@ Database Collation latin1_swedish_ci SHOW CREATE FUNCTION fn_2; Function fn_2 sql_mode NO_ENGINE_SUBSTITUTION -Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4) +Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year COMMENT 'FN changed to DEFINER' BEGIN set @x=i1; diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index 1d6b631ce04..7fc63d7d17e 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -7484,21 +7484,25 @@ declare x, y, z year(3) default 2005; SELECT x, y, z; END// Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead CALL sp1(); x y z 2005 2005 2005 Warnings: -Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR instead DROP PROCEDURE IF EXISTS sp1; CREATE PROCEDURE sp1( ) BEGIN declare x, y, z year(4) default 2005; SELECT x, y, z; END// +Warnings: +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead CALL sp1(); x y z 2005 2005 2005 +Warnings: +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead DROP PROCEDURE IF EXISTS sp1; CREATE PROCEDURE sp1( ) BEGIN @@ -17174,9 +17178,14 @@ BEGIN set f1 = f1 + 51; return f1; END// +Warnings: +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead SELECT fn102(1982); fn102(1982) 2033 +Warnings: +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead DROP FUNCTION IF EXISTS fn103; CREATE FUNCTION fn103( f1 geometrycollection) returns geometrycollection BEGIN @@ -18309,9 +18318,13 @@ BEGIN set f1 = f1 + 51; SELECT f1; END// +Warnings: +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead CALL sp102(1982); f1 2033 +Warnings: +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead DROP PROCEDURE IF EXISTS sp103; CREATE PROCEDURE sp103( f1 geometrycollection) BEGIN diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk.result b/mysql-test/suite/gcol/r/innodb_virtual_fk.result index 252274f3e0a..6051069f99d 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_fk.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_fk.result @@ -713,11 +713,11 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `c2` year(4) DEFAULT NULL, + `c2` year DEFAULT NULL, `c3` time DEFAULT NULL, `c4` char(10) DEFAULT NULL, `v1` timestamp GENERATED ALWAYS AS (`c1`) VIRTUAL, - `v2` year(4) GENERATED ALWAYS AS (`c2`) VIRTUAL, + `v2` year GENERATED ALWAYS AS (`c2`) VIRTUAL, `v3` time GENERATED ALWAYS AS (`c3`) VIRTUAL, `v4` char(10) GENERATED ALWAYS AS (`c4`) VIRTUAL, KEY `v4` (`v4`), @@ -730,11 +730,11 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `c2` year(4) DEFAULT NULL, + `c2` year DEFAULT NULL, `c3` time DEFAULT NULL, `c4` char(10) DEFAULT NULL, `v1` timestamp GENERATED ALWAYS AS (`c1`) VIRTUAL, - `v2` year(4) GENERATED ALWAYS AS (`c2`) VIRTUAL, + `v2` year GENERATED ALWAYS AS (`c2`) VIRTUAL, `v3` time GENERATED ALWAYS AS (`c3`) VIRTUAL, `v4` char(10) GENERATED ALWAYS AS (`c4`) VIRTUAL, KEY `v4` (`v4`) diff --git a/mysql-test/suite/innodb/r/data_types.result b/mysql-test/suite/innodb/r/data_types.result index 1394431b09d..d9d824c3a3b 100644 --- a/mysql-test/suite/innodb/r/data_types.result +++ b/mysql-test/suite/innodb/r/data_types.result @@ -82,7 +82,8 @@ t1_VARCHAR_0 VARCHAR(0), t1_VARMYSQL_0 VARCHAR(0) CHARACTER SET utf8 ) ENGINE=InnoDB; Warnings: -Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead INSERT INTO t1 () VALUES (); SELECT name, diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns2.result b/mysql-test/suite/innodb/r/innodb-virtual-columns2.result index 99a1c610bd3..719cfae7379 100644 --- a/mysql-test/suite/innodb/r/innodb-virtual-columns2.result +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns2.result @@ -8,7 +8,7 @@ INDEX(y) SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `y` year(4) DEFAULT NULL, + `y` year DEFAULT NULL, `i` smallint(6) DEFAULT NULL, `c` varchar(8) NOT NULL DEFAULT '', `vi` smallint(6) GENERATED ALWAYS AS (`i`) VIRTUAL, @@ -29,7 +29,7 @@ INDEX(y) SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `y` year(4) DEFAULT NULL, + `y` year DEFAULT NULL, `i` smallint(6) DEFAULT NULL, `vi` smallint(6) GENERATED ALWAYS AS (`i`) VIRTUAL, KEY `y` (`y`) @@ -50,7 +50,7 @@ INDEX(y) SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `y` year(4) DEFAULT NULL, + `y` year DEFAULT NULL, `i` smallint(6) DEFAULT NULL, `b` blob DEFAULT NULL, `vi` smallint(6) GENERATED ALWAYS AS (`i`) VIRTUAL, diff --git a/mysql-test/suite/innodb_zip/r/bug52745.result b/mysql-test/suite/innodb_zip/r/bug52745.result index 20605eb274d..652121f7060 100644 --- a/mysql-test/suite/innodb_zip/r/bug52745.result +++ b/mysql-test/suite/innodb_zip/r/bug52745.result @@ -58,6 +58,7 @@ col89 float unsigned zerofill DEFAULT NULL, col90 tinyblob ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; Warnings: +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead Note 1291 Column 'col82' has duplicated value '' in ENUM Note 1291 Column 'col82' has duplicated value '' in ENUM SET sql_mode = default; diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 9f38d8605ad..fe229ae5ede 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2479,6 +2479,17 @@ col173 tinytext, col174 decimal(10,0) DEFAULT NULL, col175 double DEFAULT NULL ) engine=aria; +Warnings: +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead +Note 1287 'YEAR(4)' is deprecated and will be removed in a future release. Please use YEAR instead insert ignore into t1 set col10=abs(28449) % 2, col11='1973', diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result index 883f2bb1924..65b8b144e6b 100644 --- a/mysql-test/suite/parts/r/partition_datetime_innodb.result +++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result @@ -874,7 +874,7 @@ partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` year(4) NOT NULL, + `a` year NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY (`a`) @@ -904,7 +904,7 @@ partition by key (a) partitions 12; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` year(4) NOT NULL, + `a` year NOT NULL, PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY (`a`) diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result index 34e06b1ba30..62ca19b6287 100644 --- a/mysql-test/suite/parts/r/partition_datetime_myisam.result +++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result @@ -874,7 +874,7 @@ partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` year(4) NOT NULL, + `a` year NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (`a`) @@ -904,7 +904,7 @@ partition by key (a) partitions 12; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` year(4) NOT NULL, + `a` year NOT NULL, PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (`a`) diff --git a/sql/field.cc b/sql/field.cc index 3a8496861c1..d8f2bd2fd16 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6405,7 +6405,7 @@ bool Field_timef::val_native(Native *to) /**************************************************************************** ** year type ** Save in a byte the year 0, 1901->2155 -** Can handle 2 byte or 4 byte years! +** Can handle 4 byte years! ****************************************************************************/ int Field_year::store(const char *from, size_t len,CHARSET_INFO *cs) @@ -6465,7 +6465,7 @@ int Field_year::store(longlong nr, bool unsigned_val) set_warning(ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } - if (nr != 0 || field_length != 4) // 0000 -> 0; 00 -> 2000 + if (nr != 0) { if (nr < YY_PART_YEAR) nr+=100; // 2000 - 2069 @@ -6508,11 +6508,8 @@ double Field_year::val_real(void) longlong Field_year::val_int(void) { DBUG_ASSERT(marked_for_read()); - DBUG_ASSERT(field_length == 2 || field_length == 4); int tmp= (int) ptr[0]; - if (field_length != 4) - tmp%=100; // Return last 2 char - else if (tmp) + if (tmp) tmp+=1900; return (longlong) tmp; } @@ -6525,7 +6522,7 @@ String *Field_year::val_str(String *val_buffer, val_buffer->alloc(5); val_buffer->length(field_length); char *to=(char*) val_buffer->ptr(); - sprintf(to,field_length == 2 ? "%02d" : "%04d",(int) Field_year::val_int()); + sprintf(to, "%04d", (int) Field_year::val_int()); val_buffer->set_charset(&my_charset_numeric); return val_buffer; } @@ -6534,7 +6531,7 @@ String *Field_year::val_str(String *val_buffer, bool Field_year::get_date(MYSQL_TIME *ltime,date_mode_t fuzzydate) { int tmp= (int) ptr[0]; - if (tmp || field_length != 4) + if (tmp) tmp+= 1900; return int_to_datetime_with_warn(get_thd(), Longlong_hybrid(tmp * 10000, true), @@ -6545,9 +6542,7 @@ bool Field_year::get_date(MYSQL_TIME *ltime,date_mode_t fuzzydate) void Field_year::sql_type(String &res) const { CHARSET_INFO *cs=res.charset(); - res.length(cs->cset->snprintf(cs,(char*)res.ptr(),res.alloced_length(), - (field_length == 4 ? "year" : "year(%d)"), - (int) field_length)); + res.length(cs->cset->snprintf(cs,(char*)res.ptr(),res.alloced_length(), "year")); } diff --git a/sql/field.h b/sql/field.h index ba50e0da1d7..e7fd0bd2c5d 100644 --- a/sql/field.h +++ b/sql/field.h @@ -3371,10 +3371,10 @@ public: enum utype unireg_check_arg, const LEX_CSTRING *field_name_arg) :Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, 1, 1) - {} + { field_length= 4; } const Type_handler *type_handler() const override { - return field_length == 2 ? &type_handler_year2 : &type_handler_year; + return &type_handler_year; } enum_conv_type rpl_conv_type_from(const Conv_source &source, const Relay_log_info *rli, diff --git a/sql/sql_type.cc b/sql/sql_type.cc index 403ddd63159..74fb65dbee4 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -57,7 +57,6 @@ Named_type_handler<Type_handler_olddecimal> type_handler_olddecimal("decimal"); Named_type_handler<Type_handler_newdecimal> type_handler_newdecimal("decimal"); Named_type_handler<Type_handler_year> type_handler_year("year"); -Named_type_handler<Type_handler_year> type_handler_year2("year"); Named_type_handler<Type_handler_time> type_handler_time("time"); Named_type_handler<Type_handler_date> type_handler_date("date"); Named_type_handler<Type_handler_timestamp> type_handler_timestamp("timestamp"); @@ -603,12 +602,6 @@ Year::Year(longlong value, bool unsigned_flag, uint length) } -uint Year::year_precision(const Item *item) const -{ - return item->type_handler() == &type_handler_year2 ? 2 : 4; -} - - VYear::VYear(Item *item) :Year_null(item->to_longlong_null(), item->unsigned_flag, year_precision(item)) { } diff --git a/sql/sql_type.h b/sql/sql_type.h index f801c243171..ef9ee1cf172 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -800,7 +800,7 @@ class Year protected: uint m_year; bool m_truncated; - uint year_precision(const Item *item) const; + uint year_precision(const Item *item) const { return 4; }; public: Year(): m_year(0), m_truncated(false) { } Year(longlong value, bool unsigned_flag, uint length); @@ -7521,7 +7521,6 @@ extern MYSQL_PLUGIN_IMPORT Named_type_handler<Type_handler_newdecimal> type_han extern Named_type_handler<Type_handler_olddecimal> type_handler_olddecimal; extern Named_type_handler<Type_handler_year> type_handler_year; -extern Named_type_handler<Type_handler_year> type_handler_year2; extern Named_type_handler<Type_handler_newdate> type_handler_newdate; extern Named_type_handler<Type_handler_date> type_handler_date; extern Named_type_handler<Type_handler_time> type_handler_time; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e07fd5a3695..8fb7109f391 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6375,7 +6375,7 @@ field_type_temporal: buff, "YEAR"); } } - $$.set(&type_handler_year, $2); + $$.set(&type_handler_year); } | DATE_SYM { $$.set(&type_handler_newdate); } | TIME_SYM opt_field_length diff --git a/storage/connect/mysql-test/connect/r/mysql_new.result b/storage/connect/mysql-test/connect/r/mysql_new.result index 0394caac8af..dee1b5526d6 100644 --- a/storage/connect/mysql-test/connect/r/mysql_new.result +++ b/storage/connect/mysql-test/connect/r/mysql_new.result @@ -201,7 +201,7 @@ t1 CREATE TABLE `t1` ( `b` datetime DEFAULT NULL, `c` time DEFAULT NULL, `d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `e` year(4) DEFAULT NULL + `e` year DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 INSERT IGNORE INTO t1 VALUES('2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23'); Warnings: @@ -221,7 +221,7 @@ t1 CREATE TABLE `t1` ( `b` datetime DEFAULT NULL, `c` time DEFAULT NULL, `d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `e` year(4) DEFAULT NULL + `e` year DEFAULT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT' `TABLE_TYPE`='MYSQL' SELECT * FROM t1; a b c d e diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result index b3814331038..3d31a58a37f 100644 --- a/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result +++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/create_table_TODO_SPLIT_ME.result @@ -73,7 +73,7 @@ drop table t1; create table t1 (c1 year primary key) COMMENT = 'engine "innodb"'; desc t1; Field Type Null Key Default Extra -c1 year(4) NO PRI NULL +c1 year NO PRI NULL drop table t1; create table t1 (c1 char(10) primary key) COMMENT = 'engine "innodb"'; desc t1; |