summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-12-24 18:39:00 +0100
committerSergei Golubchik <serg@mariadb.org>2017-12-25 15:18:21 +0100
commit5377242fff5d2260510e65c58e4e52d7c4b222f6 (patch)
tree33a6811ae6c700d0971a2abfb2e0102105d78742 /sql
parent6d8b1bd6204899afa57121cf1f7adf305118d380 (diff)
downloadmariadb-git-5377242fff5d2260510e65c58e4e52d7c4b222f6.tar.gz
MDEV-14026 ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for partitioned MyISAM table with DATA DIRECTORY/INDEX DIRECTORY options
set data_file_name and index_file_name in HA_CREATE_INFO before calling check_if_incompatible_data()
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_partition.cc34
1 files changed, 25 insertions, 9 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 459af18f737..34c253cc48a 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -8133,20 +8133,36 @@ uint ha_partition::alter_table_flags(uint flags)
bool ha_partition::check_if_incompatible_data(HA_CREATE_INFO *create_info,
uint table_changes)
{
- handler **file;
- bool ret= COMPATIBLE_DATA_YES;
-
/*
The check for any partitioning related changes have already been done
in mysql_alter_table (by fix_partition_func), so it is only up to
the underlying handlers.
*/
- for (file= m_file; *file; file++)
- if ((ret= (*file)->check_if_incompatible_data(create_info,
- table_changes)) !=
- COMPATIBLE_DATA_YES)
- break;
- return ret;
+ List_iterator<partition_element> part_it(m_part_info->partitions);
+ HA_CREATE_INFO dummy_info= *create_info;
+ uint i=0;
+ while (partition_element *part_elem= part_it++)
+ {
+ if (m_is_sub_partitioned)
+ {
+ List_iterator<partition_element> subpart_it(part_elem->subpartitions);
+ while (partition_element *sub_elem= subpart_it++)
+ {
+ dummy_info.data_file_name= sub_elem->data_file_name;
+ dummy_info.index_file_name= sub_elem->index_file_name;
+ if (m_file[i++]->check_if_incompatible_data(&dummy_info, table_changes))
+ return COMPATIBLE_DATA_NO;
+ }
+ }
+ else
+ {
+ dummy_info.data_file_name= part_elem->data_file_name;
+ dummy_info.index_file_name= part_elem->index_file_name;
+ if (m_file[i++]->check_if_incompatible_data(&dummy_info, table_changes))
+ return COMPATIBLE_DATA_NO;
+ }
+ }
+ return COMPATIBLE_DATA_YES;
}