summaryrefslogtreecommitdiff
path: root/sql/tztime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/tztime.cc')
-rw-r--r--sql/tztime.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc
index c7a4ad049ec..650678c721b 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1581,17 +1581,17 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
lex_start(thd);
/* Init all memory structures that require explicit destruction */
- if (hash_init(&tz_names, &my_charset_latin1, 20,
- 0, 0, (hash_get_key) my_tz_names_get_key, 0, 0))
+ if (my_hash_init(&tz_names, &my_charset_latin1, 20,
+ 0, 0, (my_hash_get_key) my_tz_names_get_key, 0, 0))
{
sql_print_error("Fatal error: OOM while initializing time zones");
goto end;
}
- if (hash_init(&offset_tzs, &my_charset_latin1, 26, 0, 0,
- (hash_get_key)my_offset_tzs_get_key, 0, 0))
+ if (my_hash_init(&offset_tzs, &my_charset_latin1, 26, 0, 0,
+ (my_hash_get_key)my_offset_tzs_get_key, 0, 0))
{
sql_print_error("Fatal error: OOM while initializing time zones");
- hash_free(&tz_names);
+ my_hash_free(&tz_names);
goto end;
}
init_alloc_root(&tz_storage, 32 * 1024, 0);
@@ -1645,7 +1645,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
if (open_system_tables_for_read(thd, tz_tables, &open_tables_state_backup))
{
sql_print_warning("Can't open and lock time zone table: %s "
- "trying to live without them", thd->main_da.message());
+ "trying to live without them", thd->stmt_da->message());
/* We will try emulate that everything is ok */
return_val= time_zone_tables_exist= 0;
goto end_with_setting_default_tz;
@@ -1774,8 +1774,8 @@ void my_tz_free()
{
tz_inited= 0;
VOID(pthread_mutex_destroy(&tz_LOCK));
- hash_free(&offset_tzs);
- hash_free(&tz_names);
+ my_hash_free(&offset_tzs);
+ my_hash_free(&tz_names);
free_root(&tz_storage, MYF(0));
}
}
@@ -2267,9 +2267,9 @@ my_tz_find(THD *thd, const String *name)
if (!str_to_offset(name->ptr(), name->length(), &offset))
{
- if (!(result_tz= (Time_zone_offset *)hash_search(&offset_tzs,
- (const uchar *)&offset,
- sizeof(long))))
+ if (!(result_tz= (Time_zone_offset *)my_hash_search(&offset_tzs,
+ (const uchar *)&offset,
+ sizeof(long))))
{
DBUG_PRINT("info", ("Creating new Time_zone_offset object"));
@@ -2285,9 +2285,10 @@ my_tz_find(THD *thd, const String *name)
else
{
result_tz= 0;
- if ((tmp_tzname= (Tz_names_entry *)hash_search(&tz_names,
- (const uchar *)name->ptr(),
- name->length())))
+ if ((tmp_tzname= (Tz_names_entry *)my_hash_search(&tz_names,
+ (const uchar *)
+ name->ptr(),
+ name->length())))
result_tz= tmp_tzname->tz;
else if (time_zone_tables_exist)
{