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

Fix history fields data types diagnostics for partition

    XMLWordPrintable

Details

    Description

      Background

      The initial work has been done in MDEV-15408 by bringing the comprehensive error reports:

      create or replace table t1 (
      a int,
      row_start bigint as row start,
      row_end bigint as row end,
      period for system_time (row_start, row_end)
      ) engine=innodb with system versioning;
      ERROR HY000: `row_start` must be of type BIGINT(20) UNSIGNED for system-versioned table `t1`
      

      Here, it is guessed that the data type is meant BIGINT(20) , not TIMESTAMP(6). It is only possible for engines that support trx_id (i.e. native) versioning.

      create or replace table t1 (
      a int,
      row_start bigint as row start,
      row_end bigint as row end,
      period for system_time (row_start, row_end)
      ) engine=myisam with system versioning;
      ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1`
      

      The bug

      It is not handled for partitions correctly

      create or replace table t1 (
      a int,
      row_start bigint as row start,
      row_end bigint as row end,
      period for system_time (row_start, row_end)
      ) engine=myisam with system versioning
      partition by hash(a);
      ERROR HY000: `row_start` must be of type BIGINT(20) UNSIGNED for system-versioned table `t1`
      

      This is because native flag is determined from the handlerton. Instead, the partitioning structure should be taken in mind. The correct determination of nativeness was done in MDEV-15951, but it probably needs some revisiting, e.g. move the check in Create_info/Alter_info layer

      Attachments

        Activity

          People

            nikitamalyavin Nikita Malyavin
            nikitamalyavin Nikita Malyavin
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.