[MDEV-32496] TIMESTAMP variant to support YEAR range -4713 and +9999 Created: 2023-10-17 Updated: 2023-10-23 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data types, Temporal Types |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
MariaDB TIMESTAMP supports year values in the range 1970..2038, and after MDEV-32188 it's going to support year values in the range 1970..2106. This range is still narrower than most other databases support:
For migration purposes, we need a data type which will cover at least the range -4713..9999. It will need 5 bytes (instead of 4 bytes) to store the "number of seconds since 1970-01-01 00:00:00 UTC" value. Also, it will need a new C++ data type (instead of struct timeval) to transfer values inside the server.
This task is also a dependency for
Using TIMESTAMP arithmetic for the current TIMESTAMP implementation is not very meaningful because of the too small TIMESTAMP range. |
| Comments |
| Comment by Vladislav Vaintroub [ 2023-10-17 ] |
|
bar, if possible, do not use ulong. It is a very badly portable type. for usec, int32_t is more than enough. |
| Comment by Alexander Barkov [ 2023-10-17 ] |
|
wlad, thanks for your note. I agree. Changed to uint32. |