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

Assertion `!check_foreigns' failed in trx_t::bulk_insert_apply

    XMLWordPrintable

    Details

      Description

      Similar to MDEV-28242 but crashes in a different place.

      SET unique_checks=0, foreign_key_checks=0, autocommit=0;
      CREATE TABLE t1 (c INT) ENGINE=MyISAM PARTITION BY LIST (c) (PARTITION p VALUES IN (1,2));
      FLUSH TABLES t1 FOR EXPORT;
      CREATE TEMPORARY TABLE t1 (id INT(10) NOT NULL UNIQUE);
      INSERT INTO t1 VALUES (1);
      SET SESSION foreign_key_checks=1;
      INSERT INTO t1 VALUES ('a'),('A'),('b'),('B');
      

      Leads to:

      10.10.0 081a284712bb661349e2e3802077b12211cede3e (Debug)

      mysqld: /test/10.10_dbg/storage/innobase/include/trx0trx.h:1143: dberr_t trx_t::bulk_insert_apply(): Assertion `!check_foreigns' failed.
      

      10.10.0 081a284712bb661349e2e3802077b12211cede3e (Debug)

      Core was generated by `/test/MD310522-mariadb-10.10.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14f1dc12d700 (LWP 2764046))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014f200eb7859 in __GI_abort () at abort.c:79
      #2  0x000014f200eb7729 in __assert_fail_base (fmt=0x14f20104d588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56309c17f541 "!check_foreigns", file=0x56309c184de8 "/test/10.10_dbg/storage/innobase/include/trx0trx.h", line=1143, function=<optimized out>) at assert.c:92
      #3  0x000014f200ec8fd6 in __GI___assert_fail (assertion=assertion@entry=0x56309c17f541 "!check_foreigns", file=file@entry=0x56309c184de8 "/test/10.10_dbg/storage/innobase/include/trx0trx.h", line=line@entry=1143, function=function@entry=0x56309c188548 "dberr_t trx_t::bulk_insert_apply()") at assert.c:101
      #4  0x000056309b98d55c in trx_t::bulk_insert_apply (this=0x14f1f8751b80) at /test/10.10_dbg/storage/innobase/include/trx0trx.h:1143
      #5  ha_innobase::start_stmt (this=0x14f154034d00, thd=0x14f154000db8, lock_type=TL_WRITE_CONCURRENT_INSERT) at /test/10.10_dbg/storage/innobase/handler/ha_innodb.cc:15819
      #6  0x000056309b2f6828 in check_lock_and_start_stmt (thd=thd@entry=0x14f154000db8, prelocking_ctx=<optimized out>, table_list=table_list@entry=0x14f154013d30) at /test/10.10_dbg/sql/sql_base.cc:5324
      #7  0x000056309b2f91d3 in lock_tables (thd=thd@entry=0x14f154000db8, tables=0x14f154013d30, count=<optimized out>, flags=flags@entry=0) at /test/10.10_dbg/sql/sql_base.cc:5877
      #8  0x000056309b2faebd in open_and_lock_tables (thd=thd@entry=0x14f154000db8, options=<optimized out>, tables=<optimized out>, tables@entry=0x14f154013d30, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x14f1dc12bd40) at /test/10.10_dbg/sql/sql_base.cc:5556
      #9  0x000056309b340b2b in open_and_lock_tables (flags=0, derived=true, tables=0x14f154013d30, thd=0x14f154000db8) at /test/10.10_dbg/sql/sql_base.h:510
      #10 mysql_insert (thd=thd@entry=0x14f154000db8, table_list=0x14f154013d30, fields=@0x14f154005e90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x56309c85aa00 <end_of_list>, last = 0x14f154005e90, elements = 0}, <No data fields>}, values_list=@0x14f154005ed8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14f154014940, last = 0x14f154014b68, elements = 4}, <No data fields>}, update_fields=@0x14f154005ec0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x56309c85aa00 <end_of_list>, last = 0x14f154005ec0, elements = 0}, <No data fields>}, update_values=@0x14f154005ea8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x56309c85aa00 <end_of_list>, last = 0x14f154005ea8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/10.10_dbg/sql/sql_insert.cc:758
      #11 0x000056309b385803 in mysql_execute_command (thd=thd@entry=0x14f154000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.10_dbg/sql/sql_parse.cc:4562
      #12 0x000056309b371e3a in mysql_parse (thd=thd@entry=0x14f154000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14f1dc12c470) at /test/10.10_dbg/sql/sql_parse.cc:8036
      #13 0x000056309b37f422 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14f154000db8, packet=packet@entry=0x14f15400b6d9 "INSERT INTO t1 VALUES ('a'),('A'),('b'),('B')", packet_length=packet_length@entry=45, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_class.h:1364
      #14 0x000056309b381b2c in do_command (thd=0x14f154000db8, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_parse.cc:1407
      #15 0x000056309b4e13c0 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x56309dc85b78, put_in_cache=put_in_cache@entry=true) at /test/10.10_dbg/sql/sql_connect.cc:1418
      #16 0x000056309b4e18c9 in handle_one_connection (arg=0x56309dc85b78) at /test/10.10_dbg/sql/sql_connect.cc:1312
      #17 0x000014f2013c8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x000014f200fb4133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.7.5 (dbg), 10.8.4 (dbg), 10.9.2 (dbg), 10.10.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.36 (dbg), 10.3.36 (opt), 10.4.26 (dbg), 10.4.26 (opt), 10.5.17 (dbg), 10.5.17 (opt), 10.6.9 (dbg), 10.6.9 (opt), 10.7.5 (opt), 10.8.4 (opt), 10.9.2 (opt), 10.10.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thiru Thirunarayanan Balathandayuthapani
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.