From 4d5ae2b3258d0d4eb3addd61fdabf49d9a6314e7 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Thu, 13 Jan 2022 23:35:16 +0300 Subject: MDEV-27217 DELETE partition selection doesn't work for history partitions LIMIT history switching requires the number of history partitions to be marked for read: from first to last non-empty plus one empty. The least we can do is to fail with error message if the needed partition was not marked for read. As this is handler interface we require new handler error code to display user-friendly error message. Switching by INTERVAL works out-of-the-box with ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET error. --- sql/partition_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/partition_info.h') diff --git a/sql/partition_info.h b/sql/partition_info.h index 2aed6cbc5db..9b6a934da51 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -421,7 +421,7 @@ public: vers_info->limit= limit; return !limit; } - void vers_set_hist_part(THD *thd); + int vers_set_hist_part(THD *thd); bool vers_setup_expression(THD *thd, uint32 alter_add= 0); /* Stage 1. */ partition_element *get_partition(uint part_id) { -- cgit v1.2.1 From 50e66db018d0d0ee49fd2b7196f30ed4594dc2b3 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sat, 22 Jan 2022 06:59:40 +0400 Subject: MDEV-25917 create table like fails if source table is partitioned and engine is myisam or aria with data directory. Create table like removes data_file_path/index_file_path from the thd->work_partition_info. --- sql/partition_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/partition_info.h') diff --git a/sql/partition_info.h b/sql/partition_info.h index d42ef380c8c..edd1e610df5 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -281,7 +281,7 @@ public: } ~partition_info() {} - partition_info *get_clone(THD *thd); + partition_info *get_clone(THD *thd, bool empty_data_and_index_file= FALSE); bool set_named_partition_bitmap(const char *part_name, uint length); bool set_partition_bitmaps(TABLE_LIST *table_list); /* Answers the question if subpartitioning is used for a certain table */ -- cgit v1.2.1