Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-9237

Support partitioning for underlying MERGE tables

    XMLWordPrintable

Details

    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

      Attachments

        Activity

          People

            serg Sergei Golubchik
            jamesrleu James R. Leu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.