[MDEV-33154] Confusing error ER_PARTITION_INSTEAD_OF_SUBPARTITION upon trying to convert table to partition Created: 2024-01-02  Updated: 2024-01-02

Status: Open
Project: MariaDB Server
Component/s: Partitioning
Affects Version/s: 10.7, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4
Fix Version/s: 10.11, 11.0, 11.1, 11.2, 11.3

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Unresolved Votes: 0
Labels: None

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

 Description   

--source include/have_partition.inc
 
create table t (a int, b int)
partition by range (a)
subpartition by hash(b) subpartitions 2 (
 partition p0 values less than (100)
);
create table t1 (a int, b int);
alter table t convert table t1 to partition p2 values less than (maxvalue);
 
# Cleanup
drop table if exists t, t1;

11.4 875377ad824473774c833b1aff4346ba3133f092

query 'alter table t convert table t1 to partition p2 values less than (maxvalue)' failed:
ER_PARTITION_INSTEAD_OF_SUBPARTITION (1734): Subpartitioned table, use subpartition instead of partition

There should probably be some error, at least I don't see an obvious way to convert a table to a partition in a subpartitioned table. However, it should be more like "not applicable to subpartitioned table" or something like that.

Maybe the logic was copied from EXCHANGE PARTITION. However, there the error makes sense, because indeed, a subpartition can be replaced with a table.


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