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

Server crashes in dict_col_t::detach upon creating a table with FK on virtual column

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      --error ER_BLOB_KEY_WITHOUT_LENGTH,ER_INDEX_COLUMN_TOO_LONG
      CREATE TABLE t1 (
          a TEXT,
          b TEXT,
          c TEXT AS (a) VIRTUAL,
          FOREIGN KEY (c) REFERENCES t1 (b)
      ) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
      

      10.4 09e9f884 non-debug

      #3  <signal handler called>
      #4  dict_col_t::detach (index=..., this=0x502ff0400480002) at /data/src/10.4/storage/innobase/include/dict0mem.h:1232
      #5  dict_index_t::detach_columns (this=0x7f0024082cd0) at /data/src/10.4/storage/innobase/include/dict0mem.h:1151
      #6  dict_mem_index_free (index=index@entry=0x7f0024082cd0) at /data/src/10.4/storage/innobase/dict/dict0mem.cc:1064
      #7  0x0000564c714f4b98 in row_create_index_for_mysql (index=index@entry=0x7f0024082cd0, trx=trx@entry=0x7f0078f42158, field_lengths=field_lengths@entry=0x7f00240759c8) at /data/src/10.4/storage/innobase/row/row0mysql.cc:2517
      #8  0x0000564c7144963e in create_index (trx=<optimized out>, form=<optimized out>, table=<optimized out>, key_num=key_num@entry=0) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:11348
      #9  0x0000564c714463fa in create_table_info_t::create_table (this=this@entry=0x7f00784a3380, create_fk=create_fk@entry=true) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12460
      #10 0x0000564c71449bf8 in ha_innobase::create (this=<optimized out>, name=<optimized out>, form=0x7f00784a3900, create_info=<optimized out>, file_per_table=<optimized out>, trx=<optimized out>) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12692
      #11 0x0000564c712c1af3 in handler::ha_create (this=0x7f002407fab0, name=<optimized out>, form=0x7f00784a3900, info_arg=0x7f00784a5900) at /data/src/10.4/sql/handler.cc:4736
      #12 0x0000564c712c2382 in ha_create_table (thd=thd@entry=0x7f00240009a8, path=path@entry=0x7f00784a5550 "./test/t1", db=0x7f00240106e0 "test", table_name=0x7f0024010000 "t1", create_info=create_info@entry=0x7f00784a5900, frm=frm@entry=0x7f00784a5540) at /data/src/10.4/sql/handler.cc:5200
      #13 0x0000564c7114e878 in create_table_impl (thd=thd@entry=0x7f00240009a8, orig_db=..., orig_table_name=..., db=..., table_name=..., path=path@entry=0x7f00784a5550 "./test/t1", options=..., create_info=0x7f00784a5900, alter_info=0x7f00784a5840, create_table_mode=0, is_trans=0x7f00784a57c7, key_info=0x7f00784a5538, key_count=0x7f00784a5534, frm=0x7f00784a5540) at /data/src/10.4/sql/sql_table.cc:5057
      #14 0x0000564c7114ec69 in mysql_create_table_no_lock (thd=thd@entry=0x7f00240009a8, db=db@entry=0x7f0024010050, table_name=table_name@entry=0x7f0024010060, create_info=create_info@entry=0x7f00784a5900, alter_info=alter_info@entry=0x7f00784a5840, is_trans=is_trans@entry=0x7f00784a57c7, create_table_mode=0, table_list=0x7f0024010038) at /data/src/10.4/sql/sql_table.cc:5144
      #15 0x0000564c7114ee7e in mysql_create_table (thd=thd@entry=0x7f00240009a8, create_table=create_table@entry=0x7f0024010038, create_info=create_info@entry=0x7f00784a5900, alter_info=alter_info@entry=0x7f00784a5840) at /data/src/10.4/sql/sql_table.cc:5233
      #16 0x0000564c7114ffab in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x7f00240009a8) at /data/src/10.4/sql/sql_table.cc:11362
      #17 0x0000564c710c5540 in mysql_execute_command (thd=thd@entry=0x7f00240009a8) at /data/src/10.4/sql/sql_parse.cc:6098
      #18 0x0000564c710cc6c9 in mysql_parse (thd=thd@entry=0x7f00240009a8, rawbuf=<optimized out>, length=127, parser_state=parser_state@entry=0x7f00784a81c0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:7908
      #19 0x0000564c710cea4e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f00240009a8, packet=packet@entry=0x7f0024007979 "CREATE TABLE t1 (\na TEXT,\nb TEXT,\nc TEXT AS (a) VIRTUAL,\nFOREIGN KEY (c) REFERENCES t1 (b)\n) ENGINE=InnoDB ROW_FORMAT=REDUNDANT", packet_length=packet_length@entry=127, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:1843
      #20 0x0000564c710d01c9 in do_command (thd=0x7f00240009a8) at /data/src/10.4/sql/sql_parse.cc:1360
      #21 0x0000564c7119e59e in do_handle_one_connection (connect=connect@entry=0x564c732d2b78) at /data/src/10.4/sql/sql_connect.cc:1404
      #22 0x0000564c7119e6b4 in handle_one_connection (arg=arg@entry=0x564c732d2b78) at /data/src/10.4/sql/sql_connect.cc:1306
      #23 0x0000564c71746f44 in pfs_spawn_thread (arg=0x564c7324aac8) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #24 0x00007f0080c4e4a4 in start_thread (arg=0x7f00784a9700) at pthread_create.c:456
      #25 0x00007f007f196d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      10.4 09e9f884 debug

      #3  <signal handler called>
      #4  0x000055e5ed82cb46 in dict_col_t::is_virtual (this=0xa5a5a5a5a5a5a5a5) at /data/src/10.4/storage/innobase/include/dict0mem.h:598
      #5  0x000055e5ed85acea in dict_col_t::detach (this=0xa5a5a5a5a5a5a5a5, index=...) at /data/src/10.4/storage/innobase/include/dict0mem.h:1232
      #6  0x000055e5ed85a990 in dict_index_t::detach_columns (this=0x7f3dac14d6d8) at /data/src/10.4/storage/innobase/include/dict0mem.h:1151
      #7  0x000055e5edb125e5 in dict_mem_index_free (index=0x7f3dac14d6d8) at /data/src/10.4/storage/innobase/dict/dict0mem.cc:1064
      #8  0x000055e5ed97c233 in row_create_index_for_mysql (index=0x7f3dac14d6d8, trx=0x7f3e0519b268, field_lengths=0x7f3dac0caf60) at /data/src/10.4/storage/innobase/row/row0mysql.cc:2517
      #9  0x000055e5ed82f6c2 in create_index (trx=0x7f3e0519b268, form=0x7f3e046fe1d0, table=0x7f3dac14ca08, key_num=0) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:11348
      #10 0x000055e5ed81a34e in create_table_info_t::create_table (this=0x7f3e046fdc70, create_fk=true) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12460
      #11 0x000055e5ed82fa42 in ha_innobase::create (this=0x7f3dac00b5a8, name=0x7f3e046fff90 "./test/t1", form=0x7f3e046fe1d0, create_info=0x7f3e047003d0, file_per_table=true, trx=0x7f3e0519b268) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12692
      #12 0x000055e5ed81abed in ha_innobase::create (this=0x7f3dac00b5a8, name=0x7f3e046fff90 "./test/t1", form=0x7f3e046fe1d0, create_info=0x7f3e047003d0) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12745
      #13 0x000055e5ed5e9c40 in handler::ha_create (this=0x7f3dac00b5a8, name=0x7f3e046fff90 "./test/t1", form=0x7f3e046fe1d0, info_arg=0x7f3e047003d0) at /data/src/10.4/sql/handler.cc:4736
      #14 0x000055e5ed5eb157 in ha_create_table (thd=0x7f3dac000b00, path=0x7f3e046fff90 "./test/t1", db=0x7f3dac013ac8 "test", table_name=0x7f3dac0133e8 "t1", create_info=0x7f3e047003d0, frm=0x7f3e046fff80) at /data/src/10.4/sql/handler.cc:5200
      #15 0x000055e5ed37f3ec in create_table_impl (thd=0x7f3dac000b00, orig_db=..., orig_table_name=..., db=..., table_name=..., path=0x7f3e046fff90 "./test/t1", options=..., create_info=0x7f3e047003d0, alter_info=0x7f3e04700310, create_table_mode=0, is_trans=0x7f3e047001ee, key_info=0x7f3e046fff70, key_count=0x7f3e046fff64, frm=0x7f3e046fff80) at /data/src/10.4/sql/sql_table.cc:5057
      #16 0x000055e5ed37f830 in mysql_create_table_no_lock (thd=0x7f3dac000b00, db=0x7f3dac013438, table_name=0x7f3dac013448, create_info=0x7f3e047003d0, alter_info=0x7f3e04700310, is_trans=0x7f3e047001ee, create_table_mode=0, table_list=0x7f3dac013420) at /data/src/10.4/sql/sql_table.cc:5144
      #17 0x000055e5ed37fbcf in mysql_create_table (thd=0x7f3dac000b00, create_table=0x7f3dac013420, create_info=0x7f3e047003d0, alter_info=0x7f3e04700310) at /data/src/10.4/sql/sql_table.cc:5233
      #18 0x000055e5ed3915b8 in Sql_cmd_create_table_like::execute (this=0x7f3dac0133c0, thd=0x7f3dac000b00) at /data/src/10.4/sql/sql_table.cc:11362
      #19 0x000055e5ed2ac57d in mysql_execute_command (thd=0x7f3dac000b00) at /data/src/10.4/sql/sql_parse.cc:6098
      #20 0x000055e5ed2b17ed in mysql_parse (thd=0x7f3dac000b00, rawbuf=0x7f3dac013260 "CREATE TABLE t1 (\na TEXT,\nb TEXT,\nc TEXT AS (a) VIRTUAL,\nFOREIGN KEY (c) REFERENCES t1 (b)\n) ENGINE=InnoDB ROW_FORMAT=REDUNDANT", length=127, parser_state=0x7f3e04701180, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7908
      #21 0x000055e5ed29da96 in dispatch_command (command=COM_QUERY, thd=0x7f3dac000b00, packet=0x7f3dac19de01 "CREATE TABLE t1 (\na TEXT,\nb TEXT,\nc TEXT AS (a) VIRTUAL,\nFOREIGN KEY (c) REFERENCES t1 (b)\n) ENGINE=InnoDB ROW_FORMAT=REDUNDANT", packet_length=127, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1843
      #22 0x000055e5ed29c1dc in do_command (thd=0x7f3dac000b00) at /data/src/10.4/sql/sql_parse.cc:1360
      #23 0x000055e5ed415716 in do_handle_one_connection (connect=0x55e5f0cc9930) at /data/src/10.4/sql/sql_connect.cc:1404
      #24 0x000055e5ed415465 in handle_one_connection (arg=0x55e5f0cc9930) at /data/src/10.4/sql/sql_connect.cc:1306
      #25 0x000055e5edd40b09 in pfs_spawn_thread (arg=0x55e5f0c482c0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #26 0x00007f3e0cea54a4 in start_thread (arg=0x7f3e04702700) at pthread_create.c:456
      #27 0x00007f3e0b3edd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Not reproducible on 10.3.

      The problem appeared in 10.4 tree with this commit:

      commit 0274ab1de391920f98f844f6c71bf5b66db189ee
      Author: Marko Mäkelä
      Date:   Mon May 27 19:45:44 2019 +0300
       
          MDEV-19606: Replace most std::list with std::forward_list
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              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.