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

Server crash in dict_col_t::name or Assertion `n' failed in find_old_col_no after invalid FK addition

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t (i INT PRIMARY KEY) ENGINE=InnoDB;
      CREATE TABLE t1 (a INT, KEY (a), PRIMARY KEY (a), FOREIGN KEY fk (a) REFERENCES t (i)) ENGINE=InnoDB;
      CREATE TABLE t2 (b INT, KEY (b)) ENGINE=InnoDB;
       
      SET FOREIGN_KEY_CHECKS= OFF;
      --error ER_FK_FAIL_ADD_SYSTEM
      ALTER TABLE t2 ADD FOREIGN KEY fk(b) REFERENCES t (i), ADD c INT;
       
      # Cleanup
      DROP TABLE t1, t2, t;
      

      10.4 non-debug a2e477ff

      #2  <signal handler called>
      #3  0x00007f81fdb2c496 in strlen () from /lib/x86_64-linux-gnu/libc.so.6
      #4  0x000055dffbe1a91c in dict_col_t::name (this=<optimized out>, table=...) at /data/src/10.4/storage/innobase/dict/dict0dict.cc:654
      #5  0x000055dffbc95488 in rollback_instant (col_map=0x7f81ac0c9c18, old_v_col_names=<optimized out>, old_v_cols=<optimized out>, old_n_v_cols=<optimized out>, old_n_core_fields=<optimized out>, old_n_fields=<optimized out>, old_fields=<optimized out>, old_instant=<optimized out>, old_col_names=<optimized out>, old_cols=<optimized out>, old_n_cols=<optimized out>, this=<optimized out>) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:846
      #6  rollback_instant (this=<optimized out>) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:1087
      #7  ha_innobase::commit_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>, commit=<optimized out>) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10753
      #8  0x000055dffb76a522 in mysql_inplace_alter_table (thd=thd@entry=0x7f81ac0009a8, table_list=0x7f81ac012090, table=table@entry=0x7f81ac0c6178, altered_table=altered_table@entry=0x7f81f8049e60, ha_alter_info=ha_alter_info@entry=0x7f81f8049dd0, inplace_supported=inplace_supported@entry=HA_ALTER_INPLACE_INSTANT, alter_ctx=0x7f81f804b660, target_mdl_request=0x7f81f804ac30) at /data/src/10.4/sql/sql_table.cc:7705
      #9  0x000055dffb8f6e1c in mysql_alter_table (thd=<optimized out>, new_db=<optimized out>, new_name=<optimized out>, create_info=<optimized out>, table_list=0x7f81ac012090, alter_info=0x7f81f804c160, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9971
      #10 0x000055dffb94807a in Sql_cmd_alter_table::execute (this=0x7f81ac191000, thd=0x7f81ac0009a8) at /data/src/10.4/sql/sql_alter.cc:496
      #11 0x000055dffb85e0ac in mysql_execute_command (thd=thd@entry=0x7f81ac0009a8) at /data/src/10.4/sql/sql_parse.cc:6344
      #12 0x000055dffb8649e1 in mysql_parse (thd=thd@entry=0x7f81ac0009a8, rawbuf=<optimized out>, length=64, parser_state=parser_state@entry=0x7f81f804f1d0, 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:8154
      #13 0x000055dffb867257 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f81ac0009a8, packet=packet@entry=0x7f81ac009bf9 "ALTER TABLE t2 ADD FOREIGN KEY fk(b) REFERENCES t (i), ADD c INT", packet_length=packet_length@entry=64, 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:1832
      #14 0x000055dffb8685c7 in do_command (thd=0x7f81ac0009a8) at /data/src/10.4/sql/sql_parse.cc:1365
      #15 0x000055dffb943c7c in do_handle_one_connection (connect=connect@entry=0x55dfff4c2b58) at /data/src/10.4/sql/sql_connect.cc:1398
      #16 0x000055dffb943de4 in handle_one_connection (arg=arg@entry=0x55dfff4c2b58) at /data/src/10.4/sql/sql_connect.cc:1301
      #17 0x000055dffbc61224 in pfs_spawn_thread (arg=0x55dfff4d7fd8) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #18 0x00007f81ff9c6494 in start_thread (arg=0x7f81f8050700) at pthread_create.c:333
      #19 0x00007f81fdb9493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      10.4 debug a2e477ff

      mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:719: ulint find_old_col_no(const ulint*, ulint, ulint): Assertion `n' failed.
      190406 21:44:16 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f3694acfee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00005600fdccd603 in find_old_col_no (col_map=0x7f363c15fd20, pos=1, n=0) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:719
      #9  0x00005600fdcf0f24 in dict_table_t::rollback_instant (this=0x7f363c1a0b68, old_n_cols=4, old_cols=0x7f363c1a0e78, old_col_names=0x7f363c1a0f50 "b", old_instant=0x0, old_fields=0x7f363c1518f8, old_n_fields=4, old_n_core_fields=4, old_n_v_cols=0, old_v_cols=0x7f363c1a0ef8, old_v_col_names=0x0, col_map=0x7f363c15fd20) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:841
      #10 0x00005600fdcf1b7a in ha_innobase_inplace_ctx::rollback_instant (this=0x7f363c017210) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:1087
      #11 0x00005600fdce6c9a in ha_innobase::commit_inplace_alter_table (this=0x7f363c154698, altered_table=0x7f3689e2c690, ha_alter_info=0x7f3689e2c600, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10753
      #12 0x00005600fd968b4e in handler::ha_commit_inplace_alter_table (this=0x7f363c154698, altered_table=0x7f3689e2c690, ha_alter_info=0x7f3689e2c600, commit=true) at /data/src/10.4/sql/handler.cc:4712
      #13 0x00005600fd6fd6e2 in mysql_inplace_alter_table (thd=0x7f363c000b00, table_list=0x7f363c015718, table=0x7f363c153830, altered_table=0x7f3689e2c690, ha_alter_info=0x7f3689e2c600, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f3689e2d5e0, alter_ctx=0x7f3689e2e110) at /data/src/10.4/sql/sql_table.cc:7705
      #14 0x00005600fd703d1c in mysql_alter_table (thd=0x7f363c000b00, new_db=0x7f363c0052a8, new_name=0x7f363c0056b0, create_info=0x7f3689e2ecf0, table_list=0x7f363c015718, alter_info=0x7f3689e2ec30, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9971
      #15 0x00005600fd794932 in Sql_cmd_alter_table::execute (this=0x7f363c0160f8, thd=0x7f363c000b00) at /data/src/10.4/sql/sql_alter.cc:496
      #16 0x00005600fd6241ce in mysql_execute_command (thd=0x7f363c000b00) at /data/src/10.4/sql/sql_parse.cc:6344
      #17 0x00005600fd629171 in mysql_parse (thd=0x7f363c000b00, rawbuf=0x7f363c0155e8 "ALTER TABLE t2 ADD FOREIGN KEY fk(b) REFERENCES t (i), ADD c INT", length=64, parser_state=0x7f3689e30180, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8154
      #18 0x00005600fd614bc8 in dispatch_command (command=COM_QUERY, thd=0x7f363c000b00, packet=0x7f363c13a101 "ALTER TABLE t2 ADD FOREIGN KEY fk(b) REFERENCES t (i), ADD c INT", packet_length=64, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1832
      #19 0x00005600fd6133ae in do_command (thd=0x7f363c000b00) at /data/src/10.4/sql/sql_parse.cc:1365
      #20 0x00005600fd78b7a5 in do_handle_one_connection (connect=0x560100634330) at /data/src/10.4/sql/sql_connect.cc:1398
      #21 0x00005600fd78b516 in handle_one_connection (arg=0x560100634330) at /data/src/10.4/sql/sql_connect.cc:1301
      #22 0x00005600fdc7f995 in pfs_spawn_thread (arg=0x56010067a190) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #23 0x00007f36969be494 in start_thread (arg=0x7f3689e31700) at pthread_create.c:333
      #24 0x00007f3694b8c93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Not reproducible on 10.3.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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