1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +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

@ -22484,7 +22484,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
another extra byte to not get warnings from purify in
Field_string::val_int
*/
if (!(tmp= (uchar*) sql_alloc(field->pack_length()+2)))
if (!(tmp= (uchar*) thd->alloc(field->pack_length()+2)))
goto err;
if (copy)
{
@ -22739,7 +22739,7 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
new_field->update_null_value();
List<Item> list;
list.push_back(new_field, thd->mem_root);
suv->set_arguments(list);
suv->set_arguments(thd, list);
item_field= suv;
}
else