Details
-
Bug
-
Status: In Testing (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 10.11, 11.4, 11.8
-
None
-
Not for Release Notes
Description
For not partitioned tables, engines currently read options from table->s->option_struct.
This doesn't work, if different partitions can have different options, because they share the same TABLE. For this reason option_struct is also stored per partition and per subpartition in partition_element. For engines to be able to find options without detecting what partition or subpartition it belongs to (some do that!), ha_partition does
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;
|
before invoking handler::ha_create of an individual partition.
This obviously can only work during creation, but an engine can technically consult its option_struct any time and when a TABLE_SHARE is used concurrently by many threads it cannot have its TABLE_SHARE::option_struct pointing to some individual partition. Same problem with the connect_string.
Let's
- rename TABLE_SHARE::option_struct to option_struct_table to emphasize that it's options for the whole table (and catch incorrect usages of it)
- rename partition_element::option_struct to option_struct_part, ditto
- introduce handler::option_struct which will point to option_struct_table or option_struct_part as appropriate, the handler can use it any time as needed. A handler should not use option_struct_table unless it really knows what it's doing and has verified that it doesn't break partitioning.
- move connect_string into option_struct
Attachments
Issue Links
- causes
-
MDEV-37827 ALTER/DROP SERVER requires FLUSH TABLES
-
- Open
-
-
MDEV-37833 testing of "partition attributes" changes
-
- In Progress
-
- relates to
-
MDEV-5271 Support engine-defined attributes per partition
-
- Closed
-
-
MDEV-37070 Implement table options to enable/disable features
-
- Open
-
- links to