[MDEV-15956] Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column Created: 2018-04-21  Updated: 2018-05-12  Resolved: 2018-05-12

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

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Aleksey Midenkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-14702 Not helpful error message upon ER_UNS... Open

 Description   

create or replace table t1 (i int, j int as (i), s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) with system versioning;
 
alter table t1 modify s timestamp(6) as row start;

ALTER returns the error:

MariaDB [test]> alter table t1 modify s timestamp(6) as row start;
ERROR 1907 (HY000): This is not yet supported for generated columns

This is strange, because ALTER doesn't even modify anything; and even more strange, because ALTER on the same table for a generated column not related to versioning works all right:

MariaDB [test]> alter table t1 modify j int as (i);
Query OK, 0 rows affected (0.00 sec)
Records: 0  Duplicates: 0  Warnings: 0

It would be understandable if it said that ALTER is not supported for versioning columns (if that's indeed so), but the error as it is now is wrong.



 Comments   
Comment by Aleksey Midenkov [ 2018-04-24 ]

#0  my_error (nr=1907, MyFlags=0) at /home/midenok/src/mariadb/trunk/src/mysys/my_error.c:113
#1  0x0000000000b15370 in Vers_parse_info::fix_alter_info (this=0x7fffe52ab4e0, thd=0x7fff84000d50, alter_info=0x7fffe52ab2e0, create_info=0x7fffe52ab390, table=0x7fff840fae50) at /home/midenok/src/mariadb/trunk/src/sql/handler.cc:7150
#2  0x00000000008ac55e in mysql_alter_table (thd=0x7fff84000d50, new_db=0x7fff84005398, new_name=0x7fff84005748, create_info=0x7fffe52ab390, table_list=0x7fff84013a88, alter_info=0x7fffe52ab2e0, order_num=0, order=0x0, ignore=false) at /home/midenok/src/mariadb/trunk/src/sql/sql_table.cc:9349
#3  0x0000000000954a61 in Sql_cmd_alter_table::execute (this=0x7fff84014208, thd=0x7fff84000d50) at /home/midenok/src/mariadb/trunk/src/sql/sql_alter.cc:328
#4  0x00000000007b6d91 in mysql_execute_command (thd=0x7fff84000d50) at /home/midenok/src/mariadb/trunk/src/sql/sql_parse.cc:6292
#5  0x00000000007a89a3 in mysql_parse (thd=0x7fff84000d50, rawbuf=0x7fff84013978 "alter table t1 modify s timestamp(6) as row start", length=49, parser_state=0x7fffe52ae640, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/trunk/src/sql/sql_parse.cc:8021

Comment by Aleksey Midenkov [ 2018-04-24 ]

Fixed:

ERROR 4130 (HY000): Can not change system versioning field `s`

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