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

It's possible to make a system versioned table without any versioning field

    XMLWordPrintable

Details

    Description

      Right behaviour looks like this.

      et @@system_versioning_alter_history=keep;
      create or replace table t (
      a int without system versioning
      ) with system versioning engine=innodb;
      versioning.kevg 'innodb'                 [ fail ]
              Test ended at 2018-06-14 21:32:40
       
      CURRENT_TEST: versioning.kevg
      mysqltest: At line 82: query 'create or replace table t (
      a int without system versioning
      ) with system versioning engine=innodb' failed: 4123: Table `t` must have at least one versioned column
      
      

      But it's possible to bypass this error with ALTER TABLE:

      set @@system_versioning_alter_history=keep;
      create or replace table t (
      a int
      ) with system versioning engine=innodb;
      alter table t
      change column a a int without system versioning;
      show create table t;
      Table	Create Table
      t	CREATE TABLE `t` (
        `a` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
      
      

      Same with trx_id based tables.

      Attachments

        Activity

          People

            nikitamalyavin Nikita Malyavin
            kevg Eugene Kosov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.