MDEV-38029 my_tzinfo-t fails for certain TZ values on musl #4452
+14
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The test fails for TZ values such as
PST8PDT(present but outdated in tzdb) and custom forms likeGST-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.
Release Notes
Fixed unittest my_tzinfo-t to pass on musl based Linux distributions such as Alpine
How can this PR be tested?
Run the test on affected distro, like I did
desktop:~/xxx$ ./unittest/mysys/my_tzinfo-t
1..38
ok 1 # skip no test for default timezone name UTC
ok 2 - GMT offset is whole number of minutes 0
ok 3 - UTC: Offset for timestamp 1690000000 is 0/0
ok 4 - tz abbreviation UTC
ok 5 - GMT offset is whole number of minutes 0
ok 6 - UTC: Offset for timestamp 1700000000 is 0/0
ok 7 - tz abbreviation UTC
ok 8 - GMT offset is whole number of minutes 0
ok 9 - UTC: Offset for timestamp 1763552561 is 0/0
ok 10 - tz abbreviation UTC
ok 11 - PST8PDT: timezone_name = PDT
ok 12 # skip musl UTC offset/abbreviation bug, tzname PST8PDT, see MDEV-38029
ok 13 # skip musl UTC offset/abbreviation bug, tzname PST8PDT, see MDEV-38029
ok 14 # skip musl UTC offset/abbreviation bug, tzname PST8PDT, see MDEV-38029
ok 15 # skip musl UTC offset/abbreviation bug, tzname PST8PDT, see MDEV-38029
ok 16 # skip musl UTC offset/abbreviation bug, tzname PST8PDT, see MDEV-38029
ok 17 # skip musl UTC offset/abbreviation bug, tzname PST8PDT, see MDEV-38029
ok 18 - GMT: timezone_name = GMT
ok 19 - GMT: Summer GMT offset 0
ok 20 - GMT: Offset for timestamp 1690000000 is 0/0
ok 21 - GMT: Summer time abbreviation GMT
ok 22 - GMT: Winter GMT offset 0
ok 23 - GMT: Offset for timestamp 1700000000 is 0/0
ok 24 - GMT: Winter time abbreviation GMT
ok 25 - GST-1GDT: timezone_name = GDT
ok 26 # skip musl UTC offset/abbreviation bug, tzname GST-1GDT, see MDEV-38029
ok 27 # skip musl UTC offset/abbreviation bug, tzname GST-1GDT, see MDEV-38029
ok 28 # skip musl UTC offset/abbreviation bug, tzname GST-1GDT, see MDEV-38029
ok 29 # skip musl UTC offset/abbreviation bug, tzname GST-1GDT, see MDEV-38029
ok 30 # skip musl UTC offset/abbreviation bug, tzname GST-1GDT, see MDEV-38029
ok 31 # skip musl UTC offset/abbreviation bug, tzname GST-1GDT, see MDEV-38029
ok 32 - IST-5:30: timezone_name = IST
ok 33 - IST-5:30: Summer GMT offset 19800
ok 34 - IST-5:30: Offset for timestamp 1690000000 is 19800/19800
ok 35 - IST-5:30: Summer time abbreviation IST
ok 36 - IST-5:30: Winter GMT offset 19800
ok 37 - IST-5:30: Offset for timestamp 1700000000 is 19800/19800
ok 38 - IST-5:30: Winter time abbreviation IST
Test took 0.00 sec
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
Basing the PR against the correct MariaDB version
mainbranch.PR quality check