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

handler0alter.cc:393: void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `(((core_null) + 7) / 8) == oindex.n_core_null_bytes' failed.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.4.1
    • 10.4.2
    • None
    • Linux Ubuntu 17.10 but most probably not important.

    Description

      The problem was found during RQG testing on MariaDB 10.4 30641f9df77be99d93524e39cdc2b2d783e6d3e1 2018-12-18
      compiled with debug.
      There was no replay of the assert on actual 10.3.
       
      ts_4.test
      --------------
      --source include/have_innodb.inc
       CREATE TABLE IF NOT EXISTS t1 (col1 INT, col2 INT, col_int INTEGER, col_varchar VARCHAR(500), col_text TEXT, col_int_g INTEGER GENERATED ALWAYS AS (col_int) PERSISTENT) ENGINE = InnoDB ROW_FORMAT = Redundant  ;
       ALTER TABLE t1 ADD COLUMN IF NOT EXISTS col2_copy INT FIRST;
       ALTER TABLE t1 ADD COLUMN col1_copy INT FIRST;
       ALTER TABLE t1 ADD COLUMN IF NOT EXISTS col_int_copy INTEGER;
       ALTER TABLE t1 MODIFY COLUMN col_text TEXT NOT NULL;
       ALTER TABLE t1 CHANGE COLUMN IF EXISTS col_text col_text TEXT  ;
      ALTER TABLE t1 MODIFY COLUMN col_int INTEGER AFTER col1;
      --enable_abort_on_error
      SHOW PROCESSLIST;
       
      Version: '10.4.1-MariaDB-debug-log'  socket: ..
      mysqld: storage/innobase/handler/handler0alter.cc:393: void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `(((core_null) + 7) / 8) == oindex.n_core_null_bytes' failed.
      181220 18:45:46 [ERROR] mysqld got signal 6 ;
      ...
      Query (0x7f5118014190): ALTER TABLE t1 MODIFY COLUMN col_int INTEGER AFTER col1
      Connection ID (thread ID): 9
      Status: NOT_KILLED
      ...
      Thread 1 (Thread 0x7f5169ce5700 (LWP 23599)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055d41183db94 in my_write_core (sig=6) at mysys/stacktrace.c:481
      #2  0x000055d411083ca3 in handle_fatal_signal (sig=6) at sql/signal_handler.cc:305
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00007f51709c0f5d in __GI_abort () at abort.c:90
      #6  0x00007f51709b6f17 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55d411b2dd70 "(((core_null) + 7) / 8) == oindex.n_core_null_bytes", file=file@entry=0x55d411b2d980 "storage/innobase/handler/handler0alter.cc", line=line@entry=393, function=function@entry=0x55d411b35ea0 <dict_table_t::prepare_instant(dict_table_t const&, unsigned long const*, unsigned int&)::__PRETTY_FUNCTION__> "void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&)") at assert.c:92
      #7  0x00007f51709b6fc2 in __GI___assert_fail (assertion=0x55d411b2dd70 "(((core_null) + 7) / 8) == oindex.n_core_null_bytes", file=0x55d411b2d980 "storage/innobase/handler/handler0alter.cc", line=393, function=0x55d411b35ea0 <dict_table_t::prepare_instant(dict_table_t const&, unsigned long const*, unsigned int&)::__PRETTY_FUNCTION__> "void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&)") at assert.c:101
      #8  0x000055d4112f1fc8 in dict_table_t::prepare_instant (this=0x7f51181a2958, old=..., col_map=0x7f511818cc90, first_alter_pos=@0x7f51180166e8: 4) at storage/innobase/handler/handler0alter.cc:393
      #9  0x000055d4112f6291 in ha_innobase_inplace_ctx::prepare_instant (this=0x7f5118016578) at storage/innobase/handler/handler0alter.cc:1020
      #10 0x000055d4112e15cb in prepare_inplace_alter_table_dict (ha_alter_info=0x7f5169ce1bb0, altered_table=0x7f51181832d8, old_table=0x7f5118178f58, table_name=0x7f511818a2a5 "t1", flags=0, flags2=80, fts_doc_id_col=18446744073709551615, add_fts_doc_id=false, add_fts_doc_id_idx=false) at storage/innobase/handler/handler0alter.cc:6420
      #11 0x000055d4112e6490 in ha_innobase::prepare_inplace_alter_table (this=0x7f51181851c0, altered_table=0x7f51181832d8, ha_alter_info=0x7f5169ce1bb0) at storage/innobase/handler/handler0alter.cc:7966
      #12 0x000055d41108ff1f in handler::ha_prepare_inplace_alter_table (this=0x7f51181851c0, altered_table=0x7f51181832d8, ha_alter_info=0x7f5169ce1bb0) at sql/handler.cc:4472
      #13 0x000055d410e51037 in mysql_inplace_alter_table (thd=0x7f5118000ce8, table_list=0x7f51180142a8, table=0x7f5118178f58, altered_table=0x7f51181832d8, ha_alter_info=0x7f5169ce1bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f5169ce1ce0, alter_ctx=0x7f5169ce28d0) at sql/sql_table.cc:7505
      #14 0x000055d410e57286 in mysql_alter_table (thd=0x7f5118000ce8, new_db=0x7f51180053b0, new_name=0x7f5118005780, create_info=0x7f5169ce34c0, table_list=0x7f51180142a8, alter_info=0x7f5169ce3400, order_num=0, order=0x0, ignore=false) at sql/sql_table.cc:9688
      #15 0x000055d410ee126e in Sql_cmd_alter_table::execute (this=0x7f5118014a08, thd=0x7f5118000ce8) at sql/sql_alter.cc:491
      #16 0x000055d410d7f8d0 in mysql_execute_command (thd=0x7f5118000ce8) at sql/sql_parse.cc:6302
      #17 0x000055d410d84a8c in mysql_parse (thd=0x7f5118000ce8, rawbuf=0x7f5118014190 "ALTER TABLE t1 MODIFY COLUMN col_int INTEGER AFTER col1", length=55, parser_state=0x7f5169ce45f0, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:8104
      #18 0x000055d410d719ba in dispatch_command (command=COM_QUERY, thd=0x7f5118000ce8, packet=0x7f511800acd9 "ALTER TABLE t1 MODIFY COLUMN col_int INTEGER AFTER col1", packet_length=55, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:1850
      #19 0x000055d410d703cf in do_command (thd=0x7f5118000ce8) at sql/sql_parse.cc:1395
      #20 0x000055d410edb29e in do_handle_one_connection (connect=0x55d4140773b8) at sql/sql_connect.cc:1402
      #21 0x000055d410edb015 in handle_one_connection (arg=0x55d4140773b8) at sql/sql_connect.cc:1308
      #22 0x000055d4117d5d63 in pfs_spawn_thread (arg=0x55d4140ddd08) at storage/perfschema/pfs.cc:1862
      #23 0x00007f51716627fc in start_thread (arg=0x7f5169ce5700) at pthread_create.c:465
      #24 0x00007f5170a9cb5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        1. ts_4.test
          0.7 kB
          Matthias Leich

        Issue Links

          Activity

            People

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