From 4b30ed55bd436f3c140c0052f54c035378a3168a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Feb 2006 12:01:14 -0600 Subject: [PATCH] moved prune_partition_set decl from handler.h to sql_partition.h during merge cleaned up some files from the partition code move sql/Makefile.am: break the long line onto the next line sql/partition_info.cpp: remove some old comments left behind sql/sql_partition.h: Moved from handler.h during merge --- sql/Makefile.am | 3 ++- sql/partition_info.cpp | 18 ++++++++++++------ sql/sql_partition.h | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sql/Makefile.am b/sql/Makefile.am index 685000e0546..ceddf6cf2a2 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -65,7 +65,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \ parse_file.h sql_view.h sql_trigger.h \ sql_array.h sql_cursor.h event.h event_priv.h \ - sql_plugin.h authors.h sql_partition.h partition_info.h partition_element.h + sql_plugin.h authors.h sql_partition.h partition_info.h \ + partition_element.h mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \ item.cc item_sum.cc item_buff.cc item_func.cc \ item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \ diff --git a/sql/partition_info.cpp b/sql/partition_info.cpp index 226ddd8f636..18c80d01b1b 100644 --- a/sql/partition_info.cpp +++ b/sql/partition_info.cpp @@ -191,7 +191,7 @@ end: bool partition_info::set_up_default_subpartitions(handler *file, ulonglong max_rows) { - uint i, j; //, no_parts, no_subparts; + uint i, j; char *default_name, *name_ptr; bool result= TRUE; partition_element *part_elem; @@ -200,16 +200,11 @@ bool partition_info::set_up_default_subpartitions(handler *file, if (no_subparts == 0) no_subparts= file->get_default_no_partitions(max_rows); -// no_parts= part_info->no_parts; - //no_subparts= part_info->no_subparts; if (unlikely((no_parts * no_subparts) > MAX_PARTITIONS)) { my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0)); goto end; } -// if (unlikely((!(default_name= - // create_default_partition_names(no_subparts, (uint)0, TRUE))))) - //goto end; i= 0; do { @@ -277,6 +272,17 @@ bool partition_info::set_up_defaults_for_partitioning(handler *file, DBUG_RETURN(FALSE); } +/* + A support function to check if a partition element's name is unique + + SYNOPSIS + has_unique_name() + partition_element element to check + + RETURN VALUES + TRUE Has unique name + FALSE Doesn't +*/ bool partition_info::has_unique_name(partition_element *element) { DBUG_ENTER("partition_info::has_unique_name"); diff --git a/sql/sql_partition.h b/sql/sql_partition.h index 37c8635dcb4..785af742a3a 100644 --- a/sql/sql_partition.h +++ b/sql/sql_partition.h @@ -92,6 +92,7 @@ int get_parts_for_update(const byte *old_data, byte *new_data, longlong *func_value); int get_part_for_delete(const byte *buf, const byte *rec0, partition_info *part_info, uint32 *part_id); +void prune_partition_set(const TABLE *table, part_id_range *part_spec); bool check_partition_info(partition_info *part_info,handlerton **eng_type, handler *file, ulonglong max_rows); bool fix_partition_func(THD *thd, const char *name, TABLE *table,