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

Exchange partition with virtual columns fails

    XMLWordPrintable

Details

    Description

      When exchanging partitions in 10.11.7 it throws `ERROR 1736 (HY000): Tables have different definitions`, even if they are identical. The only factor that i can see to determine when it works and when it doesn't is whether the column expression references another column. This works fine in 10.11.6 and this is a very frequent operation for us. We create a working table for a new version of the data for a partition, then swap it in after it has been generated.

      I suspect it is a result of MDEV-28127

      examples:

      -- this fails when the virtual persistent column
      -- references another column
      create or replace table t1(
        id int primary key,
        col1 int,
        col2 boolean as (col1 is null))
        partition by list (id) ( partition p1 values in (1)
      );
       
      create or replace table t1_working like t1;
       
      alter table t1_working remove partitioning;
       
      alter table t1 exchange partition p1 with table t1_working;
       
      -- this works when the virtual persistent column
      -- does not reference another column
      create or replace table t2(
        id int primary key,
        col1 int,
        col2 boolean as (true))
        partition by list (id) ( partition p1 values in (1)
      );
       
      create or replace table t2_working like t2;
       
      alter table t2_working remove partitioning;
       
      alter table t2 exchange partition p1 with table t2_working;
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              jacob.williams Jacob Williams
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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