Skip to content

Support wider range of UNIX_TIMESTAMP, as MySQL 8.0.28 #30133

@mjonss

Description

@mjonss

Enhancement

Increase the range of Timestamp column, to 3001-01-19.

See https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_unix-timestamp

Prior to MySQL 8.0.28, the valid range of argument values is the same as for the TIMESTAMP data type: '1970-01-01 00:00:01.000000' UTC to '2038-01-19 03:14:07.999999' UTC. This is also the case in MySQL 8.0.28 and later for 32-bit platforms.
For MySQL 8.0.28 and later running on 64-bit platforms, the valid range of argument values for UNIX_TIMESTAMP() is '1970-01-01 00:00:01.000000' UTC to '3001-01-19 03:14:07.999999' UTC (corresponding to 32536771199.999999 seconds).

It should be fairly easy in TiDB, since it is stored in the same format as DateTime, bit shifted YYYY MM DD HH MM SS . FRAC, but there are check to keep it in the same range as signed 32-bit time_t to be compatible with MySQL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibility-mysql80This is a compatibility issue with MySQL 8.0(but NOT 5.7)type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions