Skip to content

Commit 2469231

Browse files
Tor DidriksenAmith Nagarajappa
Tor Didriksen
authored and
Amith Nagarajappa
committed
Bug #34370933 Assertion `max_length == 4' failed in MySQL 8.0.29
We hit an assertion when creating fields of type YEAR for temporary tables holding UNION results. In set_data_type_year(): set length to four, and set the unsigned bit. Field_year is an unsigned tinyint of length four, so let the functions year() and cast_as_year() have the same type. Change-Id: I485b8ac8559b0dbf25d25e94a24223006adaecfd
1 parent 8077b63 commit 2469231

23 files changed

+92
-62
lines changed

mysql-test/r/ctype_binary.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ create table t1 as select concat(year(20090224)) as c1;
13871387
show create table t1;
13881388
Table Create Table
13891389
t1 CREATE TABLE `t1` (
1390-
`c1` varbinary(5) DEFAULT NULL
1390+
`c1` varbinary(4) DEFAULT NULL
13911391
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
13921392
drop table t1;
13931393
select hex(concat(weekday(20090224)));

mysql-test/r/ctype_cp1251.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ create table t1 as select concat(year(20090224)) as c1;
17811781
show create table t1;
17821782
Table Create Table
17831783
t1 CREATE TABLE `t1` (
1784-
`c1` varchar(5) CHARACTER SET cp1251 DEFAULT NULL
1784+
`c1` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
17851785
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
17861786
drop table t1;
17871787
select hex(concat(weekday(20090224)));

mysql-test/r/ctype_latin1_myisam.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ create table t1 as select concat(year(20090224)) as c1;
13861386
show create table t1;
13871387
Table Create Table
13881388
t1 CREATE TABLE `t1` (
1389-
`c1` varchar(5) DEFAULT NULL
1389+
`c1` varchar(4) DEFAULT NULL
13901390
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
13911391
drop table t1;
13921392
select hex(concat(weekday(20090224)));

mysql-test/r/ctype_ucs.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,7 @@ create table t1 as select concat(year(20090224)) as c1;
27982798
show create table t1;
27992799
Table Create Table
28002800
t1 CREATE TABLE `t1` (
2801-
`c1` varchar(5) CHARACTER SET ucs2 DEFAULT NULL
2801+
`c1` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
28022802
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
28032803
drop table t1;
28042804
select hex(concat(weekday(20090224)));

mysql-test/r/ctype_utf8.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4215,7 +4215,7 @@ create table t1 as select concat(year(20090224)) as c1;
42154215
show create table t1;
42164216
Table Create Table
42174217
t1 CREATE TABLE `t1` (
4218-
`c1` varchar(5) CHARACTER SET utf8mb3 DEFAULT NULL
4218+
`c1` varchar(4) CHARACTER SET utf8mb3 DEFAULT NULL
42194219
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
42204220
drop table t1;
42214221
select hex(concat(weekday(20090224)));

mysql-test/r/func_time.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,3 +2092,12 @@ CREATE VIEW v1 AS SELECT (SELECT 'v' FROM DUAL) AS field1 FROM t1 GROUP BY field
20922092
HAVING TIME(field1) != 0 AND TIMESTAMP(field1) != 0;
20932093
DROP VIEW v1;
20942094
DROP TABLE t1;
2095+
#
2096+
# Bug #34370933 Assertion `max_length == 4' failed in MySQL 8.0.29
2097+
#
2098+
SELECT CAST(1 AS YEAR) UNION SELECT CAST(1 AS YEAR);
2099+
CAST(1 AS YEAR)
2100+
2001
2101+
SELECT YEAR('1999-09-11') UNION SELECT YEAR('1999-09-11');
2102+
YEAR('1999-09-11')
2103+
1999

mysql-test/r/functional_index_debug.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ t1 CREATE TABLE `t1` (
5353
`!hidden!idx13!0!0` double GENERATED ALWAYS AS (st_x(`geometry_col`)) VIRTUAL,
5454
`!hidden!idx2!0!0` double GENERATED ALWAYS AS (abs(`dbl_col`)) VIRTUAL,
5555
`!hidden!idx3!0!0` decimal(3,0) GENERATED ALWAYS AS (truncate(`decimal_col`,0)) VIRTUAL,
56-
`!hidden!idx4!0!0` int GENERATED ALWAYS AS (year(`date_col`)) VIRTUAL,
56+
`!hidden!idx4!0!0` year GENERATED ALWAYS AS (year(`date_col`)) VIRTUAL,
5757
`!hidden!idx5!0!0` varchar(29) GENERATED ALWAYS AS (addtime(_utf8mb4'01:00:00',`time_col`)) VIRTUAL,
5858
`!hidden!idx6!0!0` varchar(29) GENERATED ALWAYS AS (addtime(_utf8mb4'01:00:00',`time_with_fractions_col`)) VIRTUAL,
5959
`!hidden!idx7!0!0` datetime GENERATED ALWAYS AS ((`datetime_col` - interval 30 day)) VIRTUAL,

mysql-test/r/ps.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3364,7 +3364,7 @@ CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
33643364
SHOW CREATE TABLE tmp1;
33653365
Table Create Table
33663366
tmp1 CREATE TEMPORARY TABLE `tmp1` (
3367-
`c1` bigint DEFAULT NULL
3367+
`c1` bigint unsigned DEFAULT NULL
33683368
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
33693369
SELECT @a, @a = 2010;
33703370
@a @a = 2010

mysql-test/r/ps_2myisam.result

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,8 +1796,8 @@ t5 CREATE TABLE `t5` (
17961796
`param09` longtext CHARACTER SET latin1,
17971797
`const10` bigint NOT NULL DEFAULT '0',
17981798
`param10` bigint DEFAULT NULL,
1799-
`const11` int DEFAULT NULL,
1800-
`param11` bigint DEFAULT NULL,
1799+
`const11` year DEFAULT NULL,
1800+
`param11` bigint unsigned DEFAULT NULL,
18011801
`const12` binary(0) DEFAULT NULL,
18021802
`param12` bigint DEFAULT NULL,
18031803
`param13` decimal(65,30) DEFAULT NULL,
@@ -1826,8 +1826,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
18261826
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
18271827
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
18281828
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
1829-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
1830-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
1829+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
1830+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
18311831
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
18321832
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
18331833
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -1916,7 +1916,7 @@ def @arg07 250 67108860 10 Y 0 31 255
19161916
def @arg08 251 268435440 19 Y 0 31 255
19171917
def @arg09 250 67108860 19 Y 0 31 255
19181918
def @arg10 8 21 9 Y 32896 0 63
1919-
def @arg11 8 21 4 Y 32896 0 63
1919+
def @arg11 8 21 4 Y 32928 0 63
19201920
def @arg12 8 21 0 Y 32896 0 63
19211921
def @arg13 246 67 0 Y 32896 30 63
19221922
def @arg14 251 268435440 0 Y 0 31 255

mysql-test/r/ps_3innodb.result

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,8 +1779,8 @@ t5 CREATE TABLE `t5` (
17791779
`param09` longtext CHARACTER SET latin1,
17801780
`const10` bigint NOT NULL DEFAULT '0',
17811781
`param10` bigint DEFAULT NULL,
1782-
`const11` int DEFAULT NULL,
1783-
`param11` bigint DEFAULT NULL,
1782+
`const11` year DEFAULT NULL,
1783+
`param11` bigint unsigned DEFAULT NULL,
17841784
`const12` binary(0) DEFAULT NULL,
17851785
`param12` bigint DEFAULT NULL,
17861786
`param13` decimal(65,30) DEFAULT NULL,
@@ -1809,8 +1809,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
18091809
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
18101810
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
18111811
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
1812-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
1813-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
1812+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
1813+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
18141814
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
18151815
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
18161816
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -1899,7 +1899,7 @@ def @arg07 250 67108860 10 Y 0 31 255
18991899
def @arg08 251 268435440 19 Y 0 31 255
19001900
def @arg09 250 67108860 19 Y 0 31 255
19011901
def @arg10 8 21 9 Y 32896 0 63
1902-
def @arg11 8 21 4 Y 32896 0 63
1902+
def @arg11 8 21 4 Y 32928 0 63
19031903
def @arg12 8 21 0 Y 32896 0 63
19041904
def @arg13 246 67 0 Y 32896 30 63
19051905
def @arg14 251 268435440 0 Y 0 31 255

mysql-test/r/ps_4heap.result

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,8 +1780,8 @@ t5 CREATE TABLE `t5` (
17801780
`param09` longtext CHARACTER SET latin1,
17811781
`const10` bigint NOT NULL DEFAULT '0',
17821782
`param10` bigint DEFAULT NULL,
1783-
`const11` int DEFAULT NULL,
1784-
`param11` bigint DEFAULT NULL,
1783+
`const11` year DEFAULT NULL,
1784+
`param11` bigint unsigned DEFAULT NULL,
17851785
`const12` binary(0) DEFAULT NULL,
17861786
`param12` bigint DEFAULT NULL,
17871787
`param13` decimal(65,30) DEFAULT NULL,
@@ -1810,8 +1810,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
18101810
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
18111811
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
18121812
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
1813-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
1814-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
1813+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
1814+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
18151815
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
18161816
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
18171817
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -1900,7 +1900,7 @@ def @arg07 250 67108860 10 Y 0 31 255
19001900
def @arg08 251 268435440 19 Y 0 31 255
19011901
def @arg09 250 67108860 19 Y 0 31 255
19021902
def @arg10 8 21 9 Y 32896 0 63
1903-
def @arg11 8 21 4 Y 32896 0 63
1903+
def @arg11 8 21 4 Y 32928 0 63
19041904
def @arg12 8 21 0 Y 32896 0 63
19051905
def @arg13 246 67 0 Y 32896 30 63
19061906
def @arg14 251 268435440 0 Y 0 31 255

mysql-test/r/ps_5merge.result

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,8 +1717,8 @@ t5 CREATE TABLE `t5` (
17171717
`param09` longtext CHARACTER SET latin1,
17181718
`const10` bigint NOT NULL DEFAULT '0',
17191719
`param10` bigint DEFAULT NULL,
1720-
`const11` int DEFAULT NULL,
1721-
`param11` bigint DEFAULT NULL,
1720+
`const11` year DEFAULT NULL,
1721+
`param11` bigint unsigned DEFAULT NULL,
17221722
`const12` binary(0) DEFAULT NULL,
17231723
`param12` bigint DEFAULT NULL,
17241724
`param13` decimal(65,30) DEFAULT NULL,
@@ -1747,8 +1747,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
17471747
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
17481748
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
17491749
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
1750-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
1751-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
1750+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
1751+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
17521752
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
17531753
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
17541754
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -1837,7 +1837,7 @@ def @arg07 250 67108860 10 Y 0 31 255
18371837
def @arg08 251 268435440 19 Y 0 31 255
18381838
def @arg09 250 67108860 19 Y 0 31 255
18391839
def @arg10 8 21 9 Y 32896 0 63
1840-
def @arg11 8 21 4 Y 32896 0 63
1840+
def @arg11 8 21 4 Y 32928 0 63
18411841
def @arg12 8 21 0 Y 32896 0 63
18421842
def @arg13 246 67 0 Y 32896 30 63
18431843
def @arg14 251 268435440 0 Y 0 31 255
@@ -4899,8 +4899,8 @@ t5 CREATE TABLE `t5` (
48994899
`param09` longtext CHARACTER SET latin1,
49004900
`const10` bigint NOT NULL DEFAULT '0',
49014901
`param10` bigint DEFAULT NULL,
4902-
`const11` int DEFAULT NULL,
4903-
`param11` bigint DEFAULT NULL,
4902+
`const11` year DEFAULT NULL,
4903+
`param11` bigint unsigned DEFAULT NULL,
49044904
`const12` binary(0) DEFAULT NULL,
49054905
`param12` bigint DEFAULT NULL,
49064906
`param13` decimal(65,30) DEFAULT NULL,
@@ -4929,8 +4929,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
49294929
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
49304930
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
49314931
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
4932-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
4933-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
4932+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
4933+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
49344934
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
49354935
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
49364936
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -5019,7 +5019,7 @@ def @arg07 250 67108860 10 Y 0 31 255
50195019
def @arg08 251 268435440 19 Y 0 31 255
50205020
def @arg09 250 67108860 19 Y 0 31 255
50215021
def @arg10 8 21 9 Y 32896 0 63
5022-
def @arg11 8 21 4 Y 32896 0 63
5022+
def @arg11 8 21 4 Y 32928 0 63
50235023
def @arg12 8 21 0 Y 32896 0 63
50245024
def @arg13 246 67 0 Y 32896 30 63
50255025
def @arg14 251 268435440 0 Y 0 31 255

mysql-test/r/ps_w_max_indexes_64.result

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,8 +2004,8 @@ t5 CREATE TABLE `t5` (
20042004
`param09` longtext CHARACTER SET latin1,
20052005
`const10` bigint NOT NULL DEFAULT '0',
20062006
`param10` bigint DEFAULT NULL,
2007-
`const11` int DEFAULT NULL,
2008-
`param11` bigint DEFAULT NULL,
2007+
`const11` year DEFAULT NULL,
2008+
`param11` bigint unsigned DEFAULT NULL,
20092009
`const12` binary(0) DEFAULT NULL,
20102010
`param12` bigint DEFAULT NULL,
20112011
`param13` decimal(65,30) DEFAULT NULL,
@@ -2034,8 +2034,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
20342034
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
20352035
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
20362036
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
2037-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
2038-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
2037+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
2038+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
20392039
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
20402040
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
20412041
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -2124,7 +2124,7 @@ def @arg07 250 67108860 10 Y 0 31 255
21242124
def @arg08 251 268435440 19 Y 0 31 255
21252125
def @arg09 250 67108860 19 Y 0 31 255
21262126
def @arg10 8 21 9 Y 32896 0 63
2127-
def @arg11 8 21 4 Y 32896 0 63
2127+
def @arg11 8 21 4 Y 32928 0 63
21282128
def @arg12 8 21 0 Y 32896 0 63
21292129
def @arg13 246 67 0 Y 32896 30 63
21302130
def @arg14 251 268435440 0 Y 0 31 255
@@ -4090,8 +4090,8 @@ t5 CREATE TABLE `t5` (
40904090
`param09` longtext CHARACTER SET latin1,
40914091
`const10` bigint NOT NULL DEFAULT '0',
40924092
`param10` bigint DEFAULT NULL,
4093-
`const11` int DEFAULT NULL,
4094-
`param11` bigint DEFAULT NULL,
4093+
`const11` year DEFAULT NULL,
4094+
`param11` bigint unsigned DEFAULT NULL,
40954095
`const12` binary(0) DEFAULT NULL,
40964096
`param12` bigint DEFAULT NULL,
40974097
`param13` decimal(65,30) DEFAULT NULL,
@@ -4120,8 +4120,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
41204120
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
41214121
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
41224122
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
4123-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
4124-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
4123+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
4124+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
41254125
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
41264126
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
41274127
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -4210,7 +4210,7 @@ def @arg07 250 67108860 10 Y 0 31 255
42104210
def @arg08 251 268435440 19 Y 0 31 255
42114211
def @arg09 250 67108860 19 Y 0 31 255
42124212
def @arg10 8 21 9 Y 32896 0 63
4213-
def @arg11 8 21 4 Y 32896 0 63
4213+
def @arg11 8 21 4 Y 32928 0 63
42144214
def @arg12 8 21 0 Y 32896 0 63
42154215
def @arg13 246 67 0 Y 32896 30 63
42164216
def @arg14 251 268435440 0 Y 0 31 255

mysql-test/r/ps_w_max_indexes_64_myisam.result

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,8 +1869,8 @@ t5 CREATE TABLE `t5` (
18691869
`param09` longtext CHARACTER SET latin1,
18701870
`const10` bigint NOT NULL DEFAULT '0',
18711871
`param10` bigint DEFAULT NULL,
1872-
`const11` int DEFAULT NULL,
1873-
`param11` bigint DEFAULT NULL,
1872+
`const11` year DEFAULT NULL,
1873+
`param11` bigint unsigned DEFAULT NULL,
18741874
`const12` binary(0) DEFAULT NULL,
18751875
`param12` bigint DEFAULT NULL,
18761876
`param13` decimal(65,30) DEFAULT NULL,
@@ -1899,8 +1899,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
18991899
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
19001900
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
19011901
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
1902-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
1903-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
1902+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
1903+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
19041904
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
19051905
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
19061906
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -1989,7 +1989,7 @@ def @arg07 250 67108860 10 Y 0 31 255
19891989
def @arg08 251 268435440 19 Y 0 31 255
19901990
def @arg09 250 67108860 19 Y 0 31 255
19911991
def @arg10 8 21 9 Y 32896 0 63
1992-
def @arg11 8 21 4 Y 32896 0 63
1992+
def @arg11 8 21 4 Y 32928 0 63
19931993
def @arg12 8 21 0 Y 32896 0 63
19941994
def @arg13 246 67 0 Y 32896 30 63
19951995
def @arg14 251 268435440 0 Y 0 31 255
@@ -3955,8 +3955,8 @@ t5 CREATE TABLE `t5` (
39553955
`param09` longtext CHARACTER SET latin1,
39563956
`const10` bigint NOT NULL DEFAULT '0',
39573957
`param10` bigint DEFAULT NULL,
3958-
`const11` int DEFAULT NULL,
3959-
`param11` bigint DEFAULT NULL,
3958+
`const11` year DEFAULT NULL,
3959+
`param11` bigint unsigned DEFAULT NULL,
39603960
`const12` binary(0) DEFAULT NULL,
39613961
`param12` bigint DEFAULT NULL,
39623962
`param13` decimal(65,30) DEFAULT NULL,
@@ -3985,8 +3985,8 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
39853985
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 255
39863986
def test t5 t5 const10 const10 8 21 9 N 32769 0 63
39873987
def test t5 t5 param10 param10 8 21 9 Y 32768 0 63
3988-
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
3989-
def test t5 t5 param11 param11 8 21 4 Y 32768 0 63
3988+
def test t5 t5 const11 const11 13 4 4 Y 32864 0 63
3989+
def test t5 t5 param11 param11 8 21 4 Y 32800 0 63
39903990
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
39913991
def test t5 t5 param12 param12 8 21 0 Y 32768 0 63
39923992
def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
@@ -4075,7 +4075,7 @@ def @arg07 250 67108860 10 Y 0 31 255
40754075
def @arg08 251 268435440 19 Y 0 31 255
40764076
def @arg09 250 67108860 19 Y 0 31 255
40774077
def @arg10 8 21 9 Y 32896 0 63
4078-
def @arg11 8 21 4 Y 32896 0 63
4078+
def @arg11 8 21 4 Y 32928 0 63
40794079
def @arg12 8 21 0 Y 32896 0 63
40804080
def @arg13 246 67 0 Y 32896 30 63
40814081
def @arg14 251 268435440 0 Y 0 31 255

mysql-test/r/type_year.result

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,13 @@ INSERT INTO t VALUES
296296
(2, '1999-12-31', '2000-01-01 00:00:00');
297297
SELECT ((year(QC_DATE) - year(QC_TIMESTAMP))) FROM t
298298
WHERE QC_DATE_KEY = 2;
299-
((year(QC_DATE) - year(QC_TIMESTAMP)))
300-
-1
299+
ERROR 22003: BIGINT UNSIGNED value is out of range in '(year(`test`.`t`.`QC_DATE`) - year(`test`.`t`.`QC_TIMESTAMP`))'
301300
DROP TABLE t;
301+
CREATE TABLE y(y1 YEAR, y2 YEAR);
302+
INSERT INTO y VALUES(2020,2022);
303+
SELECT y1-y2 FROM y;
304+
ERROR 22003: BIGINT UNSIGNED value is out of range in '(`test`.`y`.`y1` - `test`.`y`.`y2`)'
305+
DROP TABLE y;
302306
#
303307
# WL#13537: Deprecate display width for the YEAR datatype
304308
#

mysql-test/suite/json/r/json_value.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ v
7373
-123
7474
SELECT JSON_VALUE('{"data": 1999}', '$.data' RETURNING YEAR) v;
7575
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
76-
def v 13 5 4 Y 32896 0 63
76+
def v 13 4 4 Y 32928 0 63
7777
v
7878
1999
7979
SELECT JSON_VALUE('{"data": -1999}', '$.data' RETURNING YEAR) v;
8080
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
81-
def v 13 5 0 Y 32896 0 63
81+
def v 13 4 0 Y 32928 0 63
8282
v
8383
NULL
8484
SELECT JSON_VALUE(JSON_OBJECT('data', 1.0e0/3), '$.data' RETURNING FLOAT) v;

mysql-test/t/func_time.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,3 +1334,10 @@ CREATE VIEW v1 AS SELECT (SELECT 'v' FROM DUAL) AS field1 FROM t1 GROUP BY field
13341334
HAVING TIME(field1) != 0 AND TIMESTAMP(field1) != 0;
13351335
DROP VIEW v1;
13361336
DROP TABLE t1;
1337+
1338+
--echo #
1339+
--echo # Bug #34370933 Assertion `max_length == 4' failed in MySQL 8.0.29
1340+
--echo #
1341+
1342+
SELECT CAST(1 AS YEAR) UNION SELECT CAST(1 AS YEAR);
1343+
SELECT YEAR('1999-09-11') UNION SELECT YEAR('1999-09-11');

0 commit comments

Comments
 (0)