diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-02-28 21:48:47 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-02-28 21:48:47 +0100 |
commit | c4341d50950224bb4e976fd1aac23dddc7d78f71 (patch) | |
tree | 9fa2f700cbe0283ffaf3d7da57238fb4f7e96e25 /sql/tztime.cc | |
parent | 0d55ebc05ea303a9aea44d953abbc335c12c9330 (diff) | |
parent | 5dec570d7c1e2a39b67503a90d2d7905ac4dbb44 (diff) | |
download | mariadb-git-c4341d50950224bb4e976fd1aac23dddc7d78f71.tar.gz |
5.2 -> 5.3
Diffstat (limited to 'sql/tztime.cc')
-rw-r--r-- | sql/tztime.cc | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc index eed575957b6..469400ec69f 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1820,7 +1820,7 @@ static Time_zone* tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) { TABLE *table= 0; - TIME_ZONE_INFO *tz_info; + TIME_ZONE_INFO *tz_info= NULL; Tz_names_entry *tmp_tzname; Time_zone *return_val= 0; int res; @@ -1830,7 +1830,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) uchar keybuff[32]; Field *field; String abbr(buff, sizeof(buff), &my_charset_latin1); - char *alloc_buff, *tz_name_buff; + char *alloc_buff= NULL; + char *tz_name_buff= NULL; /* Temporary arrays that are used for loading of data for filling TIME_ZONE_INFO structure @@ -1850,22 +1851,6 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) DBUG_ENTER("tz_load_from_open_tables"); - /* Prepare tz_info for loading also let us make copy of time zone name */ - if (!(alloc_buff= (char*) alloc_root(&tz_storage, sizeof(TIME_ZONE_INFO) + - tz_name->length() + 1))) - { - sql_print_error("Out of memory while loading time zone description"); - return 0; - } - tz_info= (TIME_ZONE_INFO *)alloc_buff; - bzero(tz_info, sizeof(TIME_ZONE_INFO)); - tz_name_buff= alloc_buff + sizeof(TIME_ZONE_INFO); - /* - By writing zero to the end we guarantee that we can call ptr() - instead of c_ptr() for time zone name. - */ - strmake(tz_name_buff, tz_name->ptr(), tz_name->length()); - /* Let us find out time zone id by its name (there is only one index and it is specifically for this purpose). |