[MDEV-10568] Implement support for ALTER TABLE ... {DISCARD|IMPORT} PARTITION Created: 2016-08-16 Updated: 2023-11-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Partitioning, Storage Engine - InnoDB |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 12 |
| Labels: | ddl, innodb, partitioning, upstream-fixed | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
MySQL 5.7 supports ALTER TABLE ... {DISCARD|IMPORT} PARTITION. The documentation explains how to use it here: https://dev.mysql.com/doc/refman/5.7/en/innodb-transportable-tablespace-examples.html Should MariaDB also support that? |
| Comments |
| Comment by Manuel Arostegui [ 2016-10-25 ] | |
|
What is the alternative to move partitioning if this is not implemented? | |
| Comment by Geoff Montee (Inactive) [ 2016-12-07 ] | |
|
You can import/export partitions without this feature using a workaround, but it can be a little tedious. I wrote a blog post about how to do so here: http://www.geoffmontee.com/importing-innodb-partitions-in-mysql-5-6-and-mariadb-10-010-1/ | |
| Comment by Manuel Arostegui [ 2016-12-15 ] | |
|
Thanks for the link. I have tried it but I am getting lots of
The columns are obviously the same and forcing a rebuild doesn't help anyways. On varchar columns, and I am importing between exactly the same server versions 10.1.19 | |
| Comment by Geoff Montee (Inactive) [ 2016-12-15 ] | |
|
That's a pretty strange error to see if the columns really are exactly the same. Since these are varchar columns, do you know if the character encoding is the same on both servers? If you want help tracking down the problem, feel free to post on the maria-discuss mailing list. | |
| Comment by Steve Ruby [ 2017-07-04 ] | |
|
A slightly different take on this the change in MySQL 5.7 also allows not just ALTER TABLE <table> DISCARD PARTITION <partitions> TABLESPACE for specific partitions. But seems to fix DISCARD TABLESPACE applied to the whole table as well which returns an error in Mariadb (10.2.6). Can we get that fix/improvement as well? | |
| Comment by Hartmut Holzgraefe [ 2021-07-26 ] | |
|
Maybe we should split this into two tickets, one for DISCARD/IMPORT support for partitioned tables in general, and one for being able to DISCARD/IMPORT specific partitions only? | |
| Comment by Marko Mäkelä [ 2023-09-26 ] | |
|
I see that there is a feature
I do not know if it is a viable work-around, but I would think using this syntax, you could export or import partitions as individual tables. From the InnoDB point of view, each partition or subpartition that stores data is a normal table that uses a funny name.
| |
| Comment by Marko Mäkelä [ 2023-11-03 ] | |
|
In |