-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support wider range of UNIX_TIMESTAMP, as MySQL 8.0.28 #30133
Comments
Interesting. Why the range is only extended to year 3001 (and strangely reusing 01-19 03:14:07), not all the way to 9999-12-31 23:59:59? If it is expanded from 31 bits to 35 bits the upper range can actually reach 3058-10-26 03:46:07. If the return type of And it seems what is expanded is not the range of TIMESTAMP type, but just the range of the functions
|
Since MySQL 8.0.28 is not yet released, I assume we need to wait until it has been released to check the details. I also assume this update to the manual might been released a bit too early. |
Well using the full 63 bits would take us to 292,277,026,596-12-04 15:30:07 which is certainly impractical 🤣. But I think it is better to support the full DATETIME range (year 1000–9999, occupying 39 bits) rather than slightly relaxing to the awkward middle of year 3001 🙃. |
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
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.
The text was updated successfully, but these errors were encountered: