mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
BUG#17127: Crash if wrong use of VALUES for list partition
mysql-test/r/partition.result: Added a number of new test cases where errors in use of VALUES LESS THAN and VALUES IN is happening for ALTER TABLE mysql-test/t/partition.test: Added a number of new test cases where errors in use of VALUES LESS THAN and VALUES IN is happening for ALTER TABLE sql/sql_partition.cc: Check for errors with VALUES * sql/sql_yacc.yy: Add state to part_type when doing ALTER TABLE for partitioning
This commit is contained in:
@@ -4132,6 +4132,34 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
|
||||
((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0);
|
||||
DBUG_PRINT("info", ("*fast_alter_partition: %d flags: 0x%x",
|
||||
*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))
|
||||
{
|
||||
if (thd->lex->part_info->part_type == RANGE_PARTITION)
|
||||
{
|
||||
my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
|
||||
"RANGE", "LESS THAN");
|
||||
}
|
||||
else if (thd->lex->part_info->part_type == LIST_PARTITION)
|
||||
{
|
||||
DBUG_ASSERT(thd->lex->part_info->part_type == LIST_PARTITION);
|
||||
my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
|
||||
"LIST", "IN");
|
||||
}
|
||||
else if (tab_part_info->part_type == RANGE_PARTITION)
|
||||
{
|
||||
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
|
||||
"RANGE", "LESS THAN");
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_ASSERT(tab_part_info->part_type == LIST_PARTITION);
|
||||
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
|
||||
"LIST", "IN");
|
||||
}
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
if (alter_info->flags & ALTER_ADD_PARTITION)
|
||||
{
|
||||
/*
|
||||
|
Reference in New Issue
Block a user