[MDEV-25577] mariadb-tzinfo-to-sql generates superfluous warnings Created: 2021-05-02  Updated: 2022-06-09  Resolved: 2022-06-09

Status: Closed
Project: MariaDB Server
Component/s: Platform Debian, Time zones
Affects Version/s: 10.3.27, 10.5.9
Fix Version/s: 10.3.36, 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2

Type: Bug Priority: Minor
Reporter: Daniel Lewart Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: beginner-friendly, mariadb-tzinfo-to-sql, mysql_tzinfo_to_sql, patch, timezones
Environment:

Debian 10 (buster)
Debian 11 (bullseye)


Attachments: File tztime-simplified.diff     File tztime.diff    
Issue Links:
Relates
relates to MDEV-14224 Running mysql_tzinfo_to_sql produces ... Closed

 Description   

This is an update to MDEV-14224, which was mistakenly Closed as "Not a Bug".

Either of the following commands:

    mariadb-tzinfo-to-sql /usr/share/zoneinfo > /dev/null
    mysql_tzinfo_to_sql   /usr/share/zoneinfo > /dev/null

generate the following superfluous warnings:

    Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
    Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
    Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.

The first file is installed by Debian and the other two are standard tzdata files.
They should not generate warnings unless verbose > 0.

Attached is a patch which silently skips the following standard files
(unless verbose > 0):

  • iso3166.tab
  • leap-seconds.list
  • leapseconds
  • tzdata.zi
  • zone.tab
  • zone1970.tab

Thank you!
Daniel Lewart
Urbana, Illinois



 Comments   
Comment by Sergei Golubchik [ 2021-05-05 ]

Do you suggest to have a hard-coded list of exceptions? Files that one can expect to find in the zoneinfo/ but that are not valid time zone files?

Comment by Daniel Lewart [ 2021-05-07 ]

Yes and Yes.

The list of exceptions (in my patch) are:

  • iso3166.tab
  • leap-seconds.list
  • leapseconds
  • tzdata.zi
  • zone.tab
  • zone1970.tab

All of them are standard tzdata files, except for leap-seconds.list, which is added by Debian.
It's possible that other distributions may have additional exceptions.
I looked at Fedora 34 and it has just the five from tzdata.
How else could the standard non-.tab files be skipped?

Comment by Daniel Black [ 2022-06-01 ]

Looks like it could be simplified to anything with an extension, as a TZ name isn't going to have a . + leapseconds (looking at debian's tzdata).

Adding to your use case, its a very noisy thing in MariaDB Docker Library containers that initialize timezones by default.

Comment by Daniel Lewart [ 2022-06-03 ]

Daniel,

Good points!

Attached is a patch which implements the simplified logic.

Thank you!
Dan
Urbana, Illinois
tztime-simplified.diff

Comment by Daniel Black [ 2022-06-09 ]

Thanks lewart. Will be included in the next releases.

Generated at Thu Feb 08 09:38:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.