[MDEV-14611] ALTER TABLE EXCHANGE PARTITION does not work properly when used with DATA DIRECTORY Created: 2017-12-08 Updated: 2020-08-25 Resolved: 2018-02-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Partitioning |
| Affects Version/s: | 10.1, 10.2.11, 10.2 |
| Fix Version/s: | 10.1.32 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | alter, data_directory, partitioning | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 10.2.13 | ||||||||||||
| Description |
|
ALTER TABLE EXCHANGE PARTITION does not work properly if the tables and partitions involved were created with the DATA DIRECTORY option specified. To reproduce, first create a data directory:
Then create a partitioned table that uses the new data directory:
And then create an identical non-partitioned table that uses the data directory:
And then swap the tablespace of this table with one of the partitions:
And then if you look at the definition of test_swap_part_data_dir, you can see that the DATA DIRECTORY value for partition p0001 is no longer correct:
Of course, this data directory doesn't even exist:
But surprisingly, the table can still be queried:
|
| Comments |
| Comment by Elena Stepanova [ 2017-12-11 ] | |
|
Such EXCHANGE isn't allowed in MariaDB 10.0 and MySQL, but in MariaDB 10.1+ the limitation was lifted (see | |
| Comment by Alexey Botchkov [ 2018-02-06 ] | |
|
Patch proposed. | |
| Comment by Alexey Botchkov [ 2018-02-06 ] | |
|
http://lists.askmonty.org/pipermail/commits/2018-February/011961.html | |
| Comment by Marko Mäkelä [ 2018-02-06 ] | |
|
Please push a fix to a bb-10.1- branch for validation, both InnoDB and XtraDB. Note that InnoDB source code uses TAB for indentation, instead of spaces. | |
| Comment by Alexey Botchkov [ 2018-02-07 ] | |
|
Updated patch. | |
| Comment by Marko Mäkelä [ 2018-02-08 ] | |
|
The code change looks OK, but the test is missing some replace_regexp:
I would also like to see SHOW CREATE TABLE t2, and I would like to have 2 more tests: exchange a partition that carries a DATA DIRECTORY clause with a table that is missing the clause, and back. (So, the SHOW CREATE TABLE for t1 and t2 should display the absence of a DATA DIRECTORY attribute when expected. If the enhanced test performs OK, this is OK to push without further review. | |
| Comment by Alexey Botchkov [ 2018-02-10 ] | |
|
http://lists.askmonty.org/pipermail/commits/2018-February/011981.html |