diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-16 12:12:26 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-16 12:12:26 +0300 |
commit | af912664989e0c3ee9cdb6caf8ec439029e7405c (patch) | |
tree | 9ab694ec5d18e0ab998eb4f52ee86129e5fbd3ae /sql/sql_partition.cc | |
parent | 5679a2b6b342abc9d80bcf784a1a35f240be9d87 (diff) | |
parent | 6577a7a8f20538df80b851698e21095311aae190 (diff) | |
download | mariadb-git-af912664989e0c3ee9cdb6caf8ec439029e7405c.tar.gz |
Merge 10.3 into 10.4
In main.index_merge_myisam we remove the test that was added in
commit a2d24def8cc42d27c72d833abfb39ef24a2b96ba because
it duplicates the test case that was added in
commit 5af12e463549e4bbc2ce6ab720d78937d5e5db4e.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 82a77d3638f..e4015baa40c 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -6012,6 +6012,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 |