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

Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column

Details

    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.

      Attachments

        Issue Links

          Activity

            #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
            

            midenok Aleksey Midenkov added a comment - #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

            Fixed:

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

            midenok Aleksey Midenkov added a comment - Fixed: ERROR 4130 (HY000): Can not change system versioning field `s`

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.