diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index add9a3474af..e0b344849a7 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -445,6 +445,8 @@ alter table t1 add partition (partition p1 values less than (2)); ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition alter table t1 add partition (partition p1 values in (2)); ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition +drop table t1; +create table t1 (a int) partition by list (a) (partition p0 values in (1)); alter table t1 rebuild partition; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 254c6c753e2..0d550d6e5ad 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4135,7 +4135,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info, *fast_alter_partition, flags)); if (((alter_info->flags & ALTER_ADD_PARTITION) || (alter_info->flags & ALTER_REORGANIZE_PARTITION)) && - (thd->lex->part_info->part_type != tab_part_info->part_type)) + (thd->lex->part_info->part_type != tab_part_info->part_type) && + (thd->lex->part_info->part_type != NOT_A_PARTITION)) { if (thd->lex->part_info->part_type == RANGE_PARTITION) {