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

ALTERing a non-versioned column should always be allowed

    XMLWordPrintable

Details

    Description

      MariaDB [test]> CREATE OR REPLACE TABLE t (
          ->     id INT UNSIGNED NOT NULL AUTO_INCREMENT,
          ->     label VARCHAR(50) NOT NULL WITHOUT SYSTEM VERSIONING,
          ->
          ->     valid_from TIMESTAMP(6)
          ->         GENERATED ALWAYS AS ROW START,
          ->     valid_to TIMESTAMP(6)
          ->         GENERATED ALWAYS AS ROW END,
          ->     PERIOD FOR SYSTEM_TIME (valid_from, valid_to),
          ->
          ->     PRIMARY KEY (id)
          -> )
          ->     WITH SYSTEM VERSIONING,
          ->     ENGINE InnoDB
          -> ;
      Query OK, 0 rows affected (0.009 sec)
       
      MariaDB [test]> ALTER TABLE label label VARCHAR(100) NOT NULL WITHOUT SYSTEM VERSIONING;
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VARCHAR(100) NOT NULL WITHOUT SYSTEM VERSIONING' at line 1
      

      Note that `label` is defined as `WITHOUT SYSTEM VERSIONING`. While this doesn't mean that the column is not versioned (an UPDATE which modifies both id and label is indeed versioned), excluding a column from system versioning would be more useful if it will allow ALTERing the column. The cost is intuitive (inaccurate history. But I can't imagine a situation where this is a problem, if the user defined the column as `WITHOUT SYSTEM VERSIONING`.

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            f_razzoli Federico Razzoli
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.