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

Exchange partition with virtual columns fails

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

            If I had to guess I would bet that the column in the expression has the containing table in its definition which won't match.

            jacob.williams Jacob Williams added a comment - If I had to guess I would bet that the column in the expression has the containing table in its definition which won't match.

            Please review bb-10.5-midenok

            midenok Aleksey Midenkov added a comment - Please review bb-10.5-midenok

            Not familiar with the procedure here, but I can see that commit which looks like it would solve the issue, but I don't see an actual PR. Did you mean to create one?

            jacob.williams Jacob Williams added a comment - Not familiar with the procedure here, but I can see that commit which looks like it would solve the issue, but I don't see an actual PR. Did you mean to create one?

            jacob.williams, no, we do not require PRs internally, some developers like and create them, others don't. Jira automatically picks a corresponding commit, you can find it in the "Git Commits" tab.

            serg Sergei Golubchik added a comment - jacob.williams , no, we do not require PRs internally, some developers like and create them, others don't. Jira automatically picks a corresponding commit, you can find it in the "Git Commits" tab.

            At the time I submitted this I tested against several versions of the 11 series and didn't see it in the 11 builds, but now I do see that the current 11 series releases have the same issue. Appears it was introduced in 11.0.5/11.1.4/11.2.3 which were released on 2024-02-08 according to the release notes but were not pushed to dockerhub until early May.

            jacob.williams Jacob Williams added a comment - At the time I submitted this I tested against several versions of the 11 series and didn't see it in the 11 builds, but now I do see that the current 11 series releases have the same issue. Appears it was introduced in 11.0.5/11.1.4/11.2.3 which were released on 2024-02-08 according to the release notes but were not pushed to dockerhub until early May.

            commit 46e40bb5 is ok to push

            nikitamalyavin Nikita Malyavin added a comment - commit 46e40bb5 is ok to push

            midenok, could you please take a look at MDEV-35612, while you still remember all the context?

            serg Sergei Golubchik added a comment - midenok , could you please take a look at MDEV-35612 , while you still remember all the context?

            Requested change for local mem_root fails in MSAN.
            Please investigate and fix.

            midenok Aleksey Midenkov added a comment - Requested change for local mem_root fails in MSAN. Please investigate and fix.

            People

              nikitamalyavin Nikita Malyavin
              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.