Commit e1093e24 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: part_func_string and subpart_func_string

Remove now-unused part_func_string and subpart_func_string
from partition_info.
parent 785e2248
...@@ -1683,15 +1683,11 @@ bool partition_info::set_part_expr(THD *thd, char *start_token, Item *item_ptr, ...@@ -1683,15 +1683,11 @@ bool partition_info::set_part_expr(THD *thd, char *start_token, Item *item_ptr,
{ {
list_of_subpart_fields= FALSE; list_of_subpart_fields= FALSE;
subpart_expr= item_ptr; subpart_expr= item_ptr;
subpart_func_string= func_string;
subpart_func_len= expr_len;
} }
else else
{ {
list_of_part_fields= FALSE; list_of_part_fields= FALSE;
part_expr= item_ptr; part_expr= item_ptr;
part_func_string= func_string;
part_func_len= expr_len;
} }
return FALSE; return FALSE;
} }
......
...@@ -165,9 +165,6 @@ class partition_info : public Sql_alloc ...@@ -165,9 +165,6 @@ class partition_info : public Sql_alloc
longlong err_value; longlong err_value;
char* part_info_string; char* part_info_string;
char *part_func_string;
char *subpart_func_string;
partition_element *curr_part_elem; // part or sub part partition_element *curr_part_elem; // part or sub part
partition_element *current_partition; // partition partition_element *current_partition; // partition
part_elem_value *curr_list_val; part_elem_value *curr_list_val;
...@@ -188,8 +185,6 @@ class partition_info : public Sql_alloc ...@@ -188,8 +185,6 @@ class partition_info : public Sql_alloc
partition_type subpart_type; partition_type subpart_type;
uint part_info_len; uint part_info_len;
uint part_func_len;
uint subpart_func_len;
uint num_parts; uint num_parts;
uint num_subparts; uint num_subparts;
...@@ -257,13 +252,11 @@ class partition_info : public Sql_alloc ...@@ -257,13 +252,11 @@ class partition_info : public Sql_alloc
bitmaps_are_initialized(FALSE), bitmaps_are_initialized(FALSE),
list_array(NULL), err_value(0), list_array(NULL), err_value(0),
part_info_string(NULL), part_info_string(NULL),
part_func_string(NULL), subpart_func_string(NULL),
curr_part_elem(NULL), current_partition(NULL), curr_part_elem(NULL), current_partition(NULL),
curr_list_object(0), num_columns(0), table(NULL), curr_list_object(0), num_columns(0), table(NULL),
default_engine_type(NULL), default_engine_type(NULL),
part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION), part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION),
part_info_len(0), part_info_len(0),
part_func_len(0), subpart_func_len(0),
num_parts(0), num_subparts(0), num_parts(0), num_subparts(0),
count_curr_subparts(0), count_curr_subparts(0),
num_list_values(0), num_part_fields(0), num_subpart_fields(0), num_list_values(0), num_part_fields(0), num_subpart_fields(0),
......
...@@ -4110,39 +4110,6 @@ bool mysql_unpack_partition(THD *thd, ...@@ -4110,39 +4110,6 @@ bool mysql_unpack_partition(THD *thd,
DBUG_ASSERT(part_info->default_engine_type == default_db_type); DBUG_ASSERT(part_info->default_engine_type == default_db_type);
DBUG_ASSERT(part_info->default_engine_type->db_type != DB_TYPE_UNKNOWN); DBUG_ASSERT(part_info->default_engine_type->db_type != DB_TYPE_UNKNOWN);
DBUG_ASSERT(part_info->default_engine_type != partition_hton); DBUG_ASSERT(part_info->default_engine_type != partition_hton);
{
/*
This code part allocates memory for the serialised item information for
the partition functions. In most cases this is not needed but if the
table is used for SHOW CREATE TABLES or ALTER TABLE that modifies
partition information it is needed and the info is lost if we don't
save it here so unfortunately we have to do it here even if in most
cases it is not needed. This is a consequence of that item trees are
not serialisable.
*/
uint part_func_len= part_info->part_func_len;
uint subpart_func_len= part_info->subpart_func_len;
char *part_func_string= NULL;
char *subpart_func_string= NULL;
if ((part_func_len &&
!((part_func_string= (char*) thd->alloc(part_func_len)))) ||
(subpart_func_len &&
!((subpart_func_string= (char*) thd->alloc(subpart_func_len)))))
{
mem_alloc_error(part_func_len);
thd->free_items();
goto end;
}
if (part_func_len)
memcpy(part_func_string, part_info->part_func_string, part_func_len);
if (subpart_func_len)
memcpy(subpart_func_string, part_info->subpart_func_string,
subpart_func_len);
part_info->part_func_string= part_func_string;
part_info->subpart_func_string= subpart_func_string;
}
result= FALSE; result= FALSE;
end: end:
end_lex_with_single_table(thd, table, old_lex); end_lex_with_single_table(thd, table, old_lex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment