Bug #19304 creating a merged table from partitioned tables does not work
Submitted: 24 Apr 2006 18:55 Modified: 31 May 2006 5:04
Reporter: Andy Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.10-beta OS:Linux (linux)
Assigned to: Mikael Ronström CPU Architecture:Any

[24 Apr 2006 18:55] Andy
Description:
If one creates a merged table from a group of partitioned tables, the create command succeeds   but if I try to describe or select from the merged table I get the following error:

ERROR 1017 (HY000): Can't find file: 't_merge' (errno: 2)

How to repeat:
create table t1 (
        a int default NULL
) ENGINE=MyISAM
PARTITION BY RANGE(a)
(
        PARTITION p1 VALUES LESS THAN (10),
        PARTITION p2 VALUES LESS THAN (100),
        PARTITION p3 VALUES LESS THAN MAXVALUE
);

create table t2 (
        a int default NULL
) ENGINE=MyISAM
PARTITION BY RANGE(a)
(
        PARTITION p1 VALUES LESS THAN (10),
        PARTITION p2 VALUES LESS THAN (100),
        PARTITION p3 VALUES LESS THAN MAXVALUE
);

create table t_merge (
        a int default NULL
) ENGINE=MRG_MyISAM UNION=(`t1`,`t2`)
PARTITION BY RANGE(a)
(
        PARTITION p1 VALUES LESS THAN (10),
        PARTITION p2 VALUES LESS THAN (100),
        PARTITION p3 VALUES LESS THAN MAXVALUE
);

desc t_merge\G;

select * from t_merge;

Suggested fix:
Either this is suppose to work and should be fixed, or it should be documented that you can't create a merged table using partitioned tables.
[24 Apr 2006 19:23] MySQL Verification Team
Thank you for the bug report.
[24 May 2006 11:52] Mikael Ronström
Reviewed by Sergei Gluhov
[26 May 2006 17:22] Mikael Ronström
Will appear in 5.1.12
[30 May 2006 7:29] Mikael Ronström
The solution was that you cannot have a partitioned table with merge partitions.
[31 May 2006 5:04] Jon Stephens
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

Additional info:

Documented as limitation on partitioned tables. Closed.