1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00
Commit Graph

3 Commits

Author SHA1 Message Date
Vladislav Vaintroub
59ee33e14e MDEV-32189 follow-up: Properly initialize UErrorCode for ucal_getDefaultTimeZone()
Initialize UErrorCode to U_ZERO_ERROR before passing it to
ucal_getDefaultTimeZone(), as required by the ICU conventions.

Passing an uninitialized status variable  leads to undefined behavior and
non-deterministic failures.

This issue was not observed on x64 builds, but appeared during
Windows/ARM64 CI testing. The lack of initialization led to
inconsistent fallback between ICU and  native Windows time zone.

mtr tests with restarts showed the alternation of system_time_zone,
as reported by check_testcase after the test.

-SYSTEM_TIME_ZONE	Coordinated Universal Time
+SYSTEM_TIME_ZONE	Etc/UTC
2025-05-26 11:59:59 +02:00
Vladislav Vaintroub
3fad2b1155 MDEV-33096 mysys/my_timezone.cc does not compile on AIX
AIX compilation failed, because glibc's non-standard extension to
`struct tm` were used - additional members tm_gmtoff and tm_zone.

The patch fixes it by adding corresponding compile-time check.

Additionally, for the calculation of GMT offset on AIX, a portable
variant of timegm() was required.Implementation here is inspired by
SergeyD's answer on Stackoverflow :
https://stackoverflow.com/questions/16647819/timegm-cross-platform
2023-12-22 13:17:55 +01:00
Vladislav Vaintroub
3424ed7d42 MDEV-32189 Use icu for timezones on windows
Use ICU to work with timezones, to retrieve current timezone name,
abbreviation, and offset from GMT. However in case TZ environment variable
is used to set timezone, and ICU does not have corresponding one,
C runtime functions will be used.

Moved some of timezone handling to mysys.
Added unit tests.
2023-11-21 21:35:02 +01:00