64-bit time_t support in MariaDB?
![](https://secure.gravatar.com/avatar/856432b5aa95727609567a91a533e0e9.jpg?s=120&d=mm&r=g)
Hello! Does MariaDB already fully support 64-bit time_t (the year 2038 problem)? MariaDB 10.11 was today uploaded to Debian experimental without any 64-bit time_t support changes, just a library name change[1] to test that it works with the Debian 64-bit time_t tooling as Debian is currently undergoing a transition to it[2]. So far MariaDB built successfully and passed the main MTR suite on 11 architectures[3]. Monty mentioned that some work is in progress, and indeed I found his commits in two branches [4,5] but looking at the commits and their link to buildbot it seems they are not passing the CI. I also found one MDEV[6] to make TIMESTAMP use the whole 32-bit unsigned range. Are there any other efforts in progress? Does MTR main suite include tests for 64-bit time support? Should MTR automatically currently fail if toolchain time is 64-bit? [1] https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/063109a306a016... [2] https://lists.debian.org/debian-devel-announce/2024/02/msg00000.html [3] https://buildd.debian.org/status/package.php?p=mariadb&suite=experimental [4] https://github.com/MariaDB/server/commits/bb-11.4-timestamp/ [5] https://github.com/MariaDB/server/commits/bb-11.4-monty/ [6] https://jira.mariadb.org/browse/MDEV-32188
![](https://secure.gravatar.com/avatar/39b623a1559cf9c69ac3d9d4fb44e7fe.jpg?s=120&d=mm&r=g)
Hi, Otto, On Feb 03, Otto Kekäläinen via developers wrote:
Hello!
Does MariaDB already fully support 64-bit time_t (the year 2038 problem)?
No
MariaDB 10.11 was today uploaded to Debian experimental without any 64-bit time_t support changes, just a library name change[1] to test that it works with the Debian 64-bit time_t tooling as Debian is currently undergoing a transition to it[2]. So far MariaDB built successfully and passed the main MTR suite on 11 architectures[3].
Monty mentioned that some work is in progress, and indeed I found his commits in two branches [4,5] but looking at the commits and their link to buildbot it seems they are not passing the CI. I also found one MDEV[6] to make TIMESTAMP use the whole 32-bit unsigned range.
Are there any other efforts in progress?
Not that I know of
Does MTR main suite include tests for 64-bit time support? Should MTR automatically currently fail if toolchain time is 64-bit?
No and no. But, as you've seen, 11.4 or 11.5 will have MDEV-32188, which fixes the year 2038 problem, making timestamp good up to 2106. Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
![](https://secure.gravatar.com/avatar/856432b5aa95727609567a91a533e0e9.jpg?s=120&d=mm&r=g)
Hi!
While working on MariaDB 10.11.7 I am seeing the compilation fail on
all 32-bit systems with error:
size of array ‘compile_time_assert’ is negative
Considering this affects all 32-bit systems and error message is about
time, sounds like it could be related to 64-bit time, but seems
MDEV-32188 wasn't merged yet.
Does anybody remember off the top of their head any other time related
changes in latest release that maybe aren't 32-bit compatible?
Tracking in https://jira.mariadb.org/browse/MDEV-33429
On Sat, 3 Feb 2024 at 21:25, Otto Kekäläinen
Hello!
Does MariaDB already fully support 64-bit time_t (the year 2038 problem)?
MariaDB 10.11 was today uploaded to Debian experimental without any 64-bit time_t support changes, just a library name change[1] to test that it works with the Debian 64-bit time_t tooling as Debian is currently undergoing a transition to it[2]. So far MariaDB built successfully and passed the main MTR suite on 11 architectures[3].
Monty mentioned that some work is in progress, and indeed I found his commits in two branches [4,5] but looking at the commits and their link to buildbot it seems they are not passing the CI. I also found one MDEV[6] to make TIMESTAMP use the whole 32-bit unsigned range.
Are there any other efforts in progress?
Does MTR main suite include tests for 64-bit time support? Should MTR automatically currently fail if toolchain time is 64-bit?
[1] https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/063109a306a016... [2] https://lists.debian.org/debian-devel-announce/2024/02/msg00000.html [3] https://buildd.debian.org/status/package.php?p=mariadb&suite=experimental [4] https://github.com/MariaDB/server/commits/bb-11.4-timestamp/ [5] https://github.com/MariaDB/server/commits/bb-11.4-monty/ [6] https://jira.mariadb.org/browse/MDEV-32188
![](https://secure.gravatar.com/avatar/856432b5aa95727609567a91a533e0e9.jpg?s=120&d=mm&r=g)
Hi!
Related to this topic I noticed that MariaDB currently has a hard
failure if started in 2038+
# date
Thu Mar 3 05:55:28 UTC 2039
# ./sql/mariadbd --version
2039-03-03 5:58:55 0 [ERROR] This server doesn't support dates later than 2038
This is due to https://github.com/MariaDB/server/blob/11.5/sql/mysqld.cc#L3903-L3908
/* TODO: remove this when my_time_t is 64 bit compatible */
if (!IS_TIME_T_VALID_FOR_TIMESTAMP(server_start_time))
{
sql_print_error("This server doesn't support dates later than 2038");
exit(1);
}
I see that MDEV-32188 is now "in testing". I wonder how that test was
done, did you remove this check in order to get the server starting on
a machine that has time set to 2039?
On Sat, 3 Feb 2024 at 21:25, Otto Kekäläinen
Hello!
Does MariaDB already fully support 64-bit time_t (the year 2038 problem)?
MariaDB 10.11 was today uploaded to Debian experimental without any 64-bit time_t support changes, just a library name change[1] to test that it works with the Debian 64-bit time_t tooling as Debian is currently undergoing a transition to it[2]. So far MariaDB built successfully and passed the main MTR suite on 11 architectures[3].
Monty mentioned that some work is in progress, and indeed I found his commits in two branches [4,5] but looking at the commits and their link to buildbot it seems they are not passing the CI. I also found one MDEV[6] to make TIMESTAMP use the whole 32-bit unsigned range.
Are there any other efforts in progress?
Does MTR main suite include tests for 64-bit time support? Should MTR automatically currently fail if toolchain time is 64-bit?
[1] https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/063109a306a016... [2] https://lists.debian.org/debian-devel-announce/2024/02/msg00000.html [3] https://buildd.debian.org/status/package.php?p=mariadb&suite=experimental [4] https://github.com/MariaDB/server/commits/bb-11.4-timestamp/ [5] https://github.com/MariaDB/server/commits/bb-11.4-monty/ [6] https://jira.mariadb.org/browse/MDEV-32188
![](https://secure.gravatar.com/avatar/39b623a1559cf9c69ac3d9d4fb44e7fe.jpg?s=120&d=mm&r=g)
Hi, Otto, MDEV-32188 is blocked by MDEV-33449 "improving repair of tables", because repair changes are required to solve the upgrade of system versioned tables to new timestamps. Current plan is to get everything into 11.5. Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org On Mar 02, Otto Kekäläinen via developers wrote:
Hi!
Related to this topic I noticed that MariaDB currently has a hard failure if started in 2038+
# date Thu Mar 3 05:55:28 UTC 2039
# ./sql/mariadbd --version 2039-03-03 5:58:55 0 [ERROR] This server doesn't support dates later than 2038
This is due to https://github.com/MariaDB/server/blob/11.5/sql/mysqld.cc#L3903-L3908
/* TODO: remove this when my_time_t is 64 bit compatible */ if (!IS_TIME_T_VALID_FOR_TIMESTAMP(server_start_time)) { sql_print_error("This server doesn't support dates later than 2038"); exit(1); }
I see that MDEV-32188 is now "in testing". I wonder how that test was done, did you remove this check in order to get the server starting on a machine that has time set to 2039?
![](https://secure.gravatar.com/avatar/856432b5aa95727609567a91a533e0e9.jpg?s=120&d=mm&r=g)
Hi!
Thanks for the reply and further context.
I am now testing running mariadb-test-run in 2038 in CI with
libfaketime at https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/74,
I will report later how it goes.
On Sun, 3 Mar 2024 at 05:43, Sergei Golubchik
Hi, Otto,
MDEV-32188 is blocked by MDEV-33449 "improving repair of tables", because repair changes are required to solve the upgrade of system versioned tables to new timestamps.
Current plan is to get everything into 11.5.
Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
On Mar 02, Otto Kekäläinen via developers wrote:
Hi!
Related to this topic I noticed that MariaDB currently has a hard failure if started in 2038+
# date Thu Mar 3 05:55:28 UTC 2039
# ./sql/mariadbd --version 2039-03-03 5:58:55 0 [ERROR] This server doesn't support dates later than 2038
This is due to https://github.com/MariaDB/server/blob/11.5/sql/mysqld.cc#L3903-L3908
/* TODO: remove this when my_time_t is 64 bit compatible */ if (!IS_TIME_T_VALID_FOR_TIMESTAMP(server_start_time)) { sql_print_error("This server doesn't support dates later than 2038"); exit(1); }
I see that MDEV-32188 is now "in testing". I wonder how that test was done, did you remove this check in order to get the server starting on a machine that has time set to 2039?
![](https://secure.gravatar.com/avatar/856432b5aa95727609567a91a533e0e9.jpg?s=120&d=mm&r=g)
FYI: MySQL had these issues in Debian/Ubuntu * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1065509 * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1065496 They seem to be fixed upstream, and they also removed a patch to skip a time test on armhf in https://salsa.debian.org/mariadb-team/mysql/-/blob/af62772e9d3f6a192d4d58c59... Being aware of these may give inspiration on what ways there are to fix 2038 related issues in MariaDB.
participants (2)
-
Otto Kekäläinen
-
Sergei Golubchik