[MDEV-26993] Add system versioning via modify column WITH SYSTEM VERSIONING Created: 2021-10-29  Updated: 2021-11-23

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Versioned Tables
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Geoff Montee (Inactive) Assignee: Aleksey Midenkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-12894 System-versioned tables Closed
Relates
relates to MDEV-26934 ADD SYSTEM VERSIONING and modify colu... Open

 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;



 Comments   
Comment by Aleksey Midenkov [ 2021-11-23 ]

That didn't work by design. As a new feature would be nice to have it.

Generated at Thu Feb 08 09:49:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.