diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-01-23 20:49:31 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-01-23 20:49:31 +0200 |
commit | c93405b7153df01362f9869bac7c2e305dd06af9 (patch) | |
tree | 8043dec44994d714d28873d30d15e81ef3f040e7 /sql/sql_partition.cc | |
parent | be21a113da9748d06739b6522ea898257970b1c5 (diff) | |
parent | 8637931f118b53ff6fdadf6006ccdb8dedd6f732 (diff) | |
download | mariadb-git-10.0-merge.tar.gz |
WIP Merge 5.5 into bb-10.0-vicentiu10.0-merge
Unresolved conflicts:
both modified: sql/item_cmpfunc.cc
both modified: sql/item_cmpfunc.h
both modified: sql/sql_partition.cc
both modified: storage/tokudb/CMakeLists.txt
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index dd1f60ec078..6bd107b08d9 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -283,7 +283,66 @@ bool partition_default_handling(TABLE *table, partition_info *part_info, } } part_info->set_up_defaults_for_partitioning(table->file, +<<<<<<< HEAD NULL, 0U); +======= + NULL, (uint)0); + DBUG_RETURN(FALSE); +} + + +/* + Check that the reorganized table will not have duplicate partitions. + + SYNOPSIS + check_reorganise_list() + new_part_info New partition info + old_part_info Old partition info + list_part_names The list of partition names that will go away and + can be reused in the new table. + + RETURN VALUES + TRUE Inacceptable name conflict detected. + FALSE New names are OK. + + DESCRIPTION + Can handle that the 'new_part_info' and 'old_part_info' the same + in which case it checks that the list of names in the partitions + doesn't contain any duplicated names. +*/ + +bool check_reorganise_list(partition_info *new_part_info, + partition_info *old_part_info, + List<char> list_part_names) +{ + uint new_count, old_count; + uint num_new_parts= new_part_info->partitions.elements; + uint num_old_parts= old_part_info->partitions.elements; + List_iterator<partition_element> new_parts_it(new_part_info->partitions); + bool same_part_info= (new_part_info == old_part_info); + DBUG_ENTER("check_reorganise_list"); + + new_count= 0; + do + { + List_iterator<partition_element> old_parts_it(old_part_info->partitions); + char *new_name= (new_parts_it++)->partition_name; + new_count++; + old_count= 0; + do + { + char *old_name= (old_parts_it++)->partition_name; + old_count++; + if (same_part_info && old_count == new_count) + break; + if (!(my_strcasecmp(system_charset_info, old_name, new_name))) + { + if (!is_name_in_list(old_name, list_part_names)) + DBUG_RETURN(TRUE); + } + } while (old_count < num_old_parts); + } while (new_count < num_new_parts); +>>>>>>> origin/5.5 DBUG_RETURN(FALSE); } |