diff options
author | Monty <monty@mariadb.org> | 2015-08-27 10:07:32 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-08-27 22:29:11 +0300 |
commit | 3bca8db4f90cd9a505b99009c44594c0fb1ec353 (patch) | |
tree | a96ef13450eeb6a9b420e592534044b44872f97e /sql/unireg.cc | |
parent | 3cb578c001b2feabd2410f281d20eb6566371453 (diff) | |
download | mariadb-git-3bca8db4f90cd9a505b99009c44594c0fb1ec353.tar.gz |
MDEV-6152: Remove calls to current_thd while creating Item
- Part 4: Removing calls to sql_alloc() and sql_calloc()
Other things:
- Added current_thd in some places to make it clear that it's called (easier to remove later)
- Move memory allocation from Item_func_case::fix_length_and_dec() to Item_func_case::fix_fields()
- Added mem_root to some new calls
- Fixed some wrong UNINIT_VAR() calls
- Fixed a bug in generate_partition_syntax() in case of errors
- Added mem_root to argument to new thread_info
- Simplified my_parse_error() call in sql_yacc.yy
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc index ad35368a755..49503794c38 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -583,14 +583,14 @@ static bool pack_header(THD *thd, uchar *forminfo, The HEX representation is created from this copy. */ field->save_interval= field->interval; - field->interval= (TYPELIB*) sql_alloc(sizeof(TYPELIB)); + field->interval= (TYPELIB*) thd->alloc(sizeof(TYPELIB)); *field->interval= *field->save_interval; field->interval->type_names= - (const char **) sql_alloc(sizeof(char*) * - (field->interval->count+1)); + (const char **) thd->alloc(sizeof(char*) * + (field->interval->count+1)); field->interval->type_names[field->interval->count]= 0; field->interval->type_lengths= - (uint *) sql_alloc(sizeof(uint) * field->interval->count); + (uint *) thd->alloc(sizeof(uint) * field->interval->count); for (uint pos= 0; pos < field->interval->count; pos++) { @@ -600,8 +600,8 @@ static bool pack_header(THD *thd, uchar *forminfo, length= field->save_interval->type_lengths[pos]; hex_length= length * 2; field->interval->type_lengths[pos]= hex_length; - field->interval->type_names[pos]= dst= (char*) sql_alloc(hex_length + - 1); + field->interval->type_names[pos]= dst= + (char*) thd->alloc(hex_length + 1); octet2hex(dst, src, length); } } |