mirror of
https://github.com/MariaDB/server.git
synced 2025-07-21 23:50:01 +00:00
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
This commit is contained in:
@ -159,7 +159,7 @@ extern "C" void my_tzname(char* sys_timezone, size_t size)
|
||||
{
|
||||
/* TZ environment variable not set - return default timezone name*/
|
||||
UChar default_tzname[MAX_TIMEZONE_LEN];
|
||||
UErrorCode ec;
|
||||
UErrorCode ec= U_ZERO_ERROR;
|
||||
int32_t len=
|
||||
ucal_getDefaultTimeZone(default_tzname, MAX_TIMEZONE_LEN, &ec);
|
||||
if (U_SUCCESS(ec))
|
||||
|
Reference in New Issue
Block a user