Bug #74429 system_time_zone generates warning if zone name contains non-ascii chars

Submitted: 17 Oct 2014 11:25
Reporter: Filipe Silva Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:5.7.5 OS:Any
Assigned to: CPU Architecture:Any

[17 Oct 2014 11:25] Filipe Silva
Description:
Time zone setting on Windows non-English language may contain non-ASCII chars, e.g. "Mitteleuropäische Sommerzeit" on German translated Windows 7 Professional. When this happens 'system_time_zone' is truncated at the 1st non-ASCII char and consulting it generates a warning. Theoretically this can happen in other systems too.

This is particularly relevant for Connector/J since it consults this value on every new connection and the warning keeps showing up in the logs.

Although the "How To Repeat" shows an example ran on a MySQL 5.1.73, the same results were verified with the latest MySQL 5.7 sources, so the bug may exist in all current versions.

Related bugs:
- http://clustra.no.oracle.com/orabugs/19582659
- http://clustra.no.oracle.com/orabugs/11761893 (derived from the original report)

How to repeat:
Set the time zone to "Mitteleuropäische Sommerzeit" on a Windows 7 with German language pack.

Betriebssystemname
	Microsoft Windows 7 Professional
Version
	6.1.7601 Service Pack 1 Build 7601
(...)
Zeitzone
	Mitteleuropäische Sommerzeit

mysql> show variables like "%version%";
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| protocol_version        | 10                           |
| version                 | 5.1.73-community             |
| version_comment         | MySQL Community Server (GPL) |
| version_compile_machine | unknown                      |
| version_compile_os      | Win64                        |
+-------------------------+------------------------------+
5 rows in set (0.00 sec)

mysql> show variables like "%char%";
+--------------------------+---------------------------------------------------------+
| Variable_name            | Value                                                   |
+--------------------------+---------------------------------------------------------+
| character_set_client     | utf8                                                    |
| character_set_connection | utf8                                                    |
| character_set_database   | latin1                                                  |
| character_set_filesystem | binary                                                  |
| character_set_results    | utf8                                                    |
| character_set_server     | utf8                                                    |
| character_set_system     | utf8                                                    |
| character_sets_dir       | C:\Program Files\MySQL\MySQL Server 5.1\share\charsets\ |
+--------------------------+---------------------------------------------------------+
8 rows in set (0.00 sec)

mysql> show variables like "%zone%";
+------------------+-------------+
| Variable_name    | Value       |
+------------------+-------------+
| system_time_zone | Mitteleurop |
| time_zone        | SYSTEM      |
+------------------+-------------+
2 rows in set, 1 warning (0.01 sec)

mysql> show warnings;
+---------+------+-----------------------------------------------------------------------------+
| Level   | Code | Message                                                                     |
+---------+------+-----------------------------------------------------------------------------+
| Warning | 1366 | Incorrect string value: '\xE4ische...' for column 'VARIABLE_VALUE' at row 1 |
+---------+------+-----------------------------------------------------------------------------+
1 row in set (0.00 sec)

Suggested fix:
-
[17 Jun 2016 14:32] Sylvain D
This is still occurring with mysql 5.7.11
Our computers are installed with windows 7 french

show variables;
SHOW WARNINGS LIMIT 5; 
Warning	1366	Incorrect string value: '\x92\xE9t\xE9)' for column 'VARIABLE_VALUE' at row 478

row 478 is system_time_zone

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.