diff options
author | Daniel Lewart <lewart3@gmail.com> | 2022-06-09 13:20:37 +1000 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2022-06-09 13:20:37 +1000 |
commit | 2cd1edfc2176649cda412b2ff4f1075ad23448ba (patch) | |
tree | 850f83f76d337e2c58e58cfc7d9dab202b8d4f21 | |
parent | 9c207c88c1411d1e538e8412182311de63757771 (diff) | |
download | mariadb-git-2cd1edfc2176649cda412b2ff4f1075ad23448ba.tar.gz |
MDEV-25577 mariadb-tzinfo-to-sql generates superfluous warnings
The zoneinfo directory is littered with non-timezone information files.
These frequently contain extensions, not present in real timezone files.
Alo leapseconds is frequently there and is not a timezone file.
-rw-r--r-- | sql/tztime.cc | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc index dfd0301037f..ec9e68ee66d 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -2470,15 +2470,6 @@ MEM_ROOT tz_storage; char fullname[FN_REFLEN + 1]; char *root_name_end; -/* - known file types that exist in the zoneinfo directory that are safe to - silently skip -*/ -const char *known_extensions[]= { - ".tab", - NullS -}; - /* Recursively scan zoneinfo directory and print all found time zone @@ -2575,20 +2566,19 @@ scan_tz_dir(char * name_end, uint symlink_recursion_level, uint verbose) else { /* - Some systems (like debian, opensuse etc) have description - files (.tab). We skip these silently if verbose is > 0 + Some systems (like Debian, openSUSE, etc) have non-timezone files: + * iso3166.tab + * leap-seconds.list + * leapseconds + * tzdata.zi + * zone.tab + * zone1970.tab + We skip these silently unless verbose > 0. */ const char *current_ext= fn_ext(fullname); - my_bool known_ext= 0; + my_bool known_ext= strlen(current_ext) || + !strcmp(my_basename(fullname), "leapseconds"); - for (const char **ext= known_extensions ; *ext ; ext++) - { - if (!strcmp(*ext, current_ext)) - { - known_ext= 1; - break; - } - } if (verbose > 0 || !known_ext) { fflush(stdout); |