summaryrefslogtreecommitdiff
path: root/sql/tztime.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-02-28 19:00:58 +0100
committerSergei Golubchik <sergii@pisem.net>2013-02-28 19:00:58 +0100
commit5dec570d7c1e2a39b67503a90d2d7905ac4dbb44 (patch)
treed206f4c8848a50899d8d0656e8c8212189365ace /sql/tztime.cc
parent5138bf4238d4a8850ee364a3adf10dc2687af67c (diff)
parent027e34e13b8d0baed51e26be8d4ffd86d9b3b041 (diff)
downloadmariadb-git-5dec570d7c1e2a39b67503a90d2d7905ac4dbb44.tar.gz
5.1 -> 5.2 merge
Diffstat (limited to 'sql/tztime.cc')
-rw-r--r--sql/tztime.cc21
1 files changed, 3 insertions, 18 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 6bb295b98c6..4beaea71e27 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1808,7 +1808,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;
@@ -1818,7 +1818,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
@@ -1838,22 +1839,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).