summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-25 21:57:52 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-25 21:57:52 +0300
commitfbe2712705d464bf8488df249c36115e2c1f63f7 (patch)
tree274e728c719611769288afcb10f79549f6e11f8c /sql/sql_partition.cc
parent62903434eb009cb0bcd5003b0a45914bd4c09886 (diff)
parenta19782522b1eac52d72f5e787b5d96f1fd1a2cb7 (diff)
downloadmariadb-git-fbe2712705d464bf8488df249c36115e2c1f63f7.tar.gz
Merge 10.4 into 10.5
The functional changes of commit 5836191c8f0658d5d75484766fdcc3d838b0a5c1 (MDEV-21168) are omitted due to MDEV-742 having addressed the issue.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index de2d5c2f253..d6c7066e655 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -5915,6 +5915,24 @@ the generated partition syntax in a correct manner.
*partition_changed= true;
}
}
+
+ // 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