summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-08-27 10:07:32 +0300
committerMonty <monty@mariadb.org>2015-08-27 22:29:11 +0300
commit3bca8db4f90cd9a505b99009c44594c0fb1ec353 (patch)
treea96ef13450eeb6a9b420e592534044b44872f97e /sql/ha_partition.cc
parent3cb578c001b2feabd2410f281d20eb6566371453 (diff)
downloadmariadb-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/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index ffe35392989..f85cdc73650 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1693,8 +1693,8 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
} while (++i < num_parts);
}
if (m_reorged_parts &&
- !(m_reorged_file= (handler**)sql_calloc(sizeof(handler*)*
- (m_reorged_parts + 1))))
+ !(m_reorged_file= (handler**) thd->calloc(sizeof(handler*)*
+ (m_reorged_parts + 1))))
{
mem_alloc_error(sizeof(handler*)*(m_reorged_parts+1));
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
@@ -1725,8 +1725,9 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
}
} while (++i < num_parts);
}
- if (!(new_file_array= (handler**)sql_calloc(sizeof(handler*)*
- (2*(num_remain_partitions + 1)))))
+ if (!(new_file_array= ((handler**)
+ thd->calloc(sizeof(handler*)*
+ (2*(num_remain_partitions + 1))))))
{
mem_alloc_error(sizeof(handler*)*2*(num_remain_partitions+1));
DBUG_RETURN(HA_ERR_OUT_OF_MEM);