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

Server crashes in dict_foreign_t::sql_id upon adding a wrong FK

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t (id INT PRIMARY KEY, f INT NOT NULL, KEY(f)) ENGINE=InnoDB;
      SET FOREIGN_KEY_CHECKS = OFF;
      ALTER TABLE t ADD FOREIGN KEY (f) REFERENCES t (id) ON UPDATE SET NULL;
       
      DROP TABLE t;
      

      bb-main-midenok-MDEV-25292 08bf62213c5b50d379093df8961bb5b358e636cf

      #3  <signal handler called>
      #4  __strchr_avx2 () at ../sysdeps/x86_64/multiarch/strchr-avx2.S:67
      #5  0x000055c10cfa12b3 in dict_foreign_t::sql_id (this=0x7f504826f440) at /data/bld/bb-main-midenok-MDEV-25292-debug/storage/innobase/include/dict0mem.h:1684
      #6  0x000055c10cfc45ca in innobase_get_foreign_key_info (ha_alter_info=0x7f507405fa70, table_share=0x7f50480696d0, table=0x7f5048041d70, col_names=0x0, drop_index=0x0, n_drop_index=0, add_fk=0x7f50481dba80, n_add_fk=0x7f507405e878, trx=0x7f506ec60c00, s_cols=0x0) at /data/bld/bb-main-midenok-MDEV-25292-debug/storage/innobase/handler/handler0alter.cc:3368
      #7  0x000055c10cfd9171 in ha_innobase::prepare_inplace_alter_table (this=0x7f50481c1f78, altered_table=0x7f507405fb30, ha_alter_info=0x7f507405fa70) at /data/bld/bb-main-midenok-MDEV-25292-debug/storage/innobase/handler/handler0alter.cc:8429
      #8  0x000055c10cb32c8f in handler::ha_prepare_inplace_alter_table (this=0x7f50481c1f78, altered_table=0x7f507405fb30, ha_alter_info=0x7f507405fa70) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/handler.cc:5698
      #9  0x000055c10c825e96 in mysql_inplace_alter_table (thd=0x7f5048000dc8, table_list=0x7f5048018158, table=0x7f504826e4f8, altered_table=0x7f507405fb30, ha_alter_info=0x7f507405fa70, target_mdl_request=0x7f50740603b0, ddl_log_state=0x7f507405f9f0, trigger_param=0x7f507405ff40, alter_ctx=0x7f5074061000, partial_alter=@0x7f507405f8bc: false, start_alter_id=@0x7f507405f900: 0, if_exists=false) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_table.cc:8468
      #10 0x000055c10c830e96 in mysql_alter_table (thd=0x7f5048000dc8, new_db=0x7f5048005be8, new_name=0x7f5048006050, create_info=0x7f5074061ef0, table_list=0x7f5048018158, recreate_info=0x7f5074062240, alter_info=0x7f5074061d70, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_table.cc:11976
      #11 0x000055c10c8f85e7 in Sql_cmd_alter_table::execute (this=0x7f5048018ab8, thd=0x7f5048000dc8) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_alter.cc:695
      #12 0x000055c10c6eaf49 in mysql_execute_command (thd=0x7f5048000dc8, is_called_from_prepared_stmt=false) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_parse.cc:5889
      #13 0x000055c10c6f1211 in mysql_parse (thd=0x7f5048000dc8, rawbuf=0x7f5048018020 "ALTER TABLE t ADD FOREIGN KEY (f) REFERENCES t (id) ON UPDATE SET NULL", length=70, parser_state=0x7f50740632e0) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_parse.cc:7919
      #14 0x000055c10c6dd438 in dispatch_command (command=COM_QUERY, thd=0x7f5048000dc8, packet=0x7f504800bf79 "ALTER TABLE t ADD FOREIGN KEY (f) REFERENCES t (id) ON UPDATE SET NULL", packet_length=70, blocking=true) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_parse.cc:1905
      #15 0x000055c10c6dbcf6 in do_command (thd=0x7f5048000dc8, blocking=true) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_parse.cc:1416
      #16 0x000055c10c8ebe39 in do_handle_one_connection (connect=0x55c14cf48098, put_in_cache=true) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_connect.cc:1415
      #17 0x000055c10c8ebbba in handle_one_connection (arg=0x55c14ce88d58) at /data/bld/bb-main-midenok-MDEV-25292-debug/sql/sql_connect.cc:1327
      #18 0x000055c10ce723bc in pfs_spawn_thread (arg=0x55c14cf47c08) at /data/bld/bb-main-midenok-MDEV-25292-debug/storage/perfschema/pfs.cc:2198
      #19 0x00007f507e6a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #20 0x00007f507e72885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Not reproducible on the baseline of bb-main-midenok-MDEV-25292 or on the commit preceding MDEV-28933 in it.

      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.