[MDEV-29841] Partition by system_time can be converted into table but not back Created: 2022-10-20  Updated: 2023-12-27  Resolved: 2022-10-31

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Versioned Tables
Affects Version/s: 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.11.1, 10.7.8, 10.8.7, 10.9.5, 10.10.3

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Aleksey Midenkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-22165 CONVERT TABLE: move in partition from... Closed

 Description   

CONVERT PARTITION / CONVERT TABLE is asymmetrical for system versioning. A partition can be converted into a table, but it doesn't work the other way round:

10.7 120a4caf

create or replace table t (a int) with system versioning partition by system_time limit 10 partitions 3;
alter table t convert partition p0 to table tp;
alter table t convert table tp to partition p0;
bug.t2                                   [ fail ]
        Test ended at 2022-10-21 00:36:09
 
CURRENT_TEST: bug.t2
mysqltest: At line 5: query 'alter table t convert table tp to partition p0' failed: ER_PARTITION_WRONG_TYPE (4113): Wrong partitioning type, expected type: `SYSTEM_TIME`



 Comments   
Comment by Aleksey Midenkov [ 2022-10-31 ]

Please review bb-10.7-midenok

Comment by Nikita Malyavin [ 2022-10-31 ]

approved

Comment by Marko Mäkelä [ 2022-11-10 ]

I had to revert commit 1 of 2 (changing error messages) because it broke builds with cmake -DPLUGIN_PARTITION=NO.

I think that the change needs to be implemented and reviewed in a separate ticket if it is considered useful.

Comment by Elena Stepanova [ 2023-12-27 ]

For the record (since the history of this JIRA item doesn't make any sense and can be confusing): converting a table to a system-time partition still does not work, the problem described here was never fixed even though the resolution says it was; all that was done is a change of the error code/message, which now says "CONVERT TABLE TO PARTITION can only be used on RANGE/LIST partitions" for the scenario from the description.

Generated at Thu Feb 08 10:11:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.