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

SIGSEGV on adding system versioning and modifying system column

    XMLWordPrintable

Details

    Description

      Server crashes in Type_handler_hybrid_field_type::type_handler or Assertion `row_end' failed

      CREATE OR REPLACE TABLE t1 (a INT);
      ALTER TABLE t1
          ADD row_start TIMESTAMP(6) AS ROW START,
          ADD row_end TIMESTAMP(6) AS ROW END,
          ADD PERIOD FOR SYSTEM_TIME(row_start,row_end),
          WITH SYSTEM VERSIONING,
          MODIFY row_end VARCHAR(8)
      ;
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 c7cdd049

      #3  <signal handler called>
      #4  0x0000563ca6ac9048 in Type_handler_hybrid_field_type::type_handler (this=0x0) at /data/src/10.3/sql/sql_type.h:3497
      #5  0x0000563ca6ecef01 in is_versioning_timestamp (f=0x0) at /data/src/10.3/sql/handler.cc:7475
      #6  0x0000563ca6ecf1b0 in Vers_parse_info::check_sys_fields (this=0x7fa9eec89620, table_name=..., db=..., alter_info=0x7fa9eec89420, can_native=false) at /data/src/10.3/sql/handler.cc:7532
      #7  0x0000563ca6ece124 in Table_scope_and_contents_source_st::vers_check_system_fields (this=0x7fa9eec894e0, thd=0x7fa9d8000af0, alter_info=0x7fa9eec89420, table_name=..., db=..., select_count=0) at /data/src/10.3/sql/handler.cc:7266
      #8  0x0000563ca6c890ae in mysql_alter_table (thd=0x7fa9d8000af0, new_db=0x7fa9d80051d8, new_name=0x7fa9d8005598, create_info=0x7fa9eec894e0, table_list=0x7fa9d8012a40, alter_info=0x7fa9eec89420, order_num=0, order=0x0, ignore=false) at /data/src/10.3/sql/sql_table.cc:9610
      #9  0x0000563ca6d182aa in Sql_cmd_alter_table::execute (this=0x7fa9d8013420, thd=0x7fa9d8000af0) at /data/src/10.3/sql/sql_alter.cc:512
      #10 0x0000563ca6ba96c8 in mysql_execute_command (thd=0x7fa9d8000af0) at /data/src/10.3/sql/sql_parse.cc:6030
      #11 0x0000563ca6baee57 in mysql_parse (thd=0x7fa9d8000af0, rawbuf=0x7fa9d8012818 "ALTER TABLE t1\nADD row_start TIMESTAMP(6) AS ROW START,\nADD row_end TIMESTAMP(6) AS ROW END,\nADD PERIOD FOR SYSTEM_TIME(row_start,row_end),\nWITH SYSTEM VERSIONING,\nMODIFY row_end VARCHAR(8)", length=189, parser_state=0x7fa9eec8a5e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7817
      #12 0x0000563ca6b9b6c5 in dispatch_command (command=COM_QUERY, thd=0x7fa9d8000af0, packet=0x7fa9d8123241 "ALTER TABLE t1\nADD row_start TIMESTAMP(6) AS ROW START,\nADD row_end TIMESTAMP(6) AS ROW END,\nADD PERIOD FOR SYSTEM_TIME(row_start,row_end),\nWITH SYSTEM VERSIONING,\nMODIFY row_end VARCHAR(8)\n", packet_length=190, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
      #13 0x0000563ca6b99fdd in do_command (thd=0x7fa9d8000af0) at /data/src/10.3/sql/sql_parse.cc:1401
      #14 0x0000563ca6d122a9 in do_handle_one_connection (connect=0x563caa53e290) at /data/src/10.3/sql/sql_connect.cc:1403
      #15 0x0000563ca6d1200b in handle_one_connection (arg=0x563caa53e290) at /data/src/10.3/sql/sql_connect.cc:1308
      #16 0x0000563ca76c7236 in pfs_spawn_thread (arg=0x563caa4973c0) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #17 0x00007fa9faa504a4 in start_thread (arg=0x7fa9eec8b700) at pthread_create.c:456
      #18 0x00007fa9f8b84d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Fails the same way on 10.3-10.4, debug- and non-debug alike, with MyISAM, InnoDB< Aria.

      Also fails on 10.5, both debug and non-debug, with somewhat different stack traces:

      10.5 non-debug b934a34c

      #3  <signal handler called>
      #4  Type_handler_hybrid_field_type::type_handler (this=<optimized out>) at /data/src/10.5/sql/sql_type.h:7143
      #5  Vers_type_timestamp::check_sys_fields (this=0x55d482387c50 <vers_type_timestamp>, table_name=..., row_start=0x7fe2ec010fb0, row_end=0x0) at /data/src/10.5/sql/handler.cc:8058
      #6  0x000055d48135d742 in Table_scope_and_contents_source_st::check_fields (this=this@entry=0x7fe308703680, thd=thd@entry=0x7fe2ec0009b8, alter_info=alter_info@entry=0x7fe3087035b0, table_name=..., db=..., select_count=select_count@entry=0) at /data/src/10.5/sql/handler.cc:8164
      #7  0x000055d4811ffd53 in mysql_alter_table (thd=thd@entry=0x7fe2ec0009b8, new_db=new_db@entry=0x7fe2ec0050b0, new_name=new_name@entry=0x7fe2ec0054b8, create_info=create_info@entry=0x7fe308703680, table_list=<optimized out>, table_list@entry=0x7fe2ec010528, alter_info=alter_info@entry=0x7fe3087035b0, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.5/sql/sql_table.cc:10154
      #8  0x000055d4812571b3 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7fe2ec0009b8) at /data/src/10.5/sql/sql_alter.cc:538
      #9  0x000055d48116fd18 in mysql_execute_command (thd=thd@entry=0x7fe2ec0009b8) at /data/src/10.5/sql/sql_parse.cc:5912
      #10 0x000055d481176c9b in mysql_parse (thd=thd@entry=0x7fe2ec0009b8, rawbuf=<optimized out>, length=189, parser_state=parser_state@entry=0x7fe308704510, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.5/sql/sql_parse.cc:7957
      #11 0x000055d48116c88d in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fe2ec0009b8, packet=packet@entry=0x7fe2ec007c69 "ALTER TABLE t1\nADD row_start TIMESTAMP(6) AS ROW START,\nADD row_end TIMESTAMP(6) AS ROW END,\nADD PERIOD FOR SYSTEM_TIME(row_start,row_end),\nWITH SYSTEM VERSIONING,\nMODIFY row_end VARCHAR(8)\n", packet_length=packet_length@entry=190, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.5/sql/sql_parse.cc:1840
      #12 0x000055d48116acf1 in do_command (thd=0x7fe2ec0009b8) at /data/src/10.5/sql/sql_parse.cc:1359
      #13 0x000055d48125270c in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55d4835b59c8, put_in_cache=put_in_cache@entry=true) at /data/src/10.5/sql/sql_connect.cc:1411
      #14 0x000055d481252cf3 in handle_one_connection (arg=arg@entry=0x55d4835b59c8) at /data/src/10.5/sql/sql_connect.cc:1313
      #15 0x000055d48156c474 in pfs_spawn_thread (arg=0x55d48362d188) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #16 0x00007fe30f2f04a4 in start_thread (arg=0x7fe308705700) at pthread_create.c:456
      #17 0x00007fe30d424d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      10.5 debug b934a34c

      mariadbd: /data/src/10.5/sql/handler.cc:8120: bool Vers_parse_info::check_sys_fields(const Lex_table_name&, const Lex_table_name&, Alter_info*) const: Assertion `row_end' failed.
      200522  1:52:19 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fb0c4469f12 in __GI___assert_fail (assertion=0x55b1d79b2da7 "row_end", file=0x55b1d79b029e "/data/src/10.5/sql/handler.cc", line=8120, function=0x55b1d79b5600 <Vers_parse_info::check_sys_fields(Lex_cstring_with_compare<Compare_table_names> const&, Lex_cstring_with_compare<Compare_table_names> const&, Alter_info*) const::__PRETTY_FUNCTION__> "bool Vers_parse_info::check_sys_fields(const Lex_table_name&, const Lex_table_name&, Alter_info*) const") at assert.c:101
      #8  0x000055b1d6d994e0 in Vers_parse_info::check_sys_fields (this=0x7fb0bafca570, table_name=..., db=..., alter_info=0x7fb0bafca360) at /data/src/10.5/sql/handler.cc:8120
      #9  0x000055b1d6d98188 in Table_scope_and_contents_source_st::vers_check_system_fields (this=0x7fb0bafca430, thd=0x7fb0a4000b18, alter_info=0x7fb0bafca360, table_name=..., db=..., select_count=0) at /data/src/10.5/sql/handler.cc:7801
      #10 0x000055b1d6d996ba in Table_scope_and_contents_source_st::check_fields (this=0x7fb0bafca430, thd=0x7fb0a4000b18, alter_info=0x7fb0bafca360, table_name=..., db=..., select_count=0) at /data/src/10.5/sql/handler.cc:8164
      #11 0x000055b1d6b2e3b3 in mysql_alter_table (thd=0x7fb0a4000b18, new_db=0x7fb0a40053d0, new_name=0x7fb0a40057d8, create_info=0x7fb0bafca430, table_list=0x7fb0a4013b78, alter_info=0x7fb0bafca360, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.5/sql/sql_table.cc:10154
      #12 0x000055b1d6bd3e8a in Sql_cmd_alter_table::execute (this=0x7fb0a40145b8, thd=0x7fb0a4000b18) at /data/src/10.5/sql/sql_alter.cc:538
      #13 0x000055b1d6a35118 in mysql_execute_command (thd=0x7fb0a4000b18) at /data/src/10.5/sql/sql_parse.cc:5912
      #14 0x000055b1d6a3b49c in mysql_parse (thd=0x7fb0a4000b18, rawbuf=0x7fb0a4013950 "ALTER TABLE t1\nADD row_start TIMESTAMP(6) AS ROW START,\nADD row_end TIMESTAMP(6) AS ROW END,\nADD PERIOD FOR SYSTEM_TIME(row_start,row_end),\nWITH SYSTEM VERSIONING,\nMODIFY row_end VARCHAR(8)", length=189, parser_state=0x7fb0bafcb520, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7957
      #15 0x000055b1d6a277a4 in dispatch_command (command=COM_QUERY, thd=0x7fb0a4000b18, packet=0x7fb0a41b0409 "ALTER TABLE t1\nADD row_start TIMESTAMP(6) AS ROW START,\nADD row_end TIMESTAMP(6) AS ROW END,\nADD PERIOD FOR SYSTEM_TIME(row_start,row_end),\nWITH SYSTEM VERSIONING,\nMODIFY row_end VARCHAR(8)\n", packet_length=190, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1840
      #16 0x000055b1d6a25f36 in do_command (thd=0x7fb0a4000b18) at /data/src/10.5/sql/sql_parse.cc:1359
      #17 0x000055b1d6bc955f in do_handle_one_connection (connect=0x55b1da4c1428, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1411
      #18 0x000055b1d6bc92c7 in handle_one_connection (arg=0x55b1da4d3578) at /data/src/10.5/sql/sql_connect.cc:1313
      #19 0x000055b1d70ff3ee in pfs_spawn_thread (arg=0x55b1da45c7f8) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #20 0x00007fb0c63f24a4 in start_thread (arg=0x7fb0bafcc700) at pthread_create.c:456
      #21 0x00007fb0c4526d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.