Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
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:
Data type | Min | Max |
---|---|---|
Oracle TIMESTAMP | -4713 | 9999 |
DB2 TIMESTAP | 0001 | 9999 |
PostgreSQL TIMESTAMP | -4713 | 294276 |
SQL Server DATETIME2 | 0001 | 9999 |
SQL Server DATETIME | 1753 | 9999 |
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.
struct { |
longlong tv_sec; -- signed, to store negative years |
uint32 tv_usec;
|
};
|
This task is also a dependency for
- MDEV-15750 preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetic
Using TIMESTAMP arithmetic for the current TIMESTAMP implementation is not very meaningful because of the too small TIMESTAMP range.
Attachments
Issue Links
- blocks
-
MDEV-10764 PL/SQL parser - Phase 2
- Open
-
MDEV-11070 Providing compatibility to other databases - Phase 2
- Open
-
MDEV-15750 preserve MYSQL_TYPE_TIMESTAMP in temporal arithmetics
- Stalled
- relates to
-
MDEV-341 64-bit support in FROM_UNIXTIME()
- Open
-
MDEV-17389 sql_mode=ORACLE: Incompatibility in datetime arithmetic
- Open
-
MDEV-32188 make TIMESTAMP use whole 32-bit unsigned range
- Closed
-
MDEV-10018 Timestamp with time zone
- Open