[MDEV-12395] DROP PARTITION does not work as expected when table has DEFAULT LIST partition Created: 2017-03-29 Updated: 2017-04-07 Resolved: 2017-04-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Partitioning |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 10.2-ga | ||
| Issue Links: |
|
||||||||
| Description |
|
DROP PARTITION x is supposed to delete all data stored in the partition x. It is documented, for example, in MySQL manual, and probably hidden or implied here in the KB (for a note, there could be a better documentation for partition maintenance). Normally, it works this way – with RANGE partitioning, whether or not the MAXVALUE partition is involved.
It also works with LIST partitioning when the table only has "normal" list partitions:
But it does not work when a LIST-partitioned table has the DEFAULT-partition. In this case, when a "normal" partition is dropped, values are transferred to the default partition:
And if the default partition is being dropped, it causes an error:
|
| Comments |
| Comment by Oleksandr Byelkin [ 2017-04-04 ] |
|
revision-id: 1c60f292874f3b31580e6da27f0d1c74c3eccc80 (mariadb-10.2.4-122-g1c60f29)
Data loss in case of partituon removing is documented => do not try to prevent it — |
| Comment by Oleksandr Byelkin [ 2017-04-04 ] |
|
github tree bb-10.2- |
| Comment by Jacob Mathew (Inactive) [ 2017-04-04 ] |
|
The fix makes perfect sense to me. If the DEFAULT partition is dropped, then you lose its data and the ability to store values for which there is no explicitly defined partition. This is correct behavior. Good work. |