diff options
author | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2021-11-05 16:39:28 +0900 |
---|---|---|
committer | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2021-12-01 23:01:29 +0900 |
commit | afb81948ac34f37469d43154892cd3b8753bace6 (patch) | |
tree | af3748dabaf70bed31f0eb35ccb555300a6fe709 /sql/ha_partition.cc | |
parent | 897d8c57b68858a58eea6cda4d971c3a94f6cc4a (diff) | |
download | mariadb-git-bb-10.8-mdev-5271.tar.gz |
MDEV-5271 Support engine-defined attributes per partitionbb-10.8-mdev-5271
Make it possible to specify engine-defined attributes on partitions
as well as tables.
If an engine-defined attribute is only specified at the table level,
it applies to all the partitions in the table.
This is a backward-compatible behavior.
If the same attribute is specified both at the table level and the
partition level, the per-partition one takes precedence.
So, we can consider per-table attributes as default values.
One cannot specify engine-defined attributes on subpartitions.
Implementation details:
* We store per-partition attributes in the partition_element class
because we already have the part_comment field, which is for
per-partition comments.
* In the case of ALTER TABLE statements, the partition_elements in
table->part_info is set up by mysql_unpack_partition().
So, we parse per-partition attributes after the call of the function.
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index f17abed82ff..85f2e5ac78e 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -2716,6 +2716,7 @@ register_query_cache_dependant_tables(THD *thd, 2) MAX_ROWS, MIN_ROWS on partition 3) Index file name on partition 4) Data file name on partition + 5) Engine-defined attributes on partition */ int ha_partition::set_up_table_before_create(TABLE *tbl, @@ -2753,6 +2754,10 @@ int ha_partition::set_up_table_before_create(TABLE *tbl, if (info->connect_string.length) info->used_fields|= HA_CREATE_USED_CONNECTION; tbl->s->connect_string= part_elem->connect_string; + if (part_elem->option_list) + tbl->s->option_list= part_elem->option_list; + if (part_elem->option_struct) + tbl->s->option_struct= part_elem->option_struct; DBUG_RETURN(0); } |