[MDEV-9237] Support partitioning for underlying MERGE tables Created: 2015-12-04  Updated: 2017-05-29  Resolved: 2017-05-29

Status: Closed
Project: MariaDB Server
Component/s: Partitioning
Fix Version/s: N/A

Type: Task Priority: Minor
Reporter: James R. Leu Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

To reproduce setup MERGE table as follows

CREATE DATABASE FOO;
USE FOO;
CREATE TABLE `Archive` (
  `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `alarmed` datetime DEFAULT NULL,
  PRIMARY KEY (`event_id`, `alarmed`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (TO_DAYS(alarmed))
(PARTITION p_2015_12 VALUES LESS THAN (736329) ENGINE = MyISAM,
PARTITION p_other VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;

CREATE DATABASE BAR;
USE BAR;
CREATE TABLE `Archive` (
  `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `alarmed` datetime DEFAULT NULL,
  PRIMARY KEY (`event_id`, `alarmed`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (TO_DAYS(alarmed))
(PARTITION p_2015_12 VALUES LESS THAN (736329) ENGINE = MyISAM,
PARTITION p_other VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;

CREATE DATABASE BAZ;
USE BAZ;
 
CREATE TABLE `Archive` (
  `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `alarmed` datetime DEFAULT NULL,
  PRIMARY KEY (`event_id`, `alarmed`)
) ENGINE=MERGE UNION(`FOO`.`History`,`BAR`.`History`);

Any select from the tables will produce an error

mysql> select * from Archive;
ERROR 1168 (HY000): Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist



 Comments   
Comment by James R. Leu [ 2015-12-04 ]

I also filed a bug report with MySQL, they have closed it as 'Not a Bug'. With that being the case, I would like to convert this to a feature request.

Comment by Sergei Golubchik [ 2017-05-29 ]

Sorry, but this cannot work. Partitioned tables technically use "partition" storage engine that in your case uses MyISAM for individual partitions.

MERGE is a group of MyISAM tables. You cannot create a MERGE of tables in any other storage engine, including "partition" storage engine.

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