summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-11-18 23:54:01 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-11-26 11:34:16 +0400
commit753d1f868c0fd52c2ec44a97fe116c01a38d5ffd (patch)
tree15334b9db1e7dbba85c4486ec93c47f0dee59478 /sql/sql_partition.cc
parent0746a0770867b621cb4fee08239419bec69a2de8 (diff)
downloadmariadb-git-753d1f868c0fd52c2ec44a97fe116c01a38d5ffd.tar.gz
MDEV-8716 - Obsolete sql_calloc() in favor of THD::calloc() and thd_calloc()
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 16588871fd8..c155d74b7d8 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -255,7 +255,7 @@ static bool is_name_in_list(char *name, List<char> list_names)
FALSE Success
*/
-bool partition_default_handling(TABLE *table, partition_info *part_info,
+bool partition_default_handling(THD *thd, TABLE *table, partition_info *part_info,
bool is_create_table_ind,
const char *normalized_path)
{
@@ -283,7 +283,7 @@ bool partition_default_handling(TABLE *table, partition_info *part_info,
part_info->num_subparts= num_parts / part_info->num_parts;
}
}
- part_info->set_up_defaults_for_partitioning(table->file,
+ part_info->set_up_defaults_for_partitioning(thd, table->file,
NULL, 0U);
DBUG_RETURN(FALSE);
}
@@ -455,7 +455,7 @@ int get_part_for_delete(const uchar *buf, const uchar *rec0,
function.
*/
-static bool set_up_field_array(TABLE *table,
+static bool set_up_field_array(THD *thd, TABLE *table,
bool is_sub_part)
{
Field **ptr, *field, **field_array;
@@ -492,7 +492,7 @@ static bool set_up_field_array(TABLE *table,
DBUG_RETURN(result);
}
size_field_array= (num_fields+1)*sizeof(Field*);
- field_array= (Field**)sql_calloc(size_field_array);
+ field_array= (Field**) thd->calloc(size_field_array);
if (unlikely(!field_array))
{
mem_alloc_error(size_field_array);
@@ -617,7 +617,7 @@ static bool create_full_part_field_array(THD *thd, TABLE *table,
num_part_fields++;
}
size_field_array= (num_part_fields+1)*sizeof(Field*);
- field_array= (Field**)sql_calloc(size_field_array);
+ field_array= (Field**) thd->calloc(size_field_array);
if (unlikely(!field_array))
{
mem_alloc_error(size_field_array);
@@ -804,7 +804,7 @@ static void clear_field_flag(TABLE *table)
*/
-static bool handle_list_of_fields(List_iterator<char> it,
+static bool handle_list_of_fields(THD *thd, List_iterator<char> it,
TABLE *table,
partition_info *part_info,
bool is_sub_part)
@@ -865,7 +865,7 @@ static bool handle_list_of_fields(List_iterator<char> it,
}
}
}
- result= set_up_field_array(table, is_sub_part);
+ result= set_up_field_array(thd, table, is_sub_part);
end:
DBUG_RETURN(result);
}
@@ -1034,7 +1034,7 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
if ((!is_sub_part) && (error= check_signed_flag(part_info)))
goto end;
- result= set_up_field_array(table, is_sub_part);
+ result= set_up_field_array(thd, table, is_sub_part);
end:
end_lex_with_single_table(thd, table, old_lex);
#if !defined(DBUG_OFF)
@@ -1622,7 +1622,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
if (!is_create_table_ind ||
thd->lex->sql_command != SQLCOM_CREATE_TABLE)
{
- if (partition_default_handling(table, part_info,
+ if (partition_default_handling(thd, table, part_info,
is_create_table_ind,
table->s->normalized_path.str))
{
@@ -1641,7 +1641,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
if (part_info->list_of_subpart_fields)
{
List_iterator<char> it(part_info->subpart_field_list);
- if (unlikely(handle_list_of_fields(it, table, part_info, TRUE)))
+ if (unlikely(handle_list_of_fields(thd, it, table, part_info, TRUE)))
goto end;
}
else
@@ -1668,7 +1668,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
if (part_info->list_of_part_fields)
{
List_iterator<char> it(part_info->part_field_list);
- if (unlikely(handle_list_of_fields(it, table, part_info, FALSE)))
+ if (unlikely(handle_list_of_fields(thd, it, table, part_info, FALSE)))
goto end;
}
else
@@ -1690,7 +1690,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
if (part_info->column_list)
{
List_iterator<char> it(part_info->part_field_list);
- if (unlikely(handle_list_of_fields(it, table, part_info, FALSE)))
+ if (unlikely(handle_list_of_fields(thd, it, table, part_info, FALSE)))
goto end;
}
else
@@ -4976,7 +4976,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
}
alt_part_info->part_type= tab_part_info->part_type;
alt_part_info->subpart_type= tab_part_info->subpart_type;
- if (alt_part_info->set_up_defaults_for_partitioning(table->file, 0,
+ if (alt_part_info->set_up_defaults_for_partitioning(thd, table->file, 0,
tab_part_info->num_parts))
{
goto err;
@@ -5395,7 +5395,8 @@ state of p1.
DBUG_ASSERT(!alt_part_info->use_default_partitions);
/* We specified partitions explicitly so don't use defaults anymore. */
tab_part_info->use_default_partitions= FALSE;
- if (alt_part_info->set_up_defaults_for_partitioning(table->file, 0, 0))
+ if (alt_part_info->set_up_defaults_for_partitioning(thd, table->file, 0,
+ 0))
{
goto err;
}