1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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
This commit is contained in:
Monty
2015-08-27 10:07:32 +03:00
parent 3cb578c001
commit 3bca8db4f9
22 changed files with 296 additions and 253 deletions

View File

@@ -1756,7 +1756,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
goto end;
if (unlikely(set_up_partition_bitmaps(thd, part_info)))
goto end;
if (unlikely(part_info->set_up_charset_field_preps()))
if (unlikely(part_info->set_up_charset_field_preps(thd)))
{
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
goto end;
@@ -2653,8 +2653,7 @@ char *generate_partition_syntax(partition_info *part_info,
{
if (!use_sql_alloc)
my_free(buf);
else
buf= NULL;
buf= NULL;
}
else
buf[*buf_length]= 0;