mariadb: Add timezone information to database

This commit is contained in:
Timo Makinen 2023-07-23 17:12:41 +00:00
parent 4ef795d02e
commit 9c44999682
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,22 @@
#!/bin/sh
set -eu
_timestamp=$(cat <<EOF | mysql -s
SELECT
UNIX_TIMESTAMP(UPDATE_TIME)
FROM
information_schema.tables
WHERE
TABLE_SCHEMA='mysql' AND TABLE_NAME LIKE 'time_zone';
EOF
)
if [ "$(rpm -q --queryformat "%{installtime}" tzdata)" -gt "$_timestamp" ]; then
{
echo "WARNING: MariaDB timezone data older than sytem timezones"
echo ""
echo "Run: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql"
} 1>&2
exit 1
fi