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

[Draft] Assertion failed: prebuilt->trx->error_key_num < ha_alter_info->key_count

    XMLWordPrintable

Details

    Description

      # Run with --repeat=N if it does not crash right away. Add lock wait timeouts if it hangs.
       
      --source include/have_innodb.inc
       
      --connect (con1,localhost,root,,test)
      CREATE TABLE t1 (c CHAR DEFAULT '' UNIQUE) ENGINE=InnoDB;
      INSERT INTO t1 () VALUES ();
       
      --connection default
      --send
      	ALTER TABLE t1 FORCE;
       
      --connection con1
      --error ER_NO_SUCH_TABLE
      ALTER TABLE non_existing FORCE;
      --error ER_DUP_ENTRY
      INSERT INTO t1 () VALUES (),(),(),();
       
      # Cleanup
      --disconnect con1
      --connection default
      --error 0,ER_DUP_ENTRY
      --reap
      DROP TABLE t1;
      

      10.0 debug d8ccc61f76d56b7

      mysqld: /data/src/10.0/storage/innobase/handler/handler0alter.cc:4177: virtual bool ha_innodb::inplace_alter_table(TABLE*, Alter_inplace_info*): Assertion `prebuilt->trx->error_key_num < ha_alter_info->key_count' failed.
      171122 15:16:54 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f04d1458ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00007f04c9f6768b in ha_innodb::inplace_alter_table (this=0x7f04bd845088, altered_table=0x7f04bd5a6070, ha_alter_info=0x7f04d351c260) at /data/src/10.0/storage/innobase/handler/handler0alter.cc:4176
      #9  0x0000000000707b7f in handler::ha_inplace_alter_table (this=0x7f04bd845088, altered_table=0x7f04bd5a6070, ha_alter_info=0x7f04d351c260) at /data/src/10.0/sql/handler.h:3580
      #10 0x00000000007003b1 in mysql_inplace_alter_table (thd=0x7f04c5b69070, table_list=0x7f04bd4fa160, table=0x7f04bd913c70, altered_table=0x7f04bd5a6070, ha_alter_info=0x7f04d351c260, inplace_supported=HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE, target_mdl_request=0x7f04d351bcb0, alter_ctx=0x7f04d351c840) at /data/src/10.0/sql/sql_table.cc:7117
      #11 0x0000000000704ac7 in mysql_alter_table (thd=0x7f04c5b69070, new_db=0x7f04bd4fa740 "test", new_name=0x0, create_info=0x7f04d351d4e0, table_list=0x7f04bd4fa160, alter_info=0x7f04d351d450, order_num=0, order=0x0, ignore=false) at /data/src/10.0/sql/sql_table.cc:8948
      #12 0x000000000076d365 in Sql_cmd_alter_table::execute (this=0x7f04bd4fa748, thd=0x7f04c5b69070) at /data/src/10.0/sql/sql_alter.cc:312
      #13 0x000000000065398b in mysql_execute_command (thd=0x7f04c5b69070) at /data/src/10.0/sql/sql_parse.cc:5114
      #14 0x0000000000656dc2 in mysql_parse (thd=0x7f04c5b69070, rawbuf=0x7f04bd4fa088 "ALTER TABLE t1 FORCE", length=20, parser_state=0x7f04d351e640) at /data/src/10.0/sql/sql_parse.cc:6569
      #15 0x0000000000649901 in dispatch_command (command=COM_QUERY, thd=0x7f04c5b69070, packet=0x7f04cb5ef071 "ALTER TABLE t1 FORCE", packet_length=20) at /data/src/10.0/sql/sql_parse.cc:1296
      #16 0x0000000000648c01 in do_command (thd=0x7f04c5b69070) at /data/src/10.0/sql/sql_parse.cc:999
      #17 0x0000000000768ab8 in do_handle_one_connection (thd_arg=0x7f04c5b69070) at /data/src/10.0/sql/sql_connect.cc:1377
      #18 0x000000000076882a in handle_one_connection (arg=0x7f04c5b69070) at /data/src/10.0/sql/sql_connect.cc:1292
      #19 0x0000000000ac9564 in pfs_spawn_thread (arg=0x7f04c5b19670) at /data/src/10.0/storage/perfschema/pfs.cc:1861
      #20 0x00007f04d315c494 in start_thread (arg=0x7f04d351f700) at pthread_create.c:333
      #21 0x00007f04d151593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      10.0 non-debug 78b63425a3f1

      #2  <signal handler called>
      #3  0x000000000076c626 in field_unpack (to=to@entry=0x7f0ece30dd80, field=0x7f0ece30c5a0, rec=0x7f0eb8840420 "\375 ", max_length=0, prefix_key=false) at /data/src/10.0/sql/key.cc:359
      #4  0x000000000076c77d in key_unpack (to=to@entry=0x7f0ece30dd80, table=table@entry=0x7f0eb8b41008, key=key@entry=0x7f0eb89c82c0) at /data/src/10.0/sql/key.cc:441
      #5  0x00000000006e48d9 in print_keydup_error (table=table@entry=0x7f0eb8b41008, key=0x7f0eb89c82c0, msg=0x7f0ec77aecaa "Duplicate entry '%-.64s' for key '%-.192s'", errflag=errflag@entry=0) at /data/src/10.0/sql/handler.cc:3348
      #6  0x00000000006e4a20 in print_keydup_error (table=table@entry=0x7f0eb8b41008, key=<optimized out>, errflag=errflag@entry=0) at /data/src/10.0/sql/handler.cc:3368
      #7  0x00007f0ec489c16d in ha_innodb::inplace_alter_table (this=0x7f0eb8c3f020, altered_table=0x7f0eb8b41008, ha_alter_info=0x7f0ece30f0f0) at /data/src/10.0/storage/innobase/handler/handler0alter.cc:4203
      #8  0x00000000006203d1 in ha_inplace_alter_table (ha_alter_info=<optimized out>, altered_table=<optimized out>, this=<optimized out>) at /data/src/10.0/sql/handler.h:3580
      #9  mysql_inplace_alter_table (target_mdl_request=<optimized out>, alter_ctx=<optimized out>, inplace_supported=<optimized out>, ha_alter_info=<optimized out>, altered_table=<optimized out>, table=<optimized out>, table_list=<optimized out>, thd=<optimized out>) at /data/src/10.0/sql/sql_table.cc:7118
      #10 mysql_alter_table (thd=0x7f0ec0a75008, new_db=0x7f0ece30c5a0 "", new_name=0x7f0ece30f0f0 "\200\002\061\316\016\177", create_info=0x7f0ece3101f0, table_list=0x7f0eb89c70f8, alter_info=0x7f0eb89c70f8, order_num=0, order=0x0, ignore=false) at /data/src/10.0/sql/sql_table.cc:8949
      #11 0x000000000065e29d in Sql_cmd_alter_table::execute (this=0x7f0ece30c5a0, thd=0x7f0ec0a75008) at /data/src/10.0/sql/sql_alter.cc:312
      #12 0x00000000005a3a87 in mysql_execute_command (thd=0x7f0ec0a75008) at /data/src/10.0/sql/sql_parse.cc:5123
      #13 0x00000000005aa0b8 in mysql_parse (thd=0x7f0ec0a75008, rawbuf=<optimized out>, length=20, parser_state=0x7f0ece311850) at /data/src/10.0/sql/sql_parse.cc:6578
      #14 0x00000000005abad9 in dispatch_command (command=<optimized out>, thd=0x7f0ec0a75008, packet=<optimized out>, packet_length=<optimized out>) at /data/src/10.0/sql/sql_parse.cc:1305
      #15 0x00000000005ac46f in do_command (thd=<optimized out>) at /data/src/10.0/sql/sql_parse.cc:999
      #16 0x000000000065b9e4 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7f0ec0a75008) at /data/src/10.0/sql/sql_connect.cc:1377
      #17 0x000000000065ba28 in handle_one_connection (arg=arg@entry=0x7f0ec0a75008) at /data/src/10.0/sql/sql_connect.cc:1292
      #18 0x000000000088f6d4 in pfs_spawn_thread (arg=0x7f0ecb43f808) at /data/src/10.0/storage/perfschema/pfs.cc:1860
      #19 0x00007f0ecdf4f494 in start_thread (arg=0x7f0ece312700) at pthread_create.c:333
      #20 0x00007f0ecc09a93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible on 10.0-10.3, MySQL 5.6. Not reproducible on 5.5, MySQL 5.7, 8.0.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.