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

Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä
2020-05-30 11:04:27 +03:00
67 changed files with 1680 additions and 476 deletions

View File

@ -5981,6 +5981,37 @@ the generated partition syntax in a correct manner.
*partition_changed= TRUE;
}
}
/*
Prohibit inplace when partitioned by primary key and the primary key is changed.
*/
if (!*partition_changed &&
tab_part_info->part_field_array &&
!tab_part_info->part_field_list.elements &&
table->s->primary_key != MAX_KEY)
{
if (alter_info->flags & (ALTER_DROP_SYSTEM_VERSIONING |
ALTER_ADD_SYSTEM_VERSIONING))
{
*partition_changed= true;
}
else
{
KEY *primary_key= table->key_info + table->s->primary_key;
List_iterator_fast<Alter_drop> drop_it(alter_info->drop_list);
const char *primary_name= primary_key->name.str;
const Alter_drop *drop;
drop_it.rewind();
while ((drop= drop_it++))
{
if (drop->type == Alter_drop::KEY &&
0 == my_strcasecmp(system_charset_info, primary_name, drop->name))
break;
}
if (drop)
*partition_changed= TRUE;
}
}
}
if (thd->work_part_info)
{
@ -6013,23 +6044,6 @@ the generated partition syntax in a correct manner.
}
}
// In case of PARTITION BY KEY(), check if primary key has changed
// System versioning also implicitly adds/removes primary key parts
if (alter_info->partition_flags == 0 && part_info->list_of_part_fields
&& part_info->part_field_list.elements == 0)
{
if (alter_info->flags & (ALTER_DROP_SYSTEM_VERSIONING |
ALTER_ADD_SYSTEM_VERSIONING))
*partition_changed= true;
List_iterator<Key> it(alter_info->key_list);
Key *key;
while((key= it++) && !*partition_changed)
{
if (key->type == Key::PRIMARY)
*partition_changed= true;
}
}
/*
Set up partition default_engine_type either from the create_info
or from the previus table