Bug #4508 CONVERT_TZ() function with new time zone as param crashes server.
Submitted: 11 Jul 2004 11:25 Modified: 10 Aug 2004 19:44
Reporter: Dmitry Lenev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.3 OS:Linux (Linux)
Assigned to: Dmitry Lenev CPU Architecture:Any

[11 Jul 2004 11:25] Dmitry Lenev
Description:
When CONVERT_TZ() is used 
a) with some time zone which was not mentioned in interaction with server before (and so is not loaded into time zone descriptions cache) 
b) with timestamp field as first parameter
server crashes.

How to repeat:
create table testts (ts timestamp);
insert into testts values ();
select convert_tz(ts, "UTC", "Europe/Moscow") from testts;
# server crashes here

Suggested fix:
After initial investigation it turned out that there is a problem with code responsible for dyncamical loading of time zone which manifistates itself in CONVERT_TZ() function. Instead of opening time zone tables in a separate step inside calculation of this function we should open them before query execution with rest of the tables...
[10 Aug 2004 19:44] Dmitry Lenev
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

ChangeSet 1.1936.7.1 2004/08/10 12:42:31 dlenev@brandersnatch.localdomain
  Fix for bug #4508 "CONVERT_TZ() function with new time zone as param crashes server".
  Instead of trying to open time zone tables during calculation of CONVERT_TZ() function
  or setting of @@time_zone variable we should open and lock them with the rest of 
  statement's table (so we should add them to global table list) and after that use such 
  pre-opened tables for loading info about time zones.