mariadb: skip failing test on musl

There is a timezone related ptest that fails using musl-libc.
This has been reported to the mariadb developers[1], who came up with
the backported patch that's the subject of this change.

This patch skips the timezone related tests with musl, in case the
testcase uses a timezone that behaves differently with musl than on
other platforms.

[1]: https://jira.mariadb.org/browse/MDEV-38029

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Gyorgy Sarvari 2025-11-19 19:34:51 +01:00 committed by Khem Raj
parent 7a25981202
commit 940c916c74
No known key found for this signature in database
GPG Key ID: BB053355919D3314
3 changed files with 50 additions and 2 deletions

View File

@ -73,7 +73,7 @@ PTESTS_SLOW_META_OE = "\
"
PTESTS_SLOW_META_OE:append:x86 = " kernel-selftest"
PTESTS_SLOW_META_OE:append:x86-64 = " kernel-selftest"
PTESTS_SLOW_META_OE:remove:libc-musl = "kernel-selftest mariadb"
PTESTS_SLOW_META_OE:remove:libc-musl = "kernel-selftest"
PTESTS_PROBLEMS_META_OE = "\
keyutils \
@ -82,4 +82,4 @@ PTESTS_PROBLEMS_META_OE = "\
psqlodbc \
rsyslog \
"
PTESTS_PROBLEMS_META_OE:append:libc-musl = " jemalloc minicoredumper oprofile mariadb"
PTESTS_PROBLEMS_META_OE:append:libc-musl = " jemalloc minicoredumper oprofile"

View File

@ -27,6 +27,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
file://0001-Remove-x86-specific-loop-in-my_convert.patch \
file://0001-support-reproducible-builds.patch \
file://0001-storage-mroonga-CMakeLists.txt-fix-reproducible-buil.patch \
file://0001-MDEV-38029-my_tzinfo-t-fails-for-certain-TZ-values-o.patch \
"
SRC_URI[sha256sum] = "52fa4dca2c5f80afc1667d523a27c06176d98532298a6b0c31ed73505f49e15c"

View File

@ -0,0 +1,47 @@
From 61bc216ff9e1d0a8a7fafce57ba916018cd6ac6d Mon Sep 17 00:00:00 2001
From: Vladislav Vaintroub <vvaintroub@gmail.com>
Date: Wed, 19 Nov 2025 13:01:56 +0100
Subject: [PATCH] MDEV-38029 my_tzinfo-t fails for certain TZ values on musl
From: Vladislav Vaintroub <vvaintroub@gmail.com>
The test fails for TZ values such as `PST8PDT` (present but outdated in
tzdb) and custom forms like `GST-1GDT`. On musl, these values do not
trigger the expected DST transitions, leading to incorrect DST offsets
or abbreviations.
This appears to be a musl libc bug; the same TZ values behave correctly
elsewhere, including Windows. We work around it by skipping the
affected tests when musl is detected.
Upstream-Status: Submitted [https://github.com/MariaDB/server/pull/4452]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
unittest/mysys/my_tzinfo-t.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/unittest/mysys/my_tzinfo-t.c b/unittest/mysys/my_tzinfo-t.c
index b38ebd37..585d52f8 100644
--- a/unittest/mysys/my_tzinfo-t.c
+++ b/unittest/mysys/my_tzinfo-t.c
@@ -112,6 +112,20 @@ void test_timezone(const char *tz_env, const char **expected_tznames,
}
}
ok(found, "%s: timezone_name = %s", tz_env, timezone_name);
+
+#if defined __linux__ && !defined __GLIBC__ && !defined __UCLIBC__
+ /*
+ MUSL incorrectly calculates UTC offsets and abbreviations
+ for certain values of TZ (DST related). See MDEV-38029
+ Skip tests in this case.
+ */
+ if (!strcmp(tz_env, "PST8PDT") || !strcmp(tz_env, "GST-1GDT"))
+ {
+ skip(6, "musl UTC offset/abbreviation bug, tzname %s, see MDEV-38029", tz_env);
+ return;
+ }
+#endif
+
my_tzinfo(SUMMER_TIMESTAMP, &tz);
ok(summer_gmt_off == tz.seconds_offset, "%s: Summer GMT offset %ld", tz_env, tz.seconds_offset);
check_utc_offset(SUMMER_TIMESTAMP,tz.seconds_offset, tz_env);