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

Add system versioning via modify column WITH SYSTEM VERSIONING

    XMLWordPrintable

    Details

      Description

      The WITH SYSTEM VERSIONING column option is intended to enable system versioning on a column level.

      With this column option, it is even possible use CREATE TABLE to create a system-versioned table that only provides system versioning for a single column:

      MariaDB [test]> CREATE TABLE accounts_col (
          ->    id SERIAL PRIMARY KEY,
          ->    name VARCHAR(255),
          ->    amount INT WITH SYSTEM VERSIONING
          -> );
      Query OK, 0 rows affected (0.021 sec)
      

      However, if you try to add the column option to a column in a non-system-versioned table, it raises an error message:

      MariaDB [test]> ALTER TABLE accounts_col
          ->    MODIFY name VARCHAR(255) WITH SYSTEM VERSIONING;
      ERROR 4124 (HY000): Table `accounts_col` is not system-versioned
      

      If this works for CREATE TABLE, shouldn't it also work for ALTER TABLE?

      To reproduce:

      CREATE TABLE accounts_col (
         id SERIAL PRIMARY KEY,
         name VARCHAR(255),
         amount INT
      );
       
      ALTER TABLE accounts_col
         MODIFY name VARCHAR(255) WITH SYSTEM VERSIONING;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              midenok Aleksey Midenkov
              Reporter:
              GeoffMontee Geoff Montee
              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.