[MDEV-14798] Add, drop system versioning semantic and syntax Created: 2017-12-29  Updated: 2018-02-23  Resolved: 2018-01-23

Status: Closed
Project: MariaDB Server
Component/s: Versioned Tables
Fix Version/s: 10.3.4

Type: Task Priority: Major
Reporter: Eugene Kosov (Inactive) Assignee: Eugene Kosov (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Here is a descriptive list how various clauses should work:

  • New clause DROP PERIOD FOR SYSTEM_TIME
  • ALTER TABLE DROP COLUMN sys_trx_start, DROP COLUMN sys_trx_end, DROP PERIOD FOR SYSTEM_TIME, DROP SYSTEM VERSIONING should work as ALTER TABLE DROP SYSTEM VERSIONING
  • ALTER TABLE DROP COLUMN sys_trx_start, DROP COLUMN sys_trx_end, DROP PERIOD FOR SYSTEM_TIME should make fields and period invisible
  • ALTER TABLE DROP COLUMN sys_trx_start, DROP COLUMN sys_trx_end does the same (the period is "dropped" implicitly when all its columns are dropped)
  • DROP PERIOD FOR SYSTEM_TIME produces an error (DROP COLUMN sys_trx_start, DROP COLUMN sys_trx_end is missing)
  • ALTER TABLE DROP COLUMN sys_trx_start - error (cannot drop just one column from the period)
  • drop system versioning should not require invisibility of `sys_trx_*`


 Comments   
Comment by Sergei Golubchik [ 2017-12-29 ]

About dropping one column or two columns, compare with CHECK constraints:

create table t1 (a int, b int, c int, check (b>c));
alter table t1 drop column b;
→ ERROR 1054 (42S22): Unknown column 'b' in 'CHECK'
alter table t1 drop column b, drop column c;
→ Query OK, 0 rows affected, 2 warnings (0.006 sec)  
show create table t1;
CREATE TABLE `t1` (
  `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.001 sec)

That is, one cannot drop just one column from the multi-column CHECK, but one can drop all columns of it, and the constraint will be dropped automatically.

Comment by Eugene Kosov (Inactive) [ 2018-01-10 ]

Partially fixed in https://github.com/MariaDB/server/commit/ac95aa888380633da7f4cdce39ddaa8ad35a975b

Comment by Eugene Kosov (Inactive) [ 2018-01-23 ]

`DROP PERIOD FOR SYSTEM_TIME` is not implemented in 10.3.4

Generated at Thu Feb 08 08:16:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.