[MDEV-14946] ALTER TABLE silently ignores AS ROW attribute Created: 2018-01-14  Updated: 2018-03-08  Resolved: 2018-03-08

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Versioned Tables
Affects Version/s: 10.3
Fix Version/s: 10.3.5

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

create or replace table t1 (i int);
alter table t1 add r timestamp(6) generated always as row start;

show create table t1 \G
 
       Table: t1
Create Table: CREATE TABLE `t1` (
  `i` int(11) DEFAULT NULL,
  `r` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

As discussed, it shouldn't be happening.
CREATE TABLE properly rejects an attempt to create such a table:

MariaDB [test]> create or replace table t1 (i int, r timestamp(6) generated always as row start);
ERROR 4123 (HY000): Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'


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