mirror of
https://github.com/MariaDB/server.git
synced 2025-11-09 11:41:36 +03:00
Merge branch '11.4' into bb-11.8-release
This commit is contained in:
@@ -4859,6 +4859,21 @@ static void check_datadir_altered_for_innodb(THD *thd,
|
||||
}
|
||||
|
||||
|
||||
static bool check_name_in_fields(const Field * const *fields, Lex_ident_column &name)
|
||||
{
|
||||
if (!fields)
|
||||
return FALSE;
|
||||
|
||||
for (; *fields; fields++)
|
||||
{
|
||||
if ((*fields)->field_name.streq(name))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Prepare for ALTER TABLE of partition structure
|
||||
|
||||
@@ -4908,6 +4923,31 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
if (table->part_info && alter_info->partition_flags == 0 &&
|
||||
(alter_info->flags & ALTER_PARSER_DROP_COLUMN))
|
||||
{
|
||||
List_iterator<Alter_drop> drop_it(alter_info->drop_list);
|
||||
Alter_drop *drop;
|
||||
|
||||
while ((drop= drop_it++))
|
||||
{
|
||||
if (drop->type != Alter_drop::COLUMN)
|
||||
continue;
|
||||
|
||||
if (check_name_in_fields(table->part_info->part_field_array,
|
||||
drop->name) ||
|
||||
check_name_in_fields(table->part_info->subpart_field_array,
|
||||
drop->name))
|
||||
{
|
||||
/*
|
||||
The ALTER drops column used in partitioning expression.
|
||||
That cannot be done INPLACE.
|
||||
*/
|
||||
*partition_changed= TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
partition_info *alt_part_info= thd->lex->part_info;
|
||||
/*
|
||||
This variable is TRUE in very special case when we add only DEFAULT
|
||||
|
||||
Reference in New Issue
Block a user