Commit 68ff7025 authored by unknown's avatar unknown

memory leak in tz code closed

(table opened in my_tz_init, was removed from thd->open_tables in
tz_load_from_db w/o being unlocked, so it was stayng in open_cache
forever preventing the latter from being free'd in table_cache_free)

parent f7b9e75b
...@@ -1498,7 +1498,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) ...@@ -1498,7 +1498,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
{ {
sql_print_error("Fatal error: Can't lock time zone table: %s", sql_print_error("Fatal error: Can't lock time zone table: %s",
thd->net.last_error); thd->net.last_error);
goto end_with_cleanup; goto end_with_close;
} }
...@@ -1563,6 +1563,9 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) ...@@ -1563,6 +1563,9 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
end_with_unlock: end_with_unlock:
mysql_unlock_tables(thd, lock); mysql_unlock_tables(thd, lock);
end_with_close:
close_thread_tables(thd);
thd->version--; /* Force close to free memory */ thd->version--; /* Force close to free memory */
end_with_setting_default_tz: end_with_setting_default_tz:
...@@ -1584,7 +1587,6 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) ...@@ -1584,7 +1587,6 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
if (return_val) if (return_val)
my_tz_free(); my_tz_free();
end: end:
close_thread_tables(thd);
delete thd; delete thd;
if (org_thd) if (org_thd)
org_thd->store_globals(); /* purecov: inspected */ org_thd->store_globals(); /* purecov: inspected */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment