Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-25577

mariadb-tzinfo-to-sql generates superfluous warnings

Details

    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

      Attachments

        Issue Links

          Activity

            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?

            serg Sergei Golubchik added a comment - 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?
            lewart Daniel Lewart added a comment -

            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?

            lewart Daniel Lewart added a comment - 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?
            danblack Daniel Black added a comment - - edited

            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.

            danblack Daniel Black added a comment - - edited 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.
            lewart Daniel Lewart added a comment -

            Daniel,

            Good points!

            Attached is a patch which implements the simplified logic.

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

            lewart Daniel Lewart added a comment - Daniel, Good points! Attached is a patch which implements the simplified logic. Thank you! Dan Urbana, Illinois tztime-simplified.diff
            danblack Daniel Black added a comment -

            Thanks lewart. Will be included in the next releases.

            danblack Daniel Black added a comment - Thanks lewart . Will be included in the next releases.

            People

              danblack Daniel Black
              lewart Daniel Lewart
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.