1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

bug #15521 (Cannot reorganise a partition with a new name equal to the old name)

mysql-test/r/partition.result:
  result fixed
mysql-test/r/partition_mgm_err.result:
  result fixed
mysql-test/t/partition.test:
  test case added
mysql-test/t/partition_mgm_err.test:
  test modified to produce the declared error
sql/handler.h:
  check_reorganise_list interface
sql/sql_partition.cc:
  check_reorganise_list implementation
sql/sql_table.cc:
  now we call check_reorganise_list to do proper test.
  Also we should set right no_parts value as it can change here
This commit is contained in:
unknown
2005-12-15 15:24:35 +04:00
parent c5ebeb7969
commit 1b74cbd9d6
7 changed files with 128 additions and 3 deletions

View File

@ -3832,7 +3832,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
my_error(ER_ONLY_ON_RANGE_LIST_PARTITION, MYF(0), "REORGANISE");
DBUG_RETURN(TRUE);
}
if (is_partitions_in_table(alt_part_info, tab_part_info))
if (check_reorganise_list(alt_part_info, tab_part_info,
alter_info->partition_names))
{
my_error(ER_SAME_NAME_PARTITION, MYF(0));
DBUG_RETURN(TRUE);
@ -3901,6 +3902,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
}
partition_changed= TRUE;
tab_part_info->no_parts= tab_part_info->partitions.elements;
create_info->db_type= DB_TYPE_PARTITION_DB;
thd->lex->part_info= tab_part_info;
if (alter_info->flags == ALTER_ADD_PARTITION ||