1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-32188 make TIMESTAMP use whole 32-bit unsigned range

This patch extends the timestamp from
2038-01-19 03:14:07.999999 to 2106-02-07 06:28:15.999999
for 64 bit hardware and OS where 'long' is 64 bits.
This is true for 64 bit Linux but not for Windows.

This is done by treating the 32 bit stored int as unsigned instead of
signed.  This is safe as MariaDB has never accepted dates before the epoch
(1970).
The benefit of this approach that for normal timestamp the storage is
compatible with earlier version.

However for tables using system versioning we before stored a
timestamp with the year 2038 as the 'max timestamp', which is used to
detect current values.  This patch stores the new 2106 year max value
as the max timestamp. This means that old tables using system
versioning needs to be updated with mariadb-upgrade when moving them
to 11.4. That will be done in a separate commit.
This commit is contained in:
Monty
2023-09-11 17:58:22 +03:00
committed by Sergei Golubchik
parent ce6cce85d4
commit dfdedd46e4
90 changed files with 1227 additions and 354 deletions

View File

@ -1001,11 +1001,11 @@ hostname #
SET @@myisam_mmap_size= 500M;
ERROR HY000: Variable 'myisam_mmap_size' is a read only variable
#
# Bug #52315: utc_date() crashes when system time > year 2037
# Bug #52315: utc_date() crashes when system time > year 2106
#
SET TIMESTAMP=2*1024*1024*1024;
SET TIMESTAMP=5*1024*1024*1024;
Warnings:
Warning 1292 Truncated incorrect timestamp value: '2147483648'
Warning 1292 Truncated incorrect timestamp value: '5368709120'
#Should not crash
SELECT UTC_DATE();
SET TIMESTAMP=DEFAULT;