Bug #114404 Missing time_zone function
Submitted: 19 Mar 2024 11:49 Modified: 5 Aug 2024 18:09
Reporter: Pedro Ferreira Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:8.3.0 OS:Linux (Ubuntu 22.04)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: CREATE TABLE, time zone

[19 Mar 2024 11:49] Pedro Ferreira
Description:
I think this is related to Bug #110577. Run:

CREATE TABLE t0 (c0 INT, CHECK (TIMESTAMP '2010-01-01 10:00:00' = CAST(t0.c0 AT TIME ZONE '+00:00' AS DATETIME)));
-- ERROR 1305 (42000): FUNCTION sys.time_zone does not exist

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.
[20 Mar 2024 8:54] MySQL Verification Team
Hello Pedro Ferreira,

Thank you for the report and feedback.
Verified as described.

regards,
Umesh
[5 Aug 2024 18:09] Jon Stephens
Documented fix as follows in the MySQL 9.1.0 changelog:

    A CREATE TABLE statement with a CHECK constraint that involved a
    CAST with an AT TIME ZONE clause failed with the confusing error
    "Missing time zone function". This was because the CHECK
    constraint text was regenerated internally and subsequently
    misinterpreted.

    We fix this by ensuring that the correct CHECK constraint text
    is stored in the data dictionary along with the rest of the
    CREATE TABLE definition.

Closed.