Bug #110577 Missing year function?
Submitted: 31 Mar 2023 9:35 Modified: 8 Aug 2023 21:01
Reporter: Pedro Ferreira Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:8.0.32 OS:Ubuntu (22.04)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: year

[31 Mar 2023 9:35] Pedro Ferreira
I am not sure if this is a bug. If I run this:

mysql> select CAST(1985 AS YEAR);
| CAST(1985 AS YEAR) |
|               1985 |
1 row in set (0,00 sec)

Runs fine, but if I do:

mysql> CREATE TABLE t5 (c1 YEAR AS (CAST(1985 AS YEAR)));
ERROR 1305 (42000): FUNCTION sys.cast_as_year does not exist

Is this a bug?

The compilation parameters are the same as issue 108148:

-DWITH_DEBUG=1 -DWITH_ASAN=ON -DWITH_UBSAN=ON and boost library version 1.77

How to repeat:
Run the statement above.
[31 Mar 2023 11:06] MySQL Verification Team
Hello Pedro Ferreira,

Thank you for the report and feedback.

[8 Aug 2023 21:01] Jon Stephens
Documented fix as follows in the MySQL 8.2.0 changelog:

    The internal class Item_typecast_year did not have its own
    print() member function override, which meant that some of the
    definitions shown for views, tables, or both could be malformed.