1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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.
This commit is contained in:
dlenev@brandersnatch.localdomain
2004-08-10 12:42:31 +04:00
parent bcbbfc3bb8
commit f49d4f5350
20 changed files with 314 additions and 198 deletions

View File

@@ -1897,7 +1897,8 @@ mysql_execute_command(THD *thd)
#endif
}
#endif /* !HAVE_REPLICATION */
if (&lex->select_lex != lex->all_selects_list &&
if ((&lex->select_lex != lex->all_selects_list ||
lex->time_zone_tables_used) &&
lex->unit.create_total_list(thd, lex, &tables))
DBUG_VOID_RETURN;
@@ -3875,6 +3876,7 @@ mysql_init_query(THD *thd, uchar *buf, uint length)
lex->lock_option= TL_READ;
lex->found_colon= 0;
lex->safe_to_cache_query= 1;
lex->time_zone_tables_used= 0;
lex_start(thd, buf, length);
thd->select_number= lex->select_lex.select_number= 1;
thd->free_list= 0;