Bug #63376 | CONVERT_TZ should fail on empty mysql.time_zone table, currently it returns NULL | ||
---|---|---|---|
Submitted: | 22 Nov 2011 8:16 | Modified: | 23 Nov 2011 14:51 |
Reporter: | Alexander Petrossian | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.1.52, 5.5.17 | OS: | Any (-enterprise-commercial-pro) |
Assigned to: | CPU Architecture: | Any |
[22 Nov 2011 8:16]
Alexander Petrossian
[23 Nov 2011 14:51]
Valeriy Kravchuk
Our manual, http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_convert-tz, clearly says: "This function returns NULL if the arguments are invalid." If time_zone table is empty, then all time zones are unknown (invalid) arguments, hence the results: mysql> SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET'); +-----------------------------------------------+ | CONVERT_TZ('2004-01-01 12:00:00','GMT','MET') | +-----------------------------------------------+ | NULL | +-----------------------------------------------+ 1 row in set (0.08 sec) So, formally this is not a bug. But I'd also prefer to get a warning at least in this case (if not error message), not just NULL silently. So, I think this is a valid feature request.
[8 Jun 2017 14:33]
Abel Osorio
The Timezones table MUST BE loaded at installation time (by MySQL). Other solution could be that convert_tz to print a WARNING message indicating that Timezones table is empty. BR, Abel