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

Various assertion failures due to MDEV-15562 instant ALTER TABLE

Details

    Description

      10.4 b9a9055793ab8b9a50200e2f5560246

      mysqld: /10.4/src/storage/innobase/handler/handler0alter.cc:348: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `fields[i].same(instant.fields[i])' failed.
      181114 17:22:54 [ERROR] mysqld got signal 6 ;
       
      stdlib/abort.c:91(__GI_abort)[0x7eff6adf602a]
      assert/assert.c:92(__assert_fail_base)[0x7eff6adecbd7]
      /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7eff6adecc82]
      handler/handler0alter.cc:349(dict_index_t::instant_add_field(dict_index_t const&))[0x561842709dd7]
      handler/handler0alter.cc:491(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x56184270c46e]
      handler/handler0alter.cc:5251(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x5618426d9c30]
      handler/handler0alter.cc:9890(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x561842716ebf]
      handler/handler0alter.cc:10519(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5618426fb413]
      sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x561841e55b14]
      sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x56184196a731]
      sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x561841976f18]
      sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x561841ab5916]
      sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x56184176f692]
      sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x561841779ea1]
      sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x561841754d9e]
      sql/sql_parse.cc:1396(do_command(THD*))[0x561841751f36]
      sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x561841aa6da7]
      sql/sql_connect.cc:1309(handle_one_connection)[0x561841aa6784]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7eff6ba316ba]
      x86_64/clone.S:111(clone)[0x7eff6aec641d]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x62b000085288): ALTER TABLE `AA` ADD COLUMN ( icol1 TINYINT UNSIGNED ZEROFILL NOT NULL );
      

      mysqld: /10.4/src/storage/innobase/row/row0sel.cc:2905: void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint): Assertion `(templ->is_virtual && !field) || (field && field->prefix_len ? field->prefix_len == len : templ->mysql_col_len == len)' failed.
      181114 17:24:58 [ERROR] mysqld got signal 6 ;
       
      linux/raise.c:54(__GI_raise)[0x7fde2d4f8428]
      stdlib/abort.c:91(__GI_abort)[0x7fde2d4fa02a]
      assert/assert.c:92(__assert_fail_base)[0x7fde2d4f0bd7]
      /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fde2d4f0c82]
      row/row0sel.cc:2909(row_sel_field_store_in_mysql_format_func(unsigned char*, mysql_row_templ_t const*, dict_index_t const*, unsigned long, unsigned char const*, unsigned long))[0x55e20889704a]
      row/row0sel.cc:3073(row_sel_store_mysql_field_func(unsigned char*, row_prebuilt_t*, unsigned char const*, dict_index_t const*, unsigned long const*, unsigned long, mysql_row_templ_t const*))[0x55e208898153]
      row/row0sel.cc:3200(row_sel_store_mysql_rec(unsigned char*, row_prebuilt_t*, unsigned char const*, dtuple_t const*, bool, dict_index_t const*, unsigned long const*))[0x55e208899044]
      row/row0sel.cc:5480(row_search_mvcc(unsigned char*, page_cur_mode_t, row_prebuilt_t*, unsigned long, unsigned long))[0x55e2088a3732]
      handler/ha_innodb.cc:9258(ha_innobase::index_read(unsigned char*, unsigned char const*, unsigned int, ha_rkey_function))[0x55e2085867b7]
      handler/ha_innodb.cc:9635(ha_innobase::index_first(unsigned char*))[0x55e20858925f]
      handler/ha_innodb.cc:9728(ha_innobase::rnd_next(unsigned char*))[0x55e20858983e]
      sql/handler.cc:2765(handler::ha_rnd_next(unsigned char*))[0x55e207d61fd0]
      sql/records.cc:481(rr_sequential(READ_RECORD*))[0x55e2080f8127]
      sql/records.h:73(READ_RECORD::read_record())[0x55e20750e252]
      sql/sql_select.cc:20295(join_init_read_record(st_join_table*))[0x55e207791fc9]
      sql/sql_select.cc:19359(sub_select(JOIN*, st_join_table*, bool))[0x55e20778b9cf]
      sql/sql_select.cc:18902(do_select(JOIN*, Procedure*))[0x55e20778a027]
      sql/sql_select.cc:4082(JOIN::exec_inner())[0x55e207728be5]
      sql/sql_select.cc:3877(JOIN::exec())[0x55e20772692a]
      sql/sql_select.cc:4283(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55e207729cb5]
      sql/sql_select.cc:385(handle_select(THD*, LEX*, select_result*, unsigned long))[0x55e207704205]
      sql/sql_parse.cc:6554(execute_sqlcom_select(THD*, TABLE_LIST*))[0x55e20768a8fc]
      sql/sql_parse.cc:3773(mysql_execute_command(THD*))[0x55e207679056]
      sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55e207692ea1]
      sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55e20766dd9e]
      sql/sql_parse.cc:1396(do_command(THD*))[0x55e20766af36]
      sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x55e2079bfda7]
      sql/sql_connect.cc:1309(handle_one_connection)[0x55e2079bf784]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fde2e1356ba]
      x86_64/clone.S:111(clone)[0x7fde2d5ca41d]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x62b00007e288): select * from AA
      

      mysqld: /10.4/src/storage/innobase/row/row0merge.cc:766: ulint row_merge_buf_add(row_merge_buf_t*, dict_index_t*, const dict_table_t*, const dict_table_t*, fts_psort_t*, const dtuple_t*, const row_ext_t*, doc_id_t*, mem_heap_t*, dberr_t*, mem_heap_t**, TABLE*, trx_t*): Assertion `len <= col->len || ((col->mtype) == 5 || (col->mtype) == 14)' failed.
      181114 17:29:39 [ERROR] mysqld got signal 6 ;
       
      linux/raise.c:54(__GI_raise)[0x7f574c9f3428]
      stdlib/abort.c:91(__GI_abort)[0x7f574c9f502a]
      assert/assert.c:92(__assert_fail_base)[0x7f574c9ebbd7]
      /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f574c9ebc82]
      row/row0merge.cc:769(row_merge_buf_add(row_merge_buf_t*, dict_index_t*, dict_table_t const*, dict_table_t const*, fts_psort_t*, dtuple_t const*, row_ext_t const*, unsigned long*, mem_block_info_t*, dberr_t*, mem_block_info_t**, TABLE*, trx_t*))[0x55cb6d0aeea8]
      row/row0merge.cc:2383(row_merge_read_clustered_index(trx_t*, TABLE*, dict_table_t const*, dict_table_t*, bool, dict_index_t**, dict_index_t*, fts_psort_t*, merge_file_t*, unsigned long const*, unsigned long, dtuple_t const*, dict_add_v_col_t const*, unsigned long const*, unsigned long, ib_sequence_t&, unsigned char*, bool, pfs_os_file_t*, ut_stage_alter_t*, double, unsigned char*, TABLE*, bool))[0x55cb6d0b8507]
      row/row0merge.cc:4766(row_merge_build_indexes(trx_t*, dict_table_t*, dict_table_t*, bool, dict_index_t**, unsigned long const*, unsigned long, TABLE*, dtuple_t const*, unsigned long const*, unsigned long, ib_sequence_t&, bool, ut_stage_alter_t*, dict_add_v_col_t const*, TABLE*, bool))[0x55cb6d0c4a1b]
      handler/handler0alter.cc:8041(ha_innobase::inplace_alter_table(TABLE*, Alter_inplace_info*))[0x55cb6cebdc6f]
      sql/handler.h:4184(handler::ha_inplace_alter_table(TABLE*, Alter_inplace_info*))[0x55cb6c14d4ee]
      sql/sql_table.cc:7555(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x55cb6c137339]
      sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x55cb6c143f18]
      sql/sql_table.cc:10604(mysql_recreate_table(THD*, TABLE_LIST*, bool))[0x55cb6c149fcd]
      sql/sql_admin.cc:58(admin_recreate_table(THD*, TABLE_LIST*))[0x55cb6c294f99]
      sql/sql_admin.cc:1027(mysql_admin_table(THD*, TABLE_LIST*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned int, int (*)(THD*, TABLE_LIST*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, TABLE_LIST*, st_ha_check_opt*)))[0x55cb6c29bf14]
      sql/sql_admin.cc:1375(Sql_cmd_optimize_table::execute(THD*))[0x55cb6c29ea20]
      sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x55cb6bf3c692]
      sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55cb6bf46ea1]
      sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55cb6bf21d9e]
      sql/sql_parse.cc:1396(do_command(THD*))[0x55cb6bf1ef36]
      sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x55cb6c273da7]
      sql/sql_connect.cc:1309(handle_one_connection)[0x55cb6c273784]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f574d6306ba]
      x86_64/clone.S:111(clone)[0x7f574cac541d]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x62b00007e288): optimize table AA
      

      On the non-debug build:

      2018-11-14 17:56:47 17 [ERROR] InnoDB: Page old data size 64130 new data size 166, page old max ins size 0 new max ins size 16084
      2018-11-14 17:56:47 17 [ERROR] InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
      

      to reproduce:

      perl ./runall-trials.pl --basedir=/git/10.4 --vardir=/1q --duration=350 --threads=6   --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --views  --mysqld=--log_output=FILE --mysqld=--max-statement-time=30 --engine=Aria   --grammar=conf/mariadb/instant_add.yy --mysqld=--performance-schema --gendata --vcols --transformers=ExecuteAsIntersect,ExecuteAsExcept,ExecuteAsCTE,ExecuteAsExecuteImmediate,ExecuteAsDeleteReturning,ExecuteAsInsertSelect,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsPreparedTwice --trials=10 --force
      

      Attachments

        1. `instant.n_core_fields == n_core_fields' .7z
          5.03 MB
        2. &fields[n_fields.7z
          3.77 MB
        3. dt.7z
          1.71 MB
        4. instant.n_nullable.7z
          2.03 MB

        Issue Links

          Activity

            In a failure that I analyzed in more detail, 2 instant ADD COLUMN were executed since the table was rebuilt: to the end, and to the start of the table (which is allowed by MDEV-15562). The error occurred when trying to read the very first row in ALGORITHM=COPY. A TIMESTAMP column was incorrectly declared inside InnoDB as having a length of only 1 byte.

            marko Marko Mäkelä added a comment - In a failure that I analyzed in more detail, 2 instant ADD COLUMN were executed since the table was rebuilt: to the end, and to the start of the table (which is allowed by MDEV-15562 ). The error occurred when trying to read the very first row in ALGORITHM=COPY . A TIMESTAMP column was incorrectly declared inside InnoDB as having a length of only 1 byte.

            Another one, might be related:

            --source include/have_innodb.inc
            CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, f INT) ENGINE=InnoDB;
            INSERT INTO t1 (f) VALUES (1),(2),(3);
            ALTER TABLE t1 DROP PRIMARY KEY, ADD KEY (pk);
            ALTER TABLE t1 DROP COLUMN IF EXISTS f;
             
            # Cleanup
            DROP TABLE t1;
            

            10.4 fde5386d16d

            2018-11-15 21:36:45 0x7fd3823f8700  InnoDB: Assertion failure in file /data/src/10.4/storage/innobase/include/row0row.ic line 215
            InnoDB: We intentionally generate a memory trap.
             
            #5  0x00007fd38d0da3fa in abort () from /lib/x86_64-linux-gnu/libc.so.6
            #6  0x000055db6906d9ea in ut_dbg_assertion_failed (expr=0x0, file=0x55db6961bad8 "/data/src/10.4/storage/innobase/include/row0row.ic", line=215) at /data/src/10.4/storage/innobase/ut/ut0dbg.cc:61
            #7  0x000055db68f8a2d8 in row_parse_int (data=0x7fd33406a790 "", len=8, mtype=5, unsigned_type=false) at /data/src/10.4/storage/innobase/include/row0row.ic:215
            #8  0x000055db68f866a8 in row_ins_clust_index_entry_low (flags=2, mode=33, index=0x7fd33404b608, n_uniq=1, entry=0x7fd33406a6b8, n_ext=0, thr=0x7fd33406a858, dup_chk_only=false) at /data/src/10.4/storage/innobase/row/row0ins.cc:2618
            #9  0x000055db68e7db5d in innobase_instant_try (ha_alter_info=0x7fd3823f4bb0, ctx=0x7fd3340162f0, altered_table=0x7fd334065970, table=0x7fd33412d7e0, trx=0x7fd382c5b218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5524
            #10 0x000055db68e97367 in commit_try_norebuild (ha_alter_info=0x7fd3823f4bb0, ctx=0x7fd3340162f0, altered_table=0x7fd334065970, old_table=0x7fd33412d7e0, trx=0x7fd382c5b218, table_name=0x7fd334130ced "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:9890
            #11 0x000055db68e8afa2 in ha_innobase::commit_inplace_alter_table (this=0x7fd334094d48, altered_table=0x7fd334065970, ha_alter_info=0x7fd3823f4bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10519
            #12 0x000055db68b2723a in handler::ha_commit_inplace_alter_table (this=0x7fd334094d48, altered_table=0x7fd334065970, ha_alter_info=0x7fd3823f4bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457
            #13 0x000055db688f9244 in mysql_inplace_alter_table (thd=0x7fd334000b00, table_list=0x7fd334014e90, table=0x7fd33412d7e0, altered_table=0x7fd334065970, ha_alter_info=0x7fd3823f4bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fd3823f4ce0, alter_ctx=0x7fd3823f58d0) at /data/src/10.4/sql/sql_table.cc:7601
            #14 0x000055db688ff05f in mysql_alter_table (thd=0x7fd334000b00, new_db=0x7fd3340051b8, new_name=0x7fd334005588, create_info=0x7fd3823f64c0, table_list=0x7fd334014e90, alter_info=0x7fd3823f6400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9694
            #15 0x000055db68987931 in Sql_cmd_alter_table::execute (this=0x7fd3340154f8, thd=0x7fd334000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #16 0x000055db68827800 in mysql_execute_command (thd=0x7fd334000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #17 0x000055db6882c724 in mysql_parse (thd=0x7fd334000b00, rawbuf=0x7fd334014d98 "ALTER TABLE t1 DROP COLUMN IF EXISTS f", length=38, parser_state=0x7fd3823f7600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #18 0x000055db68819a23 in dispatch_command (command=COM_QUERY, thd=0x7fd334000b00, packet=0x7fd33400b401 "ALTER TABLE t1 DROP COLUMN IF EXISTS f", packet_length=38, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #19 0x000055db68818447 in do_command (thd=0x7fd334000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #20 0x000055db68981c58 in do_handle_one_connection (connect=0x55db6bef9ee0) at /data/src/10.4/sql/sql_connect.cc:1402
            #21 0x000055db689819dc in handle_one_connection (arg=0x55db6bef9ee0) at /data/src/10.4/sql/sql_connect.cc:1308
            #22 0x000055db68e265e9 in pfs_spawn_thread (arg=0x55db6bf7f1b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #23 0x00007fd38eb8d494 in start_thread (arg=0x7fd3823f8700) at pthread_create.c:333
            #24 0x00007fd38d18e93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            Not reproducible on 10.3.

            elenst Elena Stepanova added a comment - Another one, might be related: --source include/have_innodb.inc CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY , f INT ) ENGINE=InnoDB; INSERT INTO t1 (f) VALUES (1),(2),(3); ALTER TABLE t1 DROP PRIMARY KEY , ADD KEY (pk); ALTER TABLE t1 DROP COLUMN IF EXISTS f;   # Cleanup DROP TABLE t1; 10.4 fde5386d16d 2018-11-15 21:36:45 0x7fd3823f8700 InnoDB: Assertion failure in file /data/src/10.4/storage/innobase/include/row0row.ic line 215 InnoDB: We intentionally generate a memory trap.   #5 0x00007fd38d0da3fa in abort () from /lib/x86_64-linux-gnu/libc.so.6 #6 0x000055db6906d9ea in ut_dbg_assertion_failed (expr=0x0, file=0x55db6961bad8 "/data/src/10.4/storage/innobase/include/row0row.ic", line=215) at /data/src/10.4/storage/innobase/ut/ut0dbg.cc:61 #7 0x000055db68f8a2d8 in row_parse_int (data=0x7fd33406a790 "", len=8, mtype=5, unsigned_type=false) at /data/src/10.4/storage/innobase/include/row0row.ic:215 #8 0x000055db68f866a8 in row_ins_clust_index_entry_low (flags=2, mode=33, index=0x7fd33404b608, n_uniq=1, entry=0x7fd33406a6b8, n_ext=0, thr=0x7fd33406a858, dup_chk_only=false) at /data/src/10.4/storage/innobase/row/row0ins.cc:2618 #9 0x000055db68e7db5d in innobase_instant_try (ha_alter_info=0x7fd3823f4bb0, ctx=0x7fd3340162f0, altered_table=0x7fd334065970, table=0x7fd33412d7e0, trx=0x7fd382c5b218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5524 #10 0x000055db68e97367 in commit_try_norebuild (ha_alter_info=0x7fd3823f4bb0, ctx=0x7fd3340162f0, altered_table=0x7fd334065970, old_table=0x7fd33412d7e0, trx=0x7fd382c5b218, table_name=0x7fd334130ced "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:9890 #11 0x000055db68e8afa2 in ha_innobase::commit_inplace_alter_table (this=0x7fd334094d48, altered_table=0x7fd334065970, ha_alter_info=0x7fd3823f4bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10519 #12 0x000055db68b2723a in handler::ha_commit_inplace_alter_table (this=0x7fd334094d48, altered_table=0x7fd334065970, ha_alter_info=0x7fd3823f4bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457 #13 0x000055db688f9244 in mysql_inplace_alter_table (thd=0x7fd334000b00, table_list=0x7fd334014e90, table=0x7fd33412d7e0, altered_table=0x7fd334065970, ha_alter_info=0x7fd3823f4bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fd3823f4ce0, alter_ctx=0x7fd3823f58d0) at /data/src/10.4/sql/sql_table.cc:7601 #14 0x000055db688ff05f in mysql_alter_table (thd=0x7fd334000b00, new_db=0x7fd3340051b8, new_name=0x7fd334005588, create_info=0x7fd3823f64c0, table_list=0x7fd334014e90, alter_info=0x7fd3823f6400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9694 #15 0x000055db68987931 in Sql_cmd_alter_table::execute (this=0x7fd3340154f8, thd=0x7fd334000b00) at /data/src/10.4/sql/sql_alter.cc:497 #16 0x000055db68827800 in mysql_execute_command (thd=0x7fd334000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #17 0x000055db6882c724 in mysql_parse (thd=0x7fd334000b00, rawbuf=0x7fd334014d98 "ALTER TABLE t1 DROP COLUMN IF EXISTS f", length=38, parser_state=0x7fd3823f7600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #18 0x000055db68819a23 in dispatch_command (command=COM_QUERY, thd=0x7fd334000b00, packet=0x7fd33400b401 "ALTER TABLE t1 DROP COLUMN IF EXISTS f", packet_length=38, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #19 0x000055db68818447 in do_command (thd=0x7fd334000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #20 0x000055db68981c58 in do_handle_one_connection (connect=0x55db6bef9ee0) at /data/src/10.4/sql/sql_connect.cc:1402 #21 0x000055db689819dc in handle_one_connection (arg=0x55db6bef9ee0) at /data/src/10.4/sql/sql_connect.cc:1308 #22 0x000055db68e265e9 in pfs_spawn_thread (arg=0x55db6bf7f1b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #23 0x00007fd38eb8d494 in start_thread (arg=0x7fd3823f8700) at pthread_create.c:333 #24 0x00007fd38d18e93f in clone () from /lib/x86_64-linux-gnu/libc.so.6 Not reproducible on 10.3.
            elenst Elena Stepanova added a comment - - edited

            --source include/have_innodb.inc
             
            CREATE TABLE t1 (i INT, t TIMESTAMP) ENGINE=InnoDB;
            INSERT INTO t1 (i) VALUES (1),(2);
            ALTER TABLE t1 ADD COLUMN b BIT FIRST;
            ALTER TABLE t1 ADD COLUMN v TIMESTAMP AS (t) VIRTUAL;
            ALTER TABLE t1 ADD COLUMN IF NOT EXISTS i INT AFTER t, ALGORITHM=COPY;
             
            # Cleanup
            DROP TABLE t1;
            

            10.4 fde5386d16d

            mysqld: /data/src/10.4/storage/innobase/row/row0sel.cc:2783: void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint): Assertion `templ->mysql_col_len == len' failed.
            181116  2:19:36 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007fbe1e8f2ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x00005587592f7c88 in row_sel_field_store_in_mysql_format_func (dest=0x7fbdcc043892 "", templ=0x7fbdcc045440, index=0x7fbdcc12e7d8, field_no=3, data=0x7fbe13ce4091 "\200", len=1) at /data/src/10.4/storage/innobase/row/row0sel.cc:2783
            #9  0x00005587592f8a99 in row_sel_store_mysql_field_func (mysql_rec=0x7fbdcc043890 "\377", prebuilt=0x7fbdcc132368, rec=0x7fbe13ce407e "", index=0x7fbdcc12e7d8, offsets=0x7fbe18494460, field_no=3, templ=0x7fbdcc045440) at /data/src/10.4/storage/innobase/row/row0sel.cc:3070
            #10 0x00005587592f8ff9 in row_sel_store_mysql_rec (mysql_rec=0x7fbdcc043890 "\377", prebuilt=0x7fbdcc132368, rec=0x7fbe13ce407e "", vrow=0x0, rec_clust=false, index=0x7fbdcc12e7d8, offsets=0x7fbe18494460) at /data/src/10.4/storage/innobase/row/row0sel.cc:3200
            #11 0x00005587592fec6c in row_search_mvcc (buf=0x7fbdcc043890 "\377", mode=PAGE_CUR_G, prebuilt=0x7fbdcc132368, match_mode=0, direction=0) at /data/src/10.4/storage/innobase/row/row0sel.cc:5484
            #12 0x000055875915d3ad in ha_innobase::index_read (this=0x7fbdcc131aa8, buf=0x7fbdcc043890 "\377", key_ptr=0x0, key_len=0, find_flag=HA_READ_AFTER_KEY) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:9258
            #13 0x000055875915e204 in ha_innobase::index_first (this=0x7fbdcc131aa8, buf=0x7fbdcc043890 "\377") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:9635
            #14 0x000055875915e40f in ha_innobase::rnd_next (this=0x7fbdcc131aa8, buf=0x7fbdcc043890 "\377") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:9728
            #15 0x0000558758e35481 in handler::ha_rnd_next (this=0x7fbdcc131aa8, buf=0x7fbdcc043890 "\377") at /data/src/10.4/sql/handler.cc:2765
            #16 0x0000558758fb9797 in rr_sequential (info=0x7fbe18495100) at /data/src/10.4/sql/records.cc:481
            #17 0x0000558758a9499b in READ_RECORD::read_record (this=0x7fbe18495100) at /data/src/10.4/sql/records.h:73
            #18 0x0000558758c14cc8 in copy_data_between_tables (thd=0x7fbdcc000b00, from=0x7fbdcc042c50, to=0x7fbdcc0462e0, create=..., ignore=false, order_num=0, order=0x0, copied=0x7fbe18495ac8, deleted=0x7fbe18495ad0, keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7fbe184968d0) at /data/src/10.4/sql/sql_table.cc:10380
            #19 0x0000558758c129f8 in mysql_alter_table (thd=0x7fbdcc000b00, new_db=0x7fbdcc0051b8, new_name=0x7fbdcc005588, create_info=0x7fbe184974c0, table_list=0x7fbdcc014ed0, alter_info=0x7fbe18497400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9878
            #20 0x0000558758c9a931 in Sql_cmd_alter_table::execute (this=0x7fbdcc015638, thd=0x7fbdcc000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #21 0x0000558758b3a800 in mysql_execute_command (thd=0x7fbdcc000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #22 0x0000558758b3f724 in mysql_parse (thd=0x7fbdcc000b00, rawbuf=0x7fbdcc014d98 "ALTER TABLE t1 ADD COLUMN IF NOT EXISTS i INT AFTER t, ALGORITHM=COPY", length=69, parser_state=0x7fbe18498600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #23 0x0000558758b2ca23 in dispatch_command (command=COM_QUERY, thd=0x7fbdcc000b00, packet=0x7fbdcc093d91 "ALTER TABLE t1 ADD COLUMN IF NOT EXISTS i INT AFTER t, ALGORITHM=COPY", packet_length=69, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #24 0x0000558758b2b447 in do_command (thd=0x7fbdcc000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #25 0x0000558758c94c58 in do_handle_one_connection (connect=0x55875d053ee0) at /data/src/10.4/sql/sql_connect.cc:1402
            #26 0x0000558758c949dc in handle_one_connection (arg=0x55875d053ee0) at /data/src/10.4/sql/sql_connect.cc:1308
            #27 0x00005587591395e9 in pfs_spawn_thread (arg=0x55875d0d91b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #28 0x00007fbe203ae494 in start_thread (arg=0x7fbe18499700) at pthread_create.c:333
            #29 0x00007fbe1e9af93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            Not reproducible on 10.3.

            elenst Elena Stepanova added a comment - - edited --source include/have_innodb.inc   CREATE TABLE t1 (i INT , t TIMESTAMP ) ENGINE=InnoDB; INSERT INTO t1 (i) VALUES (1),(2); ALTER TABLE t1 ADD COLUMN b BIT FIRST ; ALTER TABLE t1 ADD COLUMN v TIMESTAMP AS (t) VIRTUAL; ALTER TABLE t1 ADD COLUMN IF NOT EXISTS i INT AFTER t, ALGORITHM=COPY;   # Cleanup DROP TABLE t1; 10.4 fde5386d16d mysqld: /data/src/10.4/storage/innobase/row/row0sel.cc:2783: void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint): Assertion `templ->mysql_col_len == len' failed. 181116 2:19:36 [ERROR] mysqld got signal 6 ;   #7 0x00007fbe1e8f2ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x00005587592f7c88 in row_sel_field_store_in_mysql_format_func (dest=0x7fbdcc043892 "", templ=0x7fbdcc045440, index=0x7fbdcc12e7d8, field_no=3, data=0x7fbe13ce4091 "\200", len=1) at /data/src/10.4/storage/innobase/row/row0sel.cc:2783 #9 0x00005587592f8a99 in row_sel_store_mysql_field_func (mysql_rec=0x7fbdcc043890 "\377", prebuilt=0x7fbdcc132368, rec=0x7fbe13ce407e "", index=0x7fbdcc12e7d8, offsets=0x7fbe18494460, field_no=3, templ=0x7fbdcc045440) at /data/src/10.4/storage/innobase/row/row0sel.cc:3070 #10 0x00005587592f8ff9 in row_sel_store_mysql_rec (mysql_rec=0x7fbdcc043890 "\377", prebuilt=0x7fbdcc132368, rec=0x7fbe13ce407e "", vrow=0x0, rec_clust=false, index=0x7fbdcc12e7d8, offsets=0x7fbe18494460) at /data/src/10.4/storage/innobase/row/row0sel.cc:3200 #11 0x00005587592fec6c in row_search_mvcc (buf=0x7fbdcc043890 "\377", mode=PAGE_CUR_G, prebuilt=0x7fbdcc132368, match_mode=0, direction=0) at /data/src/10.4/storage/innobase/row/row0sel.cc:5484 #12 0x000055875915d3ad in ha_innobase::index_read (this=0x7fbdcc131aa8, buf=0x7fbdcc043890 "\377", key_ptr=0x0, key_len=0, find_flag=HA_READ_AFTER_KEY) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:9258 #13 0x000055875915e204 in ha_innobase::index_first (this=0x7fbdcc131aa8, buf=0x7fbdcc043890 "\377") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:9635 #14 0x000055875915e40f in ha_innobase::rnd_next (this=0x7fbdcc131aa8, buf=0x7fbdcc043890 "\377") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:9728 #15 0x0000558758e35481 in handler::ha_rnd_next (this=0x7fbdcc131aa8, buf=0x7fbdcc043890 "\377") at /data/src/10.4/sql/handler.cc:2765 #16 0x0000558758fb9797 in rr_sequential (info=0x7fbe18495100) at /data/src/10.4/sql/records.cc:481 #17 0x0000558758a9499b in READ_RECORD::read_record (this=0x7fbe18495100) at /data/src/10.4/sql/records.h:73 #18 0x0000558758c14cc8 in copy_data_between_tables (thd=0x7fbdcc000b00, from=0x7fbdcc042c50, to=0x7fbdcc0462e0, create=..., ignore=false, order_num=0, order=0x0, copied=0x7fbe18495ac8, deleted=0x7fbe18495ad0, keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7fbe184968d0) at /data/src/10.4/sql/sql_table.cc:10380 #19 0x0000558758c129f8 in mysql_alter_table (thd=0x7fbdcc000b00, new_db=0x7fbdcc0051b8, new_name=0x7fbdcc005588, create_info=0x7fbe184974c0, table_list=0x7fbdcc014ed0, alter_info=0x7fbe18497400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9878 #20 0x0000558758c9a931 in Sql_cmd_alter_table::execute (this=0x7fbdcc015638, thd=0x7fbdcc000b00) at /data/src/10.4/sql/sql_alter.cc:497 #21 0x0000558758b3a800 in mysql_execute_command (thd=0x7fbdcc000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #22 0x0000558758b3f724 in mysql_parse (thd=0x7fbdcc000b00, rawbuf=0x7fbdcc014d98 "ALTER TABLE t1 ADD COLUMN IF NOT EXISTS i INT AFTER t, ALGORITHM=COPY", length=69, parser_state=0x7fbe18498600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #23 0x0000558758b2ca23 in dispatch_command (command=COM_QUERY, thd=0x7fbdcc000b00, packet=0x7fbdcc093d91 "ALTER TABLE t1 ADD COLUMN IF NOT EXISTS i INT AFTER t, ALGORITHM=COPY", packet_length=69, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #24 0x0000558758b2b447 in do_command (thd=0x7fbdcc000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #25 0x0000558758c94c58 in do_handle_one_connection (connect=0x55875d053ee0) at /data/src/10.4/sql/sql_connect.cc:1402 #26 0x0000558758c949dc in handle_one_connection (arg=0x55875d053ee0) at /data/src/10.4/sql/sql_connect.cc:1308 #27 0x00005587591395e9 in pfs_spawn_thread (arg=0x55875d0d91b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #28 0x00007fbe203ae494 in start_thread (arg=0x7fbe18499700) at pthread_create.c:333 #29 0x00007fbe1e9af93f in clone () from /lib/x86_64-linux-gnu/libc.so.6 Not reproducible on 10.3.

            Based elenst’s first test case I filed and fixed MDEV-17735.

            Here is a simpler version of the second test case:

            diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test
            index 243ba333903..ff1c2da330d 100644
            --- a/mysql-test/suite/innodb/t/instant_alter.test
            +++ b/mysql-test/suite/innodb/t/instant_alter.test
            @@ -410,6 +410,13 @@ UPDATE t1 SET a=a+2;
             SELECT * FROM t1;
             DROP TABLE t1;
             
            +eval CREATE TABLE t1 (i INT) $engine;
            +INSERT INTO t1 SET i=1;
            +ALTER TABLE t1 ADD COLUMN b BIT FIRST;
            +ALTER TABLE t1 ADD COLUMN v INT AS (i) VIRTUAL;
            +SELECT * FROM t1;
            +DROP TABLE t1;
            +
             dec $format;
             }
             disconnect analyze;
            

            The second ALTER TABLE will corrupt the metadata, causing a crash in anything that reads the table:

            10.4 f85012246cec2a774c5c1fa895b1e593eaf69081

            CURRENT_TEST: innodb.instant_alter
            mysqltest: At line 421: query 'SELECT * FROM t1' failed: 2013: Lost connection to MySQL server during query
            …
            mysqld: /mariadb/10.4/storage/innobase/row/row0sel.cc:2783: void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint): Assertion `templ->mysql_col_len == len' failed.
            

            If the two operations are merged into a single statement, then there is no crash:

            ALTER TABLE t1 ADD COLUMN b BIT FIRST, ADD COLUMN v INT AS (i) VIRTUAL;
            

            marko Marko Mäkelä added a comment - Based elenst ’s first test case I filed and fixed MDEV-17735 . Here is a simpler version of the second test case: diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test index 243ba333903..ff1c2da330d 100644 --- a/mysql-test/suite/innodb/t/instant_alter.test +++ b/mysql-test/suite/innodb/t/instant_alter.test @@ -410,6 +410,13 @@ UPDATE t1 SET a=a+2; SELECT * FROM t1; DROP TABLE t1; +eval CREATE TABLE t1 (i INT) $engine; +INSERT INTO t1 SET i=1; +ALTER TABLE t1 ADD COLUMN b BIT FIRST; +ALTER TABLE t1 ADD COLUMN v INT AS (i) VIRTUAL; +SELECT * FROM t1; +DROP TABLE t1; + dec $format; } disconnect analyze; The second ALTER TABLE will corrupt the metadata, causing a crash in anything that reads the table: 10.4 f85012246cec2a774c5c1fa895b1e593eaf69081 CURRENT_TEST: innodb.instant_alter mysqltest: At line 421: query 'SELECT * FROM t1' failed: 2013: Lost connection to MySQL server during query … mysqld: /mariadb/10.4/storage/innobase/row/row0sel.cc:2783: void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint): Assertion `templ->mysql_col_len == len' failed. If the two operations are merged into a single statement, then there is no crash: ALTER TABLE t1 ADD COLUMN b BIT FIRST , ADD COLUMN v INT AS (i) VIRTUAL;

            The merged ALTER TABLE operation will require a table rebuild until MDEV-17468 will allow ALGORITHM=INSTANT.
            Similarly, if the two ALTER TABLE statements are swapped with each other, then the ADD COLUMN b would require a table rebuild.

            The corrupted metadata of the test case survives a server restart. The corruption involves swapping the fixed_len of the index fields corresponding to the stored columns b and i:

            (gdb) p *index->fields@index.n_fields
            $1 = {{col = 0x7fffa801dea8, name = {m_name = 0x7fffa801dfb4 "DB_ROW_ID"}, 
                prefix_len = 0, fixed_len = 6}, {col = 0x7fffa801dec8, name = {
                  m_name = 0x7fffa801dfbe "DB_TRX_ID"}, prefix_len = 0, fixed_len = 6}, {
                col = 0x7fffa801dee8, name = {m_name = 0x7fffa801dfc8 "DB_ROLL_PTR"}, 
                prefix_len = 0, fixed_len = 7}, {col = 0x7fffa801de88, name = {
                  m_name = 0x7fffa801dfb2 "i"}, prefix_len = 0, fixed_len = 1}, {
                col = 0x7fffa801de68, name = {m_name = 0x7fffa801dfb0 "b"}, 
                prefix_len = 0, fixed_len = 4}}
            

            This metadata is created based on what is stored in SYS_COLUMNS. InnoDB fails to adjust the metadata when loading a table definition.
            The virtual column operation involves a hack that should be removed in MDEV-17468:

            		dict_table_remove_from_cache(m_prebuilt->table);
            		m_prebuilt->table = dict_table_open_on_name(
            			tb_name, TRUE, TRUE, DICT_ERR_IGNORE_NONE);
            

            Here is a simpler test case that does not involve virtual columns, but merely restarting the server:

            --source include/have_innodb.inc
            CREATE TABLE t1 (i INT) ENGINE=InnoDB;
            INSERT INTO t1 SET i=1;
            ALTER TABLE t1 ADD COLUMN b BIT FIRST, ALGORITHM=INSTANT;
            --source include/restart_mysqld.inc
            SELECT * FROM t1;
            DROP TABLE t1;
            

            marko Marko Mäkelä added a comment - The merged ALTER TABLE operation will require a table rebuild until MDEV-17468 will allow ALGORITHM=INSTANT . Similarly, if the two ALTER TABLE statements are swapped with each other, then the ADD COLUMN b would require a table rebuild. The corrupted metadata of the test case survives a server restart. The corruption involves swapping the fixed_len of the index fields corresponding to the stored columns b and i : (gdb) p *index->fields@index.n_fields $1 = {{col = 0x7fffa801dea8, name = {m_name = 0x7fffa801dfb4 "DB_ROW_ID"}, prefix_len = 0, fixed_len = 6}, {col = 0x7fffa801dec8, name = { m_name = 0x7fffa801dfbe "DB_TRX_ID"}, prefix_len = 0, fixed_len = 6}, { col = 0x7fffa801dee8, name = {m_name = 0x7fffa801dfc8 "DB_ROLL_PTR"}, prefix_len = 0, fixed_len = 7}, {col = 0x7fffa801de88, name = { m_name = 0x7fffa801dfb2 "i"}, prefix_len = 0, fixed_len = 1}, { col = 0x7fffa801de68, name = {m_name = 0x7fffa801dfb0 "b"}, prefix_len = 0, fixed_len = 4}} This metadata is created based on what is stored in SYS_COLUMNS . InnoDB fails to adjust the metadata when loading a table definition. The virtual column operation involves a hack that should be removed in MDEV-17468 : dict_table_remove_from_cache(m_prebuilt->table); m_prebuilt->table = dict_table_open_on_name( tb_name, TRUE, TRUE, DICT_ERR_IGNORE_NONE); Here is a simpler test case that does not involve virtual columns, but merely restarting the server: --source include/have_innodb.inc CREATE TABLE t1 (i INT ) ENGINE=InnoDB; INSERT INTO t1 SET i=1; ALTER TABLE t1 ADD COLUMN b BIT FIRST , ALGORITHM=INSTANT; --source include/restart_mysqld.inc SELECT * FROM t1; DROP TABLE t1;
            alice Alice Sherepa added a comment - - edited

            10.4 16d43150aefc5a9a7e75f4c

            /git/10.4/storage/innobase/handler/handler0alter.cc:350: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `fields[i].col->is_nullable() == instant.fields[i].col->is_nullable()' failed.
            181116 21:07:51 [ERROR] mysqld got signal 6 ;
             
            linux/raise.c:54(__GI_raise)[0x7fb8f77b7428]
            stdlib/abort.c:91(__GI_abort)[0x7fb8f77b902a]
            assert/assert.c:92(__assert_fail_base)[0x7fb8f77afbd7]
            /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fb8f77afc82]
            handler/handler0alter.cc:347(dict_index_t::instant_add_field(dict_index_t const&))[0x561fcfa90051]
            handler/handler0alter.cc:491(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x561fcfa924fe]
            handler/handler0alter.cc:5251(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x561fcfa5fcc0]
            handler/handler0alter.cc:9890(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x561fcfa9cf4f]
            handler/handler0alter.cc:10519(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x561fcfa814a3]
            sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x561fcf1dbba4]
            sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x561fcecf07c1]
            sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x561fcecfcfa8]
            sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x561fcee3b9a6]
            sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x561fceaf5722]
            sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x561fceafff31]
            sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x561fceadae2e]
            sql/sql_parse.cc:1396(do_command(THD*))[0x561fcead7fc6]
            sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x561fcee2ce37]
            sql/sql_connect.cc:1309(handle_one_connection)[0x561fcee2c814]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb8f83f46ba]
            x86_64/clone.S:111(clone)[0x7fb8f788941d]
             
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x62b00018f288): ALTER TABLE t14 ADD COLUMN IF NOT EXISTS icol9 SMALLINT DEFAULT 0 
            

            perl ./runall-new.pl --no-mask --seed=1542398722 --threads=6 --duration=300 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --vcols --views=TEMPTABLE --grammar=conf/mariadb/instant_add.yy --gendata=conf/mariadb/1my.zz --engine=Aria --basedir1=/git/10.4 --vardir1=/1
            

            10.4 16d43150aefc5a9a7e75f4c

            /git/10.4/storage/innobase/handler/handler0alter.cc:348: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `fields[i].same(instant.fields[i])' failed.
            181116 22:35:25 [ERROR] mysqld got signal 6 ;
             
            linux/raise.c:54(__GI_raise)[0x7f12e985502a]
            stdlib/abort.c:91(__GI_abort)[0x7f12e984bbd7]
            assert/assert.c:92(__assert_fail_base)[0x7f12e984bc82]
            /home/alice/git/10.4/sql/mysqld(+0x1fdde67)[0x5596fe061e67]
            handler/handler0alter.cc:349(dict_index_t::instant_add_field(dict_index_t const&))[0x5596fe0644fe]
            handler/handler0alter.cc:491(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x5596fe031cc0]
            handler/handler0alter.cc:5251(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x5596fe06ef4f]
            handler/handler0alter.cc:9890(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x5596fe0534a3]
            handler/handler0alter.cc:10519(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5596fd7adba4]
            sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5596fd2c27c1]
            sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x5596fd2cefa8]
            sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x5596fd40d9a6]
            sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x5596fd0c7722]
            sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x5596fd0d1f31]
            sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5596fd0ace2e]
            sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5596fd0a9fc6]
            sql/sql_parse.cc:1396(do_command(THD*))[0x5596fd3fee37]
            sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x5596fd3fe814]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f12ea4906ba]
            /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f12e992541d]
             
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x62b0002a0288): ALTER TABLE t16 ADD COLUMN IF NOT EXISTS tscol9 TIMESTAMP NOT NULL, LOCK=SHARED /* QNO 2117 CON_ID 28 */
            

            perl ./runall-new.pl --no-mask --seed=1542404045 --duration=500 --queries=10M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --redefine=conf/mariadb/versioning.yy --vcols --views=TEMPTABLE --grammar=conf/mariadb/instant_add.yy --gendata=conf/optimizer/blobs.zz --engine=MyISAM --mysqld=--default-storage-engine=MyISAM --threads=16 --mysqld=--query_cache_size=1M --mysqld=--query_cache_type=1 --mtr-build-thread=308 --basedir1=/home/alice/git/10.4 --vardir1=/1
            

            alice Alice Sherepa added a comment - - edited 10.4 16d43150aefc5a9a7e75f4c /git/10.4/storage/innobase/handler/handler0alter.cc:350: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `fields[i].col->is_nullable() == instant.fields[i].col->is_nullable()' failed. 181116 21:07:51 [ERROR] mysqld got signal 6 ;   linux/raise.c:54(__GI_raise)[0x7fb8f77b7428] stdlib/abort.c:91(__GI_abort)[0x7fb8f77b902a] assert/assert.c:92(__assert_fail_base)[0x7fb8f77afbd7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fb8f77afc82] handler/handler0alter.cc:347(dict_index_t::instant_add_field(dict_index_t const&))[0x561fcfa90051] handler/handler0alter.cc:491(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x561fcfa924fe] handler/handler0alter.cc:5251(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x561fcfa5fcc0] handler/handler0alter.cc:9890(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x561fcfa9cf4f] handler/handler0alter.cc:10519(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x561fcfa814a3] sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x561fcf1dbba4] sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x561fcecf07c1] sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x561fcecfcfa8] sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x561fcee3b9a6] sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x561fceaf5722] sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x561fceafff31] sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x561fceadae2e] sql/sql_parse.cc:1396(do_command(THD*))[0x561fcead7fc6] sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x561fcee2ce37] sql/sql_connect.cc:1309(handle_one_connection)[0x561fcee2c814] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb8f83f46ba] x86_64/clone.S:111(clone)[0x7fb8f788941d]   Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x62b00018f288): ALTER TABLE t14 ADD COLUMN IF NOT EXISTS icol9 SMALLINT DEFAULT 0 perl ./runall-new.pl --no-mask --seed=1542398722 --threads=6 --duration=300 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --vcols --views=TEMPTABLE --grammar=conf/mariadb/instant_add.yy --gendata=conf/mariadb/1my.zz --engine=Aria --basedir1=/git/10.4 --vardir1=/1 10.4 16d43150aefc5a9a7e75f4c /git/10.4/storage/innobase/handler/handler0alter.cc:348: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `fields[i].same(instant.fields[i])' failed. 181116 22:35:25 [ERROR] mysqld got signal 6 ;   linux/raise.c:54(__GI_raise)[0x7f12e985502a] stdlib/abort.c:91(__GI_abort)[0x7f12e984bbd7] assert/assert.c:92(__assert_fail_base)[0x7f12e984bc82] /home/alice/git/10.4/sql/mysqld(+0x1fdde67)[0x5596fe061e67] handler/handler0alter.cc:349(dict_index_t::instant_add_field(dict_index_t const&))[0x5596fe0644fe] handler/handler0alter.cc:491(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x5596fe031cc0] handler/handler0alter.cc:5251(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x5596fe06ef4f] handler/handler0alter.cc:9890(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x5596fe0534a3] handler/handler0alter.cc:10519(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5596fd7adba4] sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5596fd2c27c1] sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x5596fd2cefa8] sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x5596fd40d9a6] sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x5596fd0c7722] sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x5596fd0d1f31] sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5596fd0ace2e] sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5596fd0a9fc6] sql/sql_parse.cc:1396(do_command(THD*))[0x5596fd3fee37] sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x5596fd3fe814] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f12ea4906ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f12e992541d]   Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x62b0002a0288): ALTER TABLE t16 ADD COLUMN IF NOT EXISTS tscol9 TIMESTAMP NOT NULL, LOCK=SHARED /* QNO 2117 CON_ID 28 */ perl ./runall-new.pl --no-mask --seed=1542404045 --duration=500 --queries=10M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --redefine=conf/mariadb/versioning.yy --vcols --views=TEMPTABLE --grammar=conf/mariadb/instant_add.yy --gendata=conf/optimizer/blobs.zz --engine=MyISAM --mysqld=--default-storage-engine=MyISAM --threads=16 --mysqld=--query_cache_size=1M --mysqld=--query_cache_type=1 --mtr-build-thread=308 --basedir1=/home/alice/git/10.4 --vardir1=/1
            elenst Elena Stepanova added a comment - - edited

            Derived from alice's tests above:

            --source include/have_innodb.inc
             
            CREATE TABLE t1 (ts TIMESTAMP) ENGINE=InnoDB;
            ALTER TABLE t1 ADD COLUMN f VARCHAR(8), ADD COLUMN dt DATETIME;
            ALTER TABLE t1 ADD COLUMN b BIT, DROP COLUMN f, ADD COLUMN t TIME FIRST;
            ALTER TABLE t1 ADD COLUMN ts2 TIMESTAMP;
             
            # Cleanup
            DROP TABLE t1;
            

            10.4 d2ba9edd664

            mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:348: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `fields[i].same(instant.fields[i])' failed.
            181119 11:32:01 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f86a5266ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x0000562b7aa4561e in dict_index_t::instant_add_field (this=0x7f864c12dbf8, instant=...) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:348
            #9  0x0000562b7aa468f4 in dict_table_t::instant_column (this=0x7f864c00f0a8, table=..., col_map=0x7f864c0585e8) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:489
            #10 0x0000562b7aa2fe00 in innobase_instant_try (ha_alter_info=0x7f869a561bb0, ctx=0x7f864c016918, altered_table=0x7f864c053b10, table=0x7f864c1310c0, trx=0x7f86a004a218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5249
            #11 0x0000562b7aa4b017 in commit_try_norebuild (ha_alter_info=0x7f869a561bb0, ctx=0x7f864c016918, altered_table=0x7f864c053b10, old_table=0x7f864c1310c0, trx=0x7f86a004a218, table_name=0x7f864c056d7d "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:9890
            #12 0x0000562b7aa3eb5e in ha_innobase::commit_inplace_alter_table (this=0x7f864c132158, altered_table=0x7f864c053b10, ha_alter_info=0x7f869a561bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10519
            #13 0x0000562b7a6d9e32 in handler::ha_commit_inplace_alter_table (this=0x7f864c132158, altered_table=0x7f864c053b10, ha_alter_info=0x7f869a561bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457
            #14 0x0000562b7a4ab142 in mysql_inplace_alter_table (thd=0x7f864c000b00, table_list=0x7f864c014e90, table=0x7f864c1310c0, altered_table=0x7f864c053b10, ha_alter_info=0x7f869a561bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f869a561ce0, alter_ctx=0x7f869a5628d0) at /data/src/10.4/sql/sql_table.cc:7601
            #15 0x0000562b7a4b0f5d in mysql_alter_table (thd=0x7f864c000b00, new_db=0x7f864c0051b8, new_name=0x7f864c005588, create_info=0x7f869a5634c0, table_list=0x7f864c014e90, alter_info=0x7f869a563400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9694
            #16 0x0000562b7a53a0e5 in Sql_cmd_alter_table::execute (this=0x7f864c0155e8, thd=0x7f864c000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #17 0x0000562b7a3d957a in mysql_execute_command (thd=0x7f864c000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #18 0x0000562b7a3de49e in mysql_parse (thd=0x7f864c000b00, rawbuf=0x7f864c014d98 "ALTER TABLE t1 ADD COLUMN ts2 TIMESTAMP", length=39, parser_state=0x7f869a564600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #19 0x0000562b7a3cb79d in dispatch_command (command=COM_QUERY, thd=0x7f864c000b00, packet=0x7f864c093c31 "ALTER TABLE t1 ADD COLUMN ts2 TIMESTAMP", packet_length=39, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #20 0x0000562b7a3ca1c1 in do_command (thd=0x7f864c000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #21 0x0000562b7a534364 in do_handle_one_connection (connect=0x562b7ca6bcb0) at /data/src/10.4/sql/sql_connect.cc:1402
            #22 0x0000562b7a5340e8 in handle_one_connection (arg=0x562b7ca6bcb0) at /data/src/10.4/sql/sql_connect.cc:1308
            #23 0x0000562b7a9da2a9 in pfs_spawn_thread (arg=0x562b7caf0f80) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #24 0x00007f86a6d22494 in start_thread (arg=0x7f869a565700) at pthread_create.c:333
            #25 0x00007f86a532393f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            Not reproducible on 10.3.

            elenst Elena Stepanova added a comment - - edited Derived from alice 's tests above: --source include/have_innodb.inc   CREATE TABLE t1 (ts TIMESTAMP ) ENGINE=InnoDB; ALTER TABLE t1 ADD COLUMN f VARCHAR (8), ADD COLUMN dt DATETIME; ALTER TABLE t1 ADD COLUMN b BIT , DROP COLUMN f, ADD COLUMN t TIME FIRST ; ALTER TABLE t1 ADD COLUMN ts2 TIMESTAMP ;   # Cleanup DROP TABLE t1; 10.4 d2ba9edd664 mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:348: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `fields[i].same(instant.fields[i])' failed. 181119 11:32:01 [ERROR] mysqld got signal 6 ;   #7 0x00007f86a5266ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000562b7aa4561e in dict_index_t::instant_add_field (this=0x7f864c12dbf8, instant=...) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:348 #9 0x0000562b7aa468f4 in dict_table_t::instant_column (this=0x7f864c00f0a8, table=..., col_map=0x7f864c0585e8) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:489 #10 0x0000562b7aa2fe00 in innobase_instant_try (ha_alter_info=0x7f869a561bb0, ctx=0x7f864c016918, altered_table=0x7f864c053b10, table=0x7f864c1310c0, trx=0x7f86a004a218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5249 #11 0x0000562b7aa4b017 in commit_try_norebuild (ha_alter_info=0x7f869a561bb0, ctx=0x7f864c016918, altered_table=0x7f864c053b10, old_table=0x7f864c1310c0, trx=0x7f86a004a218, table_name=0x7f864c056d7d "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:9890 #12 0x0000562b7aa3eb5e in ha_innobase::commit_inplace_alter_table (this=0x7f864c132158, altered_table=0x7f864c053b10, ha_alter_info=0x7f869a561bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10519 #13 0x0000562b7a6d9e32 in handler::ha_commit_inplace_alter_table (this=0x7f864c132158, altered_table=0x7f864c053b10, ha_alter_info=0x7f869a561bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457 #14 0x0000562b7a4ab142 in mysql_inplace_alter_table (thd=0x7f864c000b00, table_list=0x7f864c014e90, table=0x7f864c1310c0, altered_table=0x7f864c053b10, ha_alter_info=0x7f869a561bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f869a561ce0, alter_ctx=0x7f869a5628d0) at /data/src/10.4/sql/sql_table.cc:7601 #15 0x0000562b7a4b0f5d in mysql_alter_table (thd=0x7f864c000b00, new_db=0x7f864c0051b8, new_name=0x7f864c005588, create_info=0x7f869a5634c0, table_list=0x7f864c014e90, alter_info=0x7f869a563400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9694 #16 0x0000562b7a53a0e5 in Sql_cmd_alter_table::execute (this=0x7f864c0155e8, thd=0x7f864c000b00) at /data/src/10.4/sql/sql_alter.cc:497 #17 0x0000562b7a3d957a in mysql_execute_command (thd=0x7f864c000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #18 0x0000562b7a3de49e in mysql_parse (thd=0x7f864c000b00, rawbuf=0x7f864c014d98 "ALTER TABLE t1 ADD COLUMN ts2 TIMESTAMP", length=39, parser_state=0x7f869a564600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #19 0x0000562b7a3cb79d in dispatch_command (command=COM_QUERY, thd=0x7f864c000b00, packet=0x7f864c093c31 "ALTER TABLE t1 ADD COLUMN ts2 TIMESTAMP", packet_length=39, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #20 0x0000562b7a3ca1c1 in do_command (thd=0x7f864c000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #21 0x0000562b7a534364 in do_handle_one_connection (connect=0x562b7ca6bcb0) at /data/src/10.4/sql/sql_connect.cc:1402 #22 0x0000562b7a5340e8 in handle_one_connection (arg=0x562b7ca6bcb0) at /data/src/10.4/sql/sql_connect.cc:1308 #23 0x0000562b7a9da2a9 in pfs_spawn_thread (arg=0x562b7caf0f80) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #24 0x00007f86a6d22494 in start_thread (arg=0x7f869a565700) at pthread_create.c:333 #25 0x00007f86a532393f in clone () from /lib/x86_64-linux-gnu/libc.so.6 Not reproducible on 10.3.

            When the assertion fails, we have the following fields[] and instant.fields[]:
            DB_ROW_ID,DB_TRX_ID,DB_ROLL_PTR,t,dt,ts,b
            DB_ROW_ID,DB_TRX_ID,DB_ROLL_PTR,t,ts,dt,b

            So, the assertion is catching the unexpected swap of the index fields for the columns dt and ts.
            It is already wrong that a placeholder for the dropped column f was discarded. It was there after ts when dict_table_t::instant_column() returned for the statement

            ALTER TABLE t1 ADD COLUMN b BIT, DROP COLUMN f, ADD COLUMN t TIME FIRST;
            

            but it is no longer present when dict_table_t::prepare_instant() is invoked for the crashing statement:

            ALTER TABLE t1 ADD COLUMN ts2 TIMESTAMP;
            

            marko Marko Mäkelä added a comment - When the assertion fails, we have the following fields[] and instant.fields[] : DB_ROW_ID,DB_TRX_ID,DB_ROLL_PTR,t,dt,ts,b DB_ROW_ID,DB_TRX_ID,DB_ROLL_PTR,t,ts,dt,b So, the assertion is catching the unexpected swap of the index fields for the columns dt and ts . It is already wrong that a placeholder for the dropped column f was discarded. It was there after ts when dict_table_t::instant_column() returned for the statement ALTER TABLE t1 ADD COLUMN b BIT , DROP COLUMN f, ADD COLUMN t TIME FIRST ; but it is no longer present when dict_table_t::prepare_instant() is invoked for the crashing statement: ALTER TABLE t1 ADD COLUMN ts2 TIMESTAMP ;

            The problem is due to a bug in dict_index_t::clear_instant_alter(). Already in MDEV-11369 in 10.3, we would convert the table into the ‘canonical format’ when it becomes empty. That was no problem back then, because columns could only be added last in the table.

            With MDEV-15562 in 10.4.0, we can instantly add and drop columns. We cannot normally convert tables to ‘canonical format’ if any columns were dropped or permuted, because other connections could hold query processing templates that would have to be adjusted simultaneously. We can only convert to ‘canonical format’ during ALTER TABLE, which is protected by an exclusive lock. And exactly this is failing. After the call to dict_index_t::clear_instant_alter() we have the following fields[]:
            DB_ROW_ID,DB_TRX_ID,DB_ROLL_PTR,t,dt,ts,b
            But, the table columns are t,ts,dt,b! The columns dt,ts are wrongly swapped here.

            The fix should be to pass col_map to the dict_index_t::clear_instant_alter() call, and permute the columns back.

            marko Marko Mäkelä added a comment - The problem is due to a bug in dict_index_t::clear_instant_alter() . Already in MDEV-11369 in 10.3, we would convert the table into the ‘canonical format’ when it becomes empty. That was no problem back then, because columns could only be added last in the table. With MDEV-15562 in 10.4.0, we can instantly add and drop columns. We cannot normally convert tables to ‘canonical format’ if any columns were dropped or permuted, because other connections could hold query processing templates that would have to be adjusted simultaneously. We can only convert to ‘canonical format’ during ALTER TABLE , which is protected by an exclusive lock. And exactly this is failing. After the call to dict_index_t::clear_instant_alter() we have the following fields[] : DB_ROW_ID,DB_TRX_ID,DB_ROLL_PTR,t,dt,ts,b But, the table columns are t,ts,dt,b! The columns dt,ts are wrongly swapped here. The fix should be to pass col_map to the dict_index_t::clear_instant_alter() call, and permute the columns back.

            Actually, dict_index_t::clear_instant_alter() was attempting to sort the fields by invoking std::swap() inside a loop, but its sorting algorithm was incorrect. Invoking std::sort() outside the loop fixes the issue.

            marko Marko Mäkelä added a comment - Actually, dict_index_t::clear_instant_alter() was attempting to sort the fields by invoking std::swap() inside a loop, but its sorting algorithm was incorrect. Invoking std::sort() outside the loop fixes the issue.
            alice Alice Sherepa added a comment - - edited

            10.4 5aaee3746e85788475edfc07

            /git/10.4/storage/innobase/include/dict0mem.h:2167: void dict_index_t::clear_instant_alter(): Assertion `&fields[n_fields - table->n_dropped()] == end' failed.
             
            assert/assert.c:92(__assert_fail_base)[0x7f7c8475dbd7]
            /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f7c8475dc82]
            include/dict0mem.h:2168(dict_index_t::clear_instant_alter())[0x5628e2b64b53]
            handler/handler0alter.cc:5500(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x5628e2b53774]
            handler/handler0alter.cc:9888(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x5628e2b6d3c5]
            handler/handler0alter.cc:10517(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5628e2b60e02]
            sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5628e27b68d0]
            sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x5628e2572e54]
            sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x5628e2578cbd]
            sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x5628e2606138]
            sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x5628e249f4e1]
            sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5628e24a46d2]
            sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5628e2491555]
            sql/sql_parse.cc:1396(do_command(THD*))[0x5628e248ff72]
            sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x5628e25ffb1a]
            sql/sql_connect.cc:1309(handle_one_connection)[0x5628e25ff86b]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f7c853a26ba]
            x86_64/clone.S:111(clone)[0x7f7c8483741d]
             
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f7c0c0728f0): ALTER TABLE t1 DROP COLUMN col1  /* QNO 2125 CON_ID 17 */
            

            perl ./runall-new.pl --no-mask --seed=1542727721 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --vcols --threads=6 --grammar=conf/runtime/alter_online.yy --gendata=conf/mariadb/oltp.zz --engine=MyIsam --basedir1=/git/10.4 --vardir1=/1
            

            alice Alice Sherepa added a comment - - edited 10.4 5aaee3746e85788475edfc07 /git/10.4/storage/innobase/include/dict0mem.h:2167: void dict_index_t::clear_instant_alter(): Assertion `&fields[n_fields - table->n_dropped()] == end' failed.   assert/assert.c:92(__assert_fail_base)[0x7f7c8475dbd7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f7c8475dc82] include/dict0mem.h:2168(dict_index_t::clear_instant_alter())[0x5628e2b64b53] handler/handler0alter.cc:5500(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x5628e2b53774] handler/handler0alter.cc:9888(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x5628e2b6d3c5] handler/handler0alter.cc:10517(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5628e2b60e02] sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x5628e27b68d0] sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x5628e2572e54] sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x5628e2578cbd] sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x5628e2606138] sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x5628e249f4e1] sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5628e24a46d2] sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5628e2491555] sql/sql_parse.cc:1396(do_command(THD*))[0x5628e248ff72] sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x5628e25ffb1a] sql/sql_connect.cc:1309(handle_one_connection)[0x5628e25ff86b] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f7c853a26ba] x86_64/clone.S:111(clone)[0x7f7c8483741d]   Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x7f7c0c0728f0): ALTER TABLE t1 DROP COLUMN col1 /* QNO 2125 CON_ID 17 */ perl ./runall-new.pl --no-mask --seed=1542727721 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --vcols --threads=6 --grammar=conf/runtime/alter_online.yy --gendata=conf/mariadb/oltp.zz --engine=MyIsam --basedir1=/git/10.4 --vardir1=/1
            alice Alice Sherepa added a comment -

            10.4 5aaee3746e85788475edfc07

            mysqld: git/10.4/storage/innobase/handler/handler0alter.cc:309: void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `n_nullable >= oindex.n_nullable' failed.
            181120 16:18:47 [ERROR] mysqld got signal 6 ;
             
            sql/signal_handler.cc:168(handle_fatal_signal)[0x5637bfcc10a0]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fa31cbec390]
            linux/raise.c:54(__GI_raise)[0x7fa31bfa5428]
            stdlib/abort.c:91(__GI_abort)[0x7fa31bfa702a]
            assert/assert.c:92(__assert_fail_base)[0x7fa31bf9dbd7]
            /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fa31bf9dc82]
            handler/handler0alter.cc:310(dict_table_t::prepare_instant(dict_table_t const&, unsigned long const*, unsigned int&))[0x5637c007e194]
            handler/handler0alter.cc:925(ha_innobase_inplace_ctx::prepare_instant())[0x5637c0081c2f]
            handler/handler0alter.cc:6263(prepare_inplace_alter_table_dict(Alter_inplace_info*, TABLE const*, TABLE const*, char const*, unsigned long, unsigned long, unsigned long, bool, bool))[0x5637c006d73b]
            handler/handler0alter.cc:7807(ha_innobase::prepare_inplace_alter_table(TABLE*, Alter_inplace_info*))[0x5637c0072666]
            sql/handler.cc:4438(handler::ha_prepare_inplace_alter_table(TABLE*, Alter_inplace_info*))[0x5637bfccd79f]
            sql/sql_table.cc:7518(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x5637bfa89a5a]
            sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x5637bfa8fcbd]
            sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x5637bfb1d138]
            sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x5637bf9b64e1]
            sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5637bf9bb6d2]
            sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5637bf9a8555]
            sql/sql_parse.cc:1396(do_command(THD*))[0x5637bf9a6f72]
            sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x5637bfb16b1a]
            sql/sql_connect.cc:1309(handle_one_connection)[0x5637bfb1686b]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fa31cbe26ba]
            x86_64/clone.S:111(clone)[0x7fa31c07741d]
             
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7fa2a04b8ca0): ALTER TABLE t1 DROP COLUMN col3  
            

            perl ./runall-new.pl --no-mask --seed=1542726819 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --querytimeout=30 --vcols --threads=6 --grammar=conf/runtime/alter_online.yy --gendata=conf/drizzle/drizzle.zz --engine=Aria --mtr-build-thread=300 --basedir1=git/10.4 --vardir1=/1
            

            alice Alice Sherepa added a comment - 10.4 5aaee3746e85788475edfc07 mysqld: git/10.4/storage/innobase/handler/handler0alter.cc:309: void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `n_nullable >= oindex.n_nullable' failed. 181120 16:18:47 [ERROR] mysqld got signal 6 ;   sql/signal_handler.cc:168(handle_fatal_signal)[0x5637bfcc10a0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fa31cbec390] linux/raise.c:54(__GI_raise)[0x7fa31bfa5428] stdlib/abort.c:91(__GI_abort)[0x7fa31bfa702a] assert/assert.c:92(__assert_fail_base)[0x7fa31bf9dbd7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fa31bf9dc82] handler/handler0alter.cc:310(dict_table_t::prepare_instant(dict_table_t const&, unsigned long const*, unsigned int&))[0x5637c007e194] handler/handler0alter.cc:925(ha_innobase_inplace_ctx::prepare_instant())[0x5637c0081c2f] handler/handler0alter.cc:6263(prepare_inplace_alter_table_dict(Alter_inplace_info*, TABLE const*, TABLE const*, char const*, unsigned long, unsigned long, unsigned long, bool, bool))[0x5637c006d73b] handler/handler0alter.cc:7807(ha_innobase::prepare_inplace_alter_table(TABLE*, Alter_inplace_info*))[0x5637c0072666] sql/handler.cc:4438(handler::ha_prepare_inplace_alter_table(TABLE*, Alter_inplace_info*))[0x5637bfccd79f] sql/sql_table.cc:7518(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x5637bfa89a5a] sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x5637bfa8fcbd] sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x5637bfb1d138] sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x5637bf9b64e1] sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5637bf9bb6d2] sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5637bf9a8555] sql/sql_parse.cc:1396(do_command(THD*))[0x5637bf9a6f72] sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x5637bfb16b1a] sql/sql_connect.cc:1309(handle_one_connection)[0x5637bfb1686b] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fa31cbe26ba] x86_64/clone.S:111(clone)[0x7fa31c07741d]   Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x7fa2a04b8ca0): ALTER TABLE t1 DROP COLUMN col3 perl ./runall-new.pl --no-mask --seed=1542726819 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --querytimeout=30 --vcols --threads=6 --grammar=conf/runtime/alter_online.yy --gendata=conf/drizzle/drizzle.zz --engine=Aria --mtr-build-thread=300 --basedir1=git/10.4 --vardir1=/1
            elenst Elena Stepanova added a comment - - edited

            And another one:

            10.4 f0f0d072507

            mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:290: 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.
            181120 19:02:04 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f2529836ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000055fd99168ad7 in dict_table_t::prepare_instant (this=0x7f24b05c0138, old=..., col_map=0x7f24b05b6a40, first_alter_pos=@0x7f24b002b6b0: 2) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:290
            #9  0x000055fd9916ca1f in ha_innobase_inplace_ctx::prepare_instant (this=0x7f24b002b540) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:924
            #10 0x000055fd99158672 in prepare_inplace_alter_table_dict (ha_alter_info=0x7f25140eac00, altered_table=0x7f24b05d94a0, old_table=0x7f24a80d7fb0, table_name=0x7f24a80de46d "t1", flags=33, flags2=80, fts_doc_id_col=18446744073709551615, add_fts_doc_id=false, add_fts_doc_id_idx=false) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:6260
            #11 0x000055fd9915d570 in ha_innobase::prepare_inplace_alter_table (this=0x7f24a80d8be8, altered_table=0x7f24b05d94a0, ha_alter_info=0x7f25140eac00) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:7807
            #12 0x000055fd98dfdc4b in handler::ha_prepare_inplace_alter_table (this=0x7f24a80d8be8, altered_table=0x7f24b05d94a0, ha_alter_info=0x7f25140eac00) at /data/src/10.4/sql/handler.cc:4437
            #13 0x000055fd98bc7cc0 in mysql_inplace_alter_table (thd=0x7f24b0000b00, table_list=0x7f24b002a158, table=0x7f24a80d7fb0, altered_table=0x7f24b05d94a0, ha_alter_info=0x7f25140eac00, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f25140ead30, alter_ctx=0x7f25140eb920) at /data/src/10.4/sql/sql_table.cc:7516
            #14 0x000055fd98bcdedd in mysql_alter_table (thd=0x7f24b0000b00, new_db=0x7f24b00051b8, new_name=0x7f24b0005588, create_info=0x7f25140ec510, table_list=0x7f24b002a158, alter_info=0x7f25140ec450, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692
            #15 0x000055fd98c57067 in Sql_cmd_alter_table::execute (this=0x7f24b002a7c0, thd=0x7f24b0000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #16 0x000055fd98af61f8 in mysql_execute_command (thd=0x7f24b0000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #17 0x000055fd98afb11c in mysql_parse (thd=0x7f24b0000b00, rawbuf=0x7f24b002a038 "ALTER TABLE t1 DROP COLUMN col2  /* QNO 1489 CON_ID 15 */", length=57, parser_state=0x7f25140ed650, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #18 0x000055fd98ae841b in dispatch_command (command=COM_QUERY, thd=0x7f24b0000b00, packet=0x7f24b00681f1 "ALTER TABLE t1 DROP COLUMN col2  /* QNO 1489 CON_ID 15 */", packet_length=57, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #19 0x000055fd98ae6e3f in do_command (thd=0x7f24b0000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #20 0x000055fd98c512e6 in do_handle_one_connection (connect=0x55fd9bcdcc00) at /data/src/10.4/sql/sql_connect.cc:1402
            #21 0x000055fd98c5106a in handle_one_connection (arg=0x55fd9bcdcc00) at /data/src/10.4/sql/sql_connect.cc:1308
            #22 0x00007f252b2f2494 in start_thread (arg=0x7f25140ee700) at pthread_create.c:333
            #23 0x00007f25298f393f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            Happened on an unsimplified MTR test case while trying to reproduce the 2nd failure from above comment.

            elenst Elena Stepanova added a comment - - edited And another one: 10.4 f0f0d072507 mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:290: 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. 181120 19:02:04 [ERROR] mysqld got signal 6 ;   #7 0x00007f2529836ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000055fd99168ad7 in dict_table_t::prepare_instant (this=0x7f24b05c0138, old=..., col_map=0x7f24b05b6a40, first_alter_pos=@0x7f24b002b6b0: 2) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:290 #9 0x000055fd9916ca1f in ha_innobase_inplace_ctx::prepare_instant (this=0x7f24b002b540) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:924 #10 0x000055fd99158672 in prepare_inplace_alter_table_dict (ha_alter_info=0x7f25140eac00, altered_table=0x7f24b05d94a0, old_table=0x7f24a80d7fb0, table_name=0x7f24a80de46d "t1", flags=33, flags2=80, fts_doc_id_col=18446744073709551615, add_fts_doc_id=false, add_fts_doc_id_idx=false) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:6260 #11 0x000055fd9915d570 in ha_innobase::prepare_inplace_alter_table (this=0x7f24a80d8be8, altered_table=0x7f24b05d94a0, ha_alter_info=0x7f25140eac00) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:7807 #12 0x000055fd98dfdc4b in handler::ha_prepare_inplace_alter_table (this=0x7f24a80d8be8, altered_table=0x7f24b05d94a0, ha_alter_info=0x7f25140eac00) at /data/src/10.4/sql/handler.cc:4437 #13 0x000055fd98bc7cc0 in mysql_inplace_alter_table (thd=0x7f24b0000b00, table_list=0x7f24b002a158, table=0x7f24a80d7fb0, altered_table=0x7f24b05d94a0, ha_alter_info=0x7f25140eac00, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f25140ead30, alter_ctx=0x7f25140eb920) at /data/src/10.4/sql/sql_table.cc:7516 #14 0x000055fd98bcdedd in mysql_alter_table (thd=0x7f24b0000b00, new_db=0x7f24b00051b8, new_name=0x7f24b0005588, create_info=0x7f25140ec510, table_list=0x7f24b002a158, alter_info=0x7f25140ec450, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692 #15 0x000055fd98c57067 in Sql_cmd_alter_table::execute (this=0x7f24b002a7c0, thd=0x7f24b0000b00) at /data/src/10.4/sql/sql_alter.cc:497 #16 0x000055fd98af61f8 in mysql_execute_command (thd=0x7f24b0000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #17 0x000055fd98afb11c in mysql_parse (thd=0x7f24b0000b00, rawbuf=0x7f24b002a038 "ALTER TABLE t1 DROP COLUMN col2 /* QNO 1489 CON_ID 15 */", length=57, parser_state=0x7f25140ed650, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #18 0x000055fd98ae841b in dispatch_command (command=COM_QUERY, thd=0x7f24b0000b00, packet=0x7f24b00681f1 "ALTER TABLE t1 DROP COLUMN col2 /* QNO 1489 CON_ID 15 */", packet_length=57, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #19 0x000055fd98ae6e3f in do_command (thd=0x7f24b0000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #20 0x000055fd98c512e6 in do_handle_one_connection (connect=0x55fd9bcdcc00) at /data/src/10.4/sql/sql_connect.cc:1402 #21 0x000055fd98c5106a in handle_one_connection (arg=0x55fd9bcdcc00) at /data/src/10.4/sql/sql_connect.cc:1308 #22 0x00007f252b2f2494 in start_thread (arg=0x7f25140ee700) at pthread_create.c:333 #23 0x00007f25298f393f in clone () from /lib/x86_64-linux-gnu/libc.so.6 Happened on an unsimplified MTR test case while trying to reproduce the 2nd failure from above comment.
            alice Alice Sherepa added a comment -

             /git/10.4/storage/innobase/handler/handler0alter.cc:337: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_nullable >= n_nullable' failed.
            181121  5:25:30 [ERROR] mysqld got signal 6 ;
             
            sql/signal_handler.cc:168(handle_fatal_signal)[0x56403a7850a0]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fb23094a390]
            linux/raise.c:54(__GI_raise)[0x7fb22fd03428]
            stdlib/abort.c:91(__GI_abort)[0x7fb22fd0502a]
            assert/assert.c:92(__assert_fail_base)[0x7fb22fcfbbd7]
            /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fb22fcfbc82]
            handler/handler0alter.cc:338(dict_index_t::instant_add_field(dict_index_t const&))[0x56403ab42857]
            handler/handler0alter.cc:489(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x56403ab43ca6]
            handler/handler0alter.cc:5249(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x56403ab2d008]
            handler/handler0alter.cc:9888(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x56403ab483c5]
            handler/handler0alter.cc:10517(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x56403ab3be02]
            sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x56403a7918d0]
            sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x56403a54de54]
            sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x56403a553cbd]
            sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x56403a5e1138]
            sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x56403a47a4e1]
            sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x56403a47f6d2]
            sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x56403a46c555]
            sql/sql_parse.cc:1396(do_command(THD*))[0x56403a46af72]
            sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x56403a5dab1a]
            sql/sql_connect.cc:1309(handle_one_connection)[0x56403a5da86b]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb2309406ba]
            x86_64/clone.S:111(clone)[0x7fb22fdd541d]
             
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7fb1bc03e610): ALTER TABLE t10 ADD COLUMN tscol2 TIMESTAMP NOT NULL  /* QNO 2019 CON_ID 15 */
            

            perl ./runall-new.pl --no-mask --seed=1542774315 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --vcols --views=TEMPTABLE --notnull --threads=1 --grammar=conf/mariadb/instant_add.yy --gendata=conf/mariadb/1mytest.zz --engine=MyIsam --mtr-build-thread=308 --basedir1=/git/10.4 --vardir1=/1
            

            /git/10.4/storage/innobase/handler/handler0alter.cc:338: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_core_fields == n_core_fields' failed.
            181121  1:12:30 [ERROR] mysqld got signal 6 ;
             
            linux/raise.c:54(__GI_raise)[0x7f8bb0603428]
            stdlib/abort.c:91(__GI_abort)[0x7f8bb060502a]
            assert/assert.c:92(__assert_fail_base)[0x7f8bb05fbbd7]
            /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f8bb05fbc82]
            handler/handler0alter.cc:339(dict_index_t::instant_add_field(dict_index_t const&))[0x562dff8ae8cb]
            handler/handler0alter.cc:489(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x562dff8afca6]
            handler/handler0alter.cc:5249(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x562dff899008]
            handler/handler0alter.cc:9888(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x562dff8b43c5]
            handler/handler0alter.cc:10517(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x562dff8a7e02]
            sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x562dff4fd8d0]
            sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x562dff2b9e54]
            sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x562dff2bfcbd]
            sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x562dff34d138]
            sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x562dff1e64e1]
            sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x562dff1eb6d2]
            sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x562dff1d8555]
            sql/sql_parse.cc:1396(do_command(THD*))[0x562dff1d6f72]
            sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x562dff346b1a]
            sql/sql_connect.cc:1309(handle_one_connection)[0x562dff34686b]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f8bb12406ba]
            x86_64/clone.S:111(clone)[0x7f8bb06d541d]
             
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f8b142d8e80): ALTER TABLE t18 ADD COLUMN IF NOT EXISTS tcol9 YEAR, LOCK=NONE, ADD COLUMN IF NOT EXISTS ( icol4 MEDIUMINT NOT NULL, scol5 TEXT NOT NULL DEFAULT '', ncol9 FLOAT UNSIGNED ZEROFILL ), LOCK=NONE /* QNO 1130 CON_ID 27 */
            

            perl ./runall-new.pl --no-mask --seed=1542758821 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --vcols --notnull --threads=25 --grammar=conf/mariadb/instant_add.yy --gendata=conf/drizzle/drizzle.zz --engine=Aria --mtr-build-thread=308 --basedir1=/git/10.4 --vardir1=/
            

            alice Alice Sherepa added a comment - /git/10.4/storage/innobase/handler/handler0alter.cc:337: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_nullable >= n_nullable' failed. 181121 5:25:30 [ERROR] mysqld got signal 6 ;   sql/signal_handler.cc:168(handle_fatal_signal)[0x56403a7850a0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fb23094a390] linux/raise.c:54(__GI_raise)[0x7fb22fd03428] stdlib/abort.c:91(__GI_abort)[0x7fb22fd0502a] assert/assert.c:92(__assert_fail_base)[0x7fb22fcfbbd7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fb22fcfbc82] handler/handler0alter.cc:338(dict_index_t::instant_add_field(dict_index_t const&))[0x56403ab42857] handler/handler0alter.cc:489(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x56403ab43ca6] handler/handler0alter.cc:5249(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x56403ab2d008] handler/handler0alter.cc:9888(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x56403ab483c5] handler/handler0alter.cc:10517(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x56403ab3be02] sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x56403a7918d0] sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x56403a54de54] sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x56403a553cbd] sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x56403a5e1138] sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x56403a47a4e1] sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x56403a47f6d2] sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x56403a46c555] sql/sql_parse.cc:1396(do_command(THD*))[0x56403a46af72] sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x56403a5dab1a] sql/sql_connect.cc:1309(handle_one_connection)[0x56403a5da86b] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb2309406ba] x86_64/clone.S:111(clone)[0x7fb22fdd541d]   Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x7fb1bc03e610): ALTER TABLE t10 ADD COLUMN tscol2 TIMESTAMP NOT NULL /* QNO 2019 CON_ID 15 */ perl ./runall-new.pl --no-mask --seed=1542774315 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --vcols --views=TEMPTABLE --notnull --threads=1 --grammar=conf/mariadb/instant_add.yy --gendata=conf/mariadb/1mytest.zz --engine=MyIsam --mtr-build-thread=308 --basedir1=/git/10.4 --vardir1=/1 /git/10.4/storage/innobase/handler/handler0alter.cc:338: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_core_fields == n_core_fields' failed. 181121 1:12:30 [ERROR] mysqld got signal 6 ;   linux/raise.c:54(__GI_raise)[0x7f8bb0603428] stdlib/abort.c:91(__GI_abort)[0x7f8bb060502a] assert/assert.c:92(__assert_fail_base)[0x7f8bb05fbbd7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f8bb05fbc82] handler/handler0alter.cc:339(dict_index_t::instant_add_field(dict_index_t const&))[0x562dff8ae8cb] handler/handler0alter.cc:489(dict_table_t::instant_column(dict_table_t const&, unsigned long const*))[0x562dff8afca6] handler/handler0alter.cc:5249(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x562dff899008] handler/handler0alter.cc:9888(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x562dff8b43c5] handler/handler0alter.cc:10517(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x562dff8a7e02] sql/handler.cc:4458(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x562dff4fd8d0] sql/sql_table.cc:7601(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x562dff2b9e54] sql/sql_table.cc:9692(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x562dff2bfcbd] sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x562dff34d138] sql/sql_parse.cc:6289(mysql_execute_command(THD*))[0x562dff1e64e1] sql/sql_parse.cc:8091(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x562dff1eb6d2] sql/sql_parse.cc:1853(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x562dff1d8555] sql/sql_parse.cc:1396(do_command(THD*))[0x562dff1d6f72] sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x562dff346b1a] sql/sql_connect.cc:1309(handle_one_connection)[0x562dff34686b] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f8bb12406ba] x86_64/clone.S:111(clone)[0x7f8bb06d541d]   Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x7f8b142d8e80): ALTER TABLE t18 ADD COLUMN IF NOT EXISTS tcol9 YEAR, LOCK=NONE, ADD COLUMN IF NOT EXISTS ( icol4 MEDIUMINT NOT NULL, scol5 TEXT NOT NULL DEFAULT '', ncol9 FLOAT UNSIGNED ZEROFILL ), LOCK=NONE /* QNO 1130 CON_ID 27 */ perl ./runall-new.pl --no-mask --seed=1542758821 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --querytimeout=30 --vcols --notnull --threads=25 --grammar=conf/mariadb/instant_add.yy --gendata=conf/drizzle/drizzle.zz --engine=Aria --mtr-build-thread=308 --basedir1=/git/10.4 --vardir1=/

            Test case for

            void dict_index_t::clear_instant_alter(): Assertion `&fields[n_fields - table->n_dropped()] == end' failed.
            

            --source include/have_innodb.inc
             
            CREATE TABLE t1 (f1 INT, f2 INT, f3 INT) ENGINE = InnoDB;
            INSERT INTO t1 VALUES (4,4,4);
            ALTER TABLE t1 DROP COLUMN f2;
            ALTER TABLE t1 DROP COLUMN f1;
            ALTER TABLE t1 ADD COLUMN f4 INT;
            ALTER TABLE t1 ADD COLUMN f5 INT;
            DELETE FROM t1;
            ALTER TABLE t1 DROP COLUMN f4;
             
            # Cleanup
            DROP TABLE t1;
            

            10.4 f0f0d0725

            mysqld: /data/src/10.4/storage/innobase/include/dict0mem.h:2167: void dict_index_t::clear_instant_alter(): Assertion `&fields[n_fields - table->n_dropped()] == end' failed.
            181121 11:18:17 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f1923e51ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x0000556f8ee59a21 in dict_index_t::clear_instant_alter (this=0x7f18c812d6b8) at /data/src/10.4/storage/innobase/include/dict0mem.h:2167
            #9  0x0000556f8ee486ce in innobase_instant_try (ha_alter_info=0x7f191d194bb0, ctx=0x7f18c8016268, altered_table=0x7f18c8059ee0, table=0x7f18c80560a0, trx=0x7f191dc8f218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5499
            #10 0x0000556f8ee621c3 in commit_try_norebuild (ha_alter_info=0x7f191d194bb0, ctx=0x7f18c8016268, altered_table=0x7f18c8059ee0, old_table=0x7f18c80560a0, trx=0x7f191dc8f218, table_name=0x7f18c8052b4d "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:9888
            #11 0x0000556f8ee55cd4 in ha_innobase::commit_inplace_alter_table (this=0x7f18c8054408, altered_table=0x7f18c8059ee0, ha_alter_info=0x7f191d194bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10517
            #12 0x0000556f8eaf0d7c in handler::ha_commit_inplace_alter_table (this=0x7f18c8054408, altered_table=0x7f18c8059ee0, ha_alter_info=0x7f191d194bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457
            #13 0x0000556f8e8bb0c2 in mysql_inplace_alter_table (thd=0x7f18c8000b00, table_list=0x7f18c8014e80, table=0x7f18c80560a0, altered_table=0x7f18c8059ee0, ha_alter_info=0x7f191d194bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f191d194ce0, alter_ctx=0x7f191d1958d0) at /data/src/10.4/sql/sql_table.cc:7599
            #14 0x0000556f8e8c0edd in mysql_alter_table (thd=0x7f18c8000b00, new_db=0x7f18c80051b8, new_name=0x7f18c8005588, create_info=0x7f191d1964c0, table_list=0x7f18c8014e80, alter_info=0x7f191d196400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692
            #15 0x0000556f8e94a067 in Sql_cmd_alter_table::execute (this=0x7f18c80154e8, thd=0x7f18c8000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #16 0x0000556f8e7e91f8 in mysql_execute_command (thd=0x7f18c8000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #17 0x0000556f8e7ee11c in mysql_parse (thd=0x7f18c8000b00, rawbuf=0x7f18c8014d98 "ALTER TABLE t1 DROP COLUMN f4", length=29, parser_state=0x7f191d197600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #18 0x0000556f8e7db41b in dispatch_command (command=COM_QUERY, thd=0x7f18c8000b00, packet=0x7f18c8093c51 "ALTER TABLE t1 DROP COLUMN f4", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #19 0x0000556f8e7d9e3f in do_command (thd=0x7f18c8000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #20 0x0000556f8e9442e6 in do_handle_one_connection (connect=0x556f9112ff10) at /data/src/10.4/sql/sql_connect.cc:1402
            #21 0x0000556f8e94406a in handle_one_connection (arg=0x556f9112ff10) at /data/src/10.4/sql/sql_connect.cc:1308
            #22 0x0000556f8edf13ed in pfs_spawn_thread (arg=0x556f911b51e0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #23 0x00007f192590d494 in start_thread (arg=0x7f191d198700) at pthread_create.c:333
            #24 0x00007f1923f0e93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            elenst Elena Stepanova added a comment - Test case for void dict_index_t::clear_instant_alter(): Assertion `&fields[n_fields - table->n_dropped()] == end' failed. --source include/have_innodb.inc   CREATE TABLE t1 (f1 INT , f2 INT , f3 INT ) ENGINE = InnoDB; INSERT INTO t1 VALUES (4,4,4); ALTER TABLE t1 DROP COLUMN f2; ALTER TABLE t1 DROP COLUMN f1; ALTER TABLE t1 ADD COLUMN f4 INT ; ALTER TABLE t1 ADD COLUMN f5 INT ; DELETE FROM t1; ALTER TABLE t1 DROP COLUMN f4;   # Cleanup DROP TABLE t1; 10.4 f0f0d0725 mysqld: /data/src/10.4/storage/innobase/include/dict0mem.h:2167: void dict_index_t::clear_instant_alter(): Assertion `&fields[n_fields - table->n_dropped()] == end' failed. 181121 11:18:17 [ERROR] mysqld got signal 6 ;   #7 0x00007f1923e51ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000556f8ee59a21 in dict_index_t::clear_instant_alter (this=0x7f18c812d6b8) at /data/src/10.4/storage/innobase/include/dict0mem.h:2167 #9 0x0000556f8ee486ce in innobase_instant_try (ha_alter_info=0x7f191d194bb0, ctx=0x7f18c8016268, altered_table=0x7f18c8059ee0, table=0x7f18c80560a0, trx=0x7f191dc8f218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5499 #10 0x0000556f8ee621c3 in commit_try_norebuild (ha_alter_info=0x7f191d194bb0, ctx=0x7f18c8016268, altered_table=0x7f18c8059ee0, old_table=0x7f18c80560a0, trx=0x7f191dc8f218, table_name=0x7f18c8052b4d "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:9888 #11 0x0000556f8ee55cd4 in ha_innobase::commit_inplace_alter_table (this=0x7f18c8054408, altered_table=0x7f18c8059ee0, ha_alter_info=0x7f191d194bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10517 #12 0x0000556f8eaf0d7c in handler::ha_commit_inplace_alter_table (this=0x7f18c8054408, altered_table=0x7f18c8059ee0, ha_alter_info=0x7f191d194bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457 #13 0x0000556f8e8bb0c2 in mysql_inplace_alter_table (thd=0x7f18c8000b00, table_list=0x7f18c8014e80, table=0x7f18c80560a0, altered_table=0x7f18c8059ee0, ha_alter_info=0x7f191d194bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f191d194ce0, alter_ctx=0x7f191d1958d0) at /data/src/10.4/sql/sql_table.cc:7599 #14 0x0000556f8e8c0edd in mysql_alter_table (thd=0x7f18c8000b00, new_db=0x7f18c80051b8, new_name=0x7f18c8005588, create_info=0x7f191d1964c0, table_list=0x7f18c8014e80, alter_info=0x7f191d196400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692 #15 0x0000556f8e94a067 in Sql_cmd_alter_table::execute (this=0x7f18c80154e8, thd=0x7f18c8000b00) at /data/src/10.4/sql/sql_alter.cc:497 #16 0x0000556f8e7e91f8 in mysql_execute_command (thd=0x7f18c8000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #17 0x0000556f8e7ee11c in mysql_parse (thd=0x7f18c8000b00, rawbuf=0x7f18c8014d98 "ALTER TABLE t1 DROP COLUMN f4", length=29, parser_state=0x7f191d197600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #18 0x0000556f8e7db41b in dispatch_command (command=COM_QUERY, thd=0x7f18c8000b00, packet=0x7f18c8093c51 "ALTER TABLE t1 DROP COLUMN f4", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #19 0x0000556f8e7d9e3f in do_command (thd=0x7f18c8000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #20 0x0000556f8e9442e6 in do_handle_one_connection (connect=0x556f9112ff10) at /data/src/10.4/sql/sql_connect.cc:1402 #21 0x0000556f8e94406a in handle_one_connection (arg=0x556f9112ff10) at /data/src/10.4/sql/sql_connect.cc:1308 #22 0x0000556f8edf13ed in pfs_spawn_thread (arg=0x556f911b51e0) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #23 0x00007f192590d494 in start_thread (arg=0x7f191d198700) at pthread_create.c:333 #24 0x00007f1923f0e93f in clone () from /lib/x86_64-linux-gnu/libc.so.6

            Test case for

            void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `n_nullable >= oindex.n_nullable' failed.
            

            --source include/have_innodb.inc
             
            CREATE TABLE t1 (f1 INT, f2 INT, f3 INT) ENGINE = InnoDB;
            ALTER TABLE t1 DROP COLUMN f2;
            ALTER TABLE t1 ADD COLUMN f4 INT;
            ALTER TABLE t1 CHANGE COLUMN f4 f2 INT;
            ALTER TABLE t1 DROP COLUMN f2;
            ALTER TABLE t1 DROP COLUMN f1;
             
            # Cleanup
            DROP TABLE t1;
            

            10.4 1ee0144db7

            mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:309: void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `n_nullable >= oindex.n_nullable' failed.
            181121 13:05:39 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f8b2a598ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000055ef576cef91 in dict_table_t::prepare_instant (this=0x7f8acc05a628, old=..., col_map=0x7f8acc05a2d8, first_alter_pos=@0x7f8acc0161e0: 1) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:309
            #9  0x000055ef576d2a25 in ha_innobase_inplace_ctx::prepare_instant (this=0x7f8acc016070) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:924
            #10 0x000055ef576be672 in prepare_inplace_alter_table_dict (ha_alter_info=0x7f8b2413bbb0, altered_table=0x7f8acc0578e0, old_table=0x7f8acc096060, table_name=0x7f8acc0a863d "t1", flags=33, flags2=80, fts_doc_id_col=18446744073709551615, add_fts_doc_id=false, add_fts_doc_id_idx=false) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:6260
            #11 0x000055ef576c3570 in ha_innobase::prepare_inplace_alter_table (this=0x7f8acc096c98, altered_table=0x7f8acc0578e0, ha_alter_info=0x7f8b2413bbb0) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:7807
            #12 0x000055ef57363c4b in handler::ha_prepare_inplace_alter_table (this=0x7f8acc096c98, altered_table=0x7f8acc0578e0, ha_alter_info=0x7f8b2413bbb0) at /data/src/10.4/sql/handler.cc:4437
            #13 0x000055ef5712dcc0 in mysql_inplace_alter_table (thd=0x7f8acc000b00, table_list=0x7f8acc014e80, table=0x7f8acc096060, altered_table=0x7f8acc0578e0, ha_alter_info=0x7f8b2413bbb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f8b2413bce0, alter_ctx=0x7f8b2413c8d0) at /data/src/10.4/sql/sql_table.cc:7516
            #14 0x000055ef57133edd in mysql_alter_table (thd=0x7f8acc000b00, new_db=0x7f8acc0051b8, new_name=0x7f8acc005588, create_info=0x7f8b2413d4c0, table_list=0x7f8acc014e80, alter_info=0x7f8b2413d400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692
            #15 0x000055ef571bd067 in Sql_cmd_alter_table::execute (this=0x7f8acc0154e8, thd=0x7f8acc000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #16 0x000055ef5705c1f8 in mysql_execute_command (thd=0x7f8acc000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #17 0x000055ef5706111c in mysql_parse (thd=0x7f8acc000b00, rawbuf=0x7f8acc014d98 "ALTER TABLE t1 DROP COLUMN f1", length=29, parser_state=0x7f8b2413e600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #18 0x000055ef5704e41b in dispatch_command (command=COM_QUERY, thd=0x7f8acc000b00, packet=0x7f8acc00b401 "ALTER TABLE t1 DROP COLUMN f1", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #19 0x000055ef5704ce3f in do_command (thd=0x7f8acc000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #20 0x000055ef571b72e6 in do_handle_one_connection (connect=0x55ef5a9fcf20) at /data/src/10.4/sql/sql_connect.cc:1402
            #21 0x000055ef571b706a in handle_one_connection (arg=0x55ef5a9fcf20) at /data/src/10.4/sql/sql_connect.cc:1308
            #22 0x000055ef576643ed in pfs_spawn_thread (arg=0x55ef5aa821f0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #23 0x00007f8b2c054494 in start_thread (arg=0x7f8b2413f700) at pthread_create.c:333
            #24 0x00007f8b2a65593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            Doesn't fail on 10.3.

            elenst Elena Stepanova added a comment - Test case for void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `n_nullable >= oindex.n_nullable' failed. --source include/have_innodb.inc   CREATE TABLE t1 (f1 INT , f2 INT , f3 INT ) ENGINE = InnoDB; ALTER TABLE t1 DROP COLUMN f2; ALTER TABLE t1 ADD COLUMN f4 INT ; ALTER TABLE t1 CHANGE COLUMN f4 f2 INT ; ALTER TABLE t1 DROP COLUMN f2; ALTER TABLE t1 DROP COLUMN f1;   # Cleanup DROP TABLE t1; 10.4 1ee0144db7 mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:309: void dict_table_t::prepare_instant(const dict_table_t&, const ulint*, unsigned int&): Assertion `n_nullable >= oindex.n_nullable' failed. 181121 13:05:39 [ERROR] mysqld got signal 6 ;   #7 0x00007f8b2a598ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000055ef576cef91 in dict_table_t::prepare_instant (this=0x7f8acc05a628, old=..., col_map=0x7f8acc05a2d8, first_alter_pos=@0x7f8acc0161e0: 1) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:309 #9 0x000055ef576d2a25 in ha_innobase_inplace_ctx::prepare_instant (this=0x7f8acc016070) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:924 #10 0x000055ef576be672 in prepare_inplace_alter_table_dict (ha_alter_info=0x7f8b2413bbb0, altered_table=0x7f8acc0578e0, old_table=0x7f8acc096060, table_name=0x7f8acc0a863d "t1", flags=33, flags2=80, fts_doc_id_col=18446744073709551615, add_fts_doc_id=false, add_fts_doc_id_idx=false) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:6260 #11 0x000055ef576c3570 in ha_innobase::prepare_inplace_alter_table (this=0x7f8acc096c98, altered_table=0x7f8acc0578e0, ha_alter_info=0x7f8b2413bbb0) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:7807 #12 0x000055ef57363c4b in handler::ha_prepare_inplace_alter_table (this=0x7f8acc096c98, altered_table=0x7f8acc0578e0, ha_alter_info=0x7f8b2413bbb0) at /data/src/10.4/sql/handler.cc:4437 #13 0x000055ef5712dcc0 in mysql_inplace_alter_table (thd=0x7f8acc000b00, table_list=0x7f8acc014e80, table=0x7f8acc096060, altered_table=0x7f8acc0578e0, ha_alter_info=0x7f8b2413bbb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f8b2413bce0, alter_ctx=0x7f8b2413c8d0) at /data/src/10.4/sql/sql_table.cc:7516 #14 0x000055ef57133edd in mysql_alter_table (thd=0x7f8acc000b00, new_db=0x7f8acc0051b8, new_name=0x7f8acc005588, create_info=0x7f8b2413d4c0, table_list=0x7f8acc014e80, alter_info=0x7f8b2413d400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692 #15 0x000055ef571bd067 in Sql_cmd_alter_table::execute (this=0x7f8acc0154e8, thd=0x7f8acc000b00) at /data/src/10.4/sql/sql_alter.cc:497 #16 0x000055ef5705c1f8 in mysql_execute_command (thd=0x7f8acc000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #17 0x000055ef5706111c in mysql_parse (thd=0x7f8acc000b00, rawbuf=0x7f8acc014d98 "ALTER TABLE t1 DROP COLUMN f1", length=29, parser_state=0x7f8b2413e600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #18 0x000055ef5704e41b in dispatch_command (command=COM_QUERY, thd=0x7f8acc000b00, packet=0x7f8acc00b401 "ALTER TABLE t1 DROP COLUMN f1", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #19 0x000055ef5704ce3f in do_command (thd=0x7f8acc000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #20 0x000055ef571b72e6 in do_handle_one_connection (connect=0x55ef5a9fcf20) at /data/src/10.4/sql/sql_connect.cc:1402 #21 0x000055ef571b706a in handle_one_connection (arg=0x55ef5a9fcf20) at /data/src/10.4/sql/sql_connect.cc:1308 #22 0x000055ef576643ed in pfs_spawn_thread (arg=0x55ef5aa821f0) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #23 0x00007f8b2c054494 in start_thread (arg=0x7f8b2413f700) at pthread_create.c:333 #24 0x00007f8b2a65593f in clone () from /lib/x86_64-linux-gnu/libc.so.6 Doesn't fail on 10.3.

            Note: It's an extremely bad test case, run with --repeat=N, N as big as possible (thousands). The test case is most likely not minimal, but reducing it further blindly is too time-consuming due to the low probability of the failure.

            --source include/have_innodb.inc
             
            CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, f4 TEXT) ENGINE=InnoDB;
            INSERT INTO t1 (f1,f2,f3,f4) VALUES (2,2,2,NULL),(2,2,2,NULL);
            INSERT INTO t1 (f1,f2,f3,f4) VALUES (4,4,4,NULL);
            ALTER TABLE t1 DROP COLUMN f2;
            ALTER TABLE t1 ADD COLUMN extra INT;
            ALTER TABLE t1 CHANGE COLUMN extra f2 INT;
            ALTER TABLE t1 DROP COLUMN f1;
            ALTER TABLE t1 ADD COLUMN extra INT;
            ALTER TABLE t1 CHANGE COLUMN extra f1 INT;
            ALTER TABLE t1 DROP COLUMN f2;
            DELETE FROM t1 WHERE f1 = 3 OR f1 IS NULL;
            ALTER TABLE t1 ADD COLUMN extra INT;
            UPDATE t1 SET extra = f1;
            ALTER TABLE t1 DROP COLUMN f1;
             
            # Cleanup
            DROP TABLE t1;
            

            10.4 9fdb8c59eb2

            2018-11-22  4:00:15 3 [ERROR] InnoDB: Trying to access update undo rec field 9 in index `GEN_CLUST_INDEX` of table `test`.`t1` but index has only 7 fields Submit a detailed bug report to https://jira.mariadb.org/. Run also CHECK TABLE `test`.`t1`. n_fields = 2, i = 1
            mysqld: /data/src/10.4/storage/innobase/trx/trx0rec.cc:1661: byte* trx_undo_update_rec_get_update(const byte*, dict_index_t*, ulint, trx_id_t, roll_ptr_t, ulint, mem_heap_t*, upd_t**): Assertion `0' failed.
            181122  4:00:15 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f6343107ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000055e994532ed1 in trx_undo_update_rec_get_update (ptr=0x55e9968b0f8f "\360\377\377\377\377\060\222", index=0x7f62e42b3f68, type=12, trx_id=0, roll_ptr=36028797018963968, info_bits=48, heap=0x55e9968b0ec0, upd=0x55e9968b03f0) at /data/src/10.4/storage/innobase/trx/trx0rec.cc:1661
            #9  0x000055e9944ba1c5 in row_purge_parse_undo_rec (node=0x55e9968b0388, undo_rec=0x55e9968b0f58 "", updated_extern=0x7f63297f9d3e, thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/row/row0purge.cc:1146
            #10 0x000055e9944ba86c in row_purge (node=0x55e9968b0388, undo_rec=0x55e9968b0f58 "", thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/row/row0purge.cc:1255
            #11 0x000055e9944bab36 in row_purge_step (thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/row/row0purge.cc:1344
            #12 0x000055e99443d2cc in que_thr_step (thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/que/que0que.cc:1042
            #13 0x000055e99443d4ff in que_run_threads_low (thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/que/que0que.cc:1104
            #14 0x000055e99443d6f0 in que_run_threads (thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/que/que0que.cc:1144
            #15 0x000055e994523451 in trx_purge (n_purge_threads=3, truncate=false) at /data/src/10.4/storage/innobase/trx/trx0purge.cc:1328
            #16 0x000055e9944f907f in srv_do_purge (n_total_purged=0x7f63297f9ed0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2589
            #17 0x000055e9944f94a8 in srv_purge_coordinator_thread (arg=0x0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2712
            #18 0x00007f6344bc3494 in start_thread (arg=0x7f63297fa700) at pthread_create.c:333
            #19 0x00007f63431c493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            elenst Elena Stepanova added a comment - Note: It's an extremely bad test case, run with --repeat=N, N as big as possible (thousands). The test case is most likely not minimal, but reducing it further blindly is too time-consuming due to the low probability of the failure. --source include/have_innodb.inc   CREATE TABLE t1 (f1 INT , f2 INT , f3 INT , f4 TEXT) ENGINE=InnoDB; INSERT INTO t1 (f1,f2,f3,f4) VALUES (2,2,2, NULL ),(2,2,2, NULL ); INSERT INTO t1 (f1,f2,f3,f4) VALUES (4,4,4, NULL ); ALTER TABLE t1 DROP COLUMN f2; ALTER TABLE t1 ADD COLUMN extra INT ; ALTER TABLE t1 CHANGE COLUMN extra f2 INT ; ALTER TABLE t1 DROP COLUMN f1; ALTER TABLE t1 ADD COLUMN extra INT ; ALTER TABLE t1 CHANGE COLUMN extra f1 INT ; ALTER TABLE t1 DROP COLUMN f2; DELETE FROM t1 WHERE f1 = 3 OR f1 IS NULL ; ALTER TABLE t1 ADD COLUMN extra INT ; UPDATE t1 SET extra = f1; ALTER TABLE t1 DROP COLUMN f1;   # Cleanup DROP TABLE t1; 10.4 9fdb8c59eb2 2018-11-22 4:00:15 3 [ERROR] InnoDB: Trying to access update undo rec field 9 in index `GEN_CLUST_INDEX` of table `test`.`t1` but index has only 7 fields Submit a detailed bug report to https://jira.mariadb.org/. Run also CHECK TABLE `test`.`t1`. n_fields = 2, i = 1 mysqld: /data/src/10.4/storage/innobase/trx/trx0rec.cc:1661: byte* trx_undo_update_rec_get_update(const byte*, dict_index_t*, ulint, trx_id_t, roll_ptr_t, ulint, mem_heap_t*, upd_t**): Assertion `0' failed. 181122 4:00:15 [ERROR] mysqld got signal 6 ;   #7 0x00007f6343107ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000055e994532ed1 in trx_undo_update_rec_get_update (ptr=0x55e9968b0f8f "\360\377\377\377\377\060\222", index=0x7f62e42b3f68, type=12, trx_id=0, roll_ptr=36028797018963968, info_bits=48, heap=0x55e9968b0ec0, upd=0x55e9968b03f0) at /data/src/10.4/storage/innobase/trx/trx0rec.cc:1661 #9 0x000055e9944ba1c5 in row_purge_parse_undo_rec (node=0x55e9968b0388, undo_rec=0x55e9968b0f58 "", updated_extern=0x7f63297f9d3e, thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/row/row0purge.cc:1146 #10 0x000055e9944ba86c in row_purge (node=0x55e9968b0388, undo_rec=0x55e9968b0f58 "", thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/row/row0purge.cc:1255 #11 0x000055e9944bab36 in row_purge_step (thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/row/row0purge.cc:1344 #12 0x000055e99443d2cc in que_thr_step (thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/que/que0que.cc:1042 #13 0x000055e99443d4ff in que_run_threads_low (thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/que/que0que.cc:1104 #14 0x000055e99443d6f0 in que_run_threads (thr=0x55e9968afee0) at /data/src/10.4/storage/innobase/que/que0que.cc:1144 #15 0x000055e994523451 in trx_purge (n_purge_threads=3, truncate=false) at /data/src/10.4/storage/innobase/trx/trx0purge.cc:1328 #16 0x000055e9944f907f in srv_do_purge (n_total_purged=0x7f63297f9ed0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2589 #17 0x000055e9944f94a8 in srv_purge_coordinator_thread (arg=0x0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2712 #18 0x00007f6344bc3494 in start_thread (arg=0x7f63297fa700) at pthread_create.c:333 #19 0x00007f63431c493f in clone () from /lib/x86_64-linux-gnu/libc.so.6

            I filed MDEV-17793 for the purge issue.

            marko Marko Mäkelä added a comment - I filed MDEV-17793 for the purge issue.
            elenst Elena Stepanova added a comment - - edited

            10.4 740ce108a5

            mysqld: /data/src/10.4/storage/innobase/rem/rem0rec.cc:1203: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool) [with bool mblob = false; ulint = long unsigned int]: Assertion `len <= field->col->len || ((field->col->mtype) == 5 || (field->col->mtype) == 14) || (field->col->len == 0 && field->col->mtype == 1)' failed.
            181122 13:38:07 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007fa4b12a9ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000056405c84c3c7 in rec_get_converted_size_comp_prefix_low<false> (index=0x7fa4340da9b8, dfield=0x7fa4386e8cd0, n_fields=3, extra=0x7fa4b0132b80, status=REC_STATUS_ORDINARY, temp=false) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1200
            #9  0x000056405c847382 in rec_get_converted_size_temp (index=0x7fa4340da9b8, fields=0x7fa4386e8cd0, n_fields=3, extra=0x7fa4b0132b80, status=REC_STATUS_ORDINARY) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1790
            #10 0x000056405c8a51f0 in row_log_table_low (rec=0x7fa4925f80b1 "", index=0x7fa4300f6bb8, offsets=0x7fa4b0132d30, insert=false, old_pk=0x7fa4386e8c88) at /data/src/10.4/storage/innobase/row/row0log.cc:1038
            #11 0x000056405c8a5588 in row_log_table_update (rec=0x7fa4925f80b1 "", index=0x7fa4300f6bb8, offsets=0x7fa4b0132d30, old_pk=0x7fa4386e8c88) at /data/src/10.4/storage/innobase/row/row0log.cc:1108
            #12 0x000056405c8e430c in row_upd_clust_rec (flags=0, node=0x7fa4387419a8, index=0x7fa4300f6bb8, offsets=0x7fa4b0132d30, offsets_heap=0x7fa4b0132ce0, thr=0x7fa438741d10, mtr=0x7fa4b0133050) at /data/src/10.4/storage/innobase/row/row0upd.cc:2922
            #13 0x000056405c8e5064 in row_upd_clust_step (node=0x7fa4387419a8, thr=0x7fa438741d10) at /data/src/10.4/storage/innobase/row/row0upd.cc:3191
            #14 0x000056405c8e546a in row_upd (node=0x7fa4387419a8, thr=0x7fa438741d10) at /data/src/10.4/storage/innobase/row/row0upd.cc:3288
            #15 0x000056405c8e5958 in row_upd_step (thr=0x7fa438741d10) at /data/src/10.4/storage/innobase/row/row0upd.cc:3432
            #16 0x000056405c894e03 in row_update_for_mysql (prebuilt=0x7fa438741198) at /data/src/10.4/storage/innobase/row/row0mysql.cc:1889
            #17 0x000056405c734f6a in ha_innobase::update_row (this=0x7fa43874ead8, old_row=0x7fa438743f18 "\374\001 \350\250s8\244\177", new_row=0x7fa438743f00 "\374\001 \350\250s8\244\177") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:8813
            #18 0x000056405c41661e in handler::ha_update_row (this=0x7fa43874ead8, old_data=0x7fa438743f18 "\374\001 \350\250s8\244\177", new_data=0x7fa438743f00 "\374\001 \350\250s8\244\177") at /data/src/10.4/sql/handler.cc:6270
            #19 0x000056405c1fd4dc in mysql_update (thd=0x7fa438000b00, table_list=0x7fa438015c68, fields=..., values=..., conds=0x0, order_num=0, order=0x0, limit=2, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7fa4b0133f70, updated_return=0x7fa4b0134030) at /data/src/10.4/sql/sql_update.cc:947
            #20 0x000056405c1036c8 in mysql_execute_command (thd=0x7fa438000b00) at /data/src/10.4/sql/sql_parse.cc:4585
            #21 0x000056405c10e938 in mysql_parse (thd=0x7fa438000b00, rawbuf=0x7fa438015b48 "UPDATE t1 SET col2 = 3 LIMIT 2  /* QNO 19710 CON_ID 15 */", length=57, parser_state=0x7fa4b0134650, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #22 0x000056405c0fbc37 in dispatch_command (command=COM_QUERY, thd=0x7fa438000b00, packet=0x7fa43801c451 "UPDATE t1 SET col2 = 3 LIMIT 2  /* QNO 19710 CON_ID 15 */ ", packet_length=58, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #23 0x000056405c0fa65b in do_command (thd=0x7fa438000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #24 0x000056405c264a9c in do_handle_one_connection (connect=0x56405fee45a0) at /data/src/10.4/sql/sql_connect.cc:1402
            #25 0x000056405c264820 in handle_one_connection (arg=0x56405fee45a0) at /data/src/10.4/sql/sql_connect.cc:1308
            #26 0x00007fa4b2d65494 in start_thread (arg=0x7fa4b0135700) at pthread_create.c:333
            #27 0x00007fa4b136693f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            github.com/MariaDB/randgen elenst-dev 539d817245163

            perl ./runall-trials.pl --trials=5 --no-mask --seed=1542727721 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --mysqld=--lock-wait-timeout=5 --mysqld=--innodb-lock-wait-timeout=3 --querytimeout=30 --vcols --threads=6 --grammar=conf/runtime/alter_online.yy --gendata=conf/mariadb/oltp.zz --engine=MyIsam --basedir1=/data/bld/10.4-mdev17721 --vardir1=/dev/shm/vardir
            

            elenst Elena Stepanova added a comment - - edited 10.4 740ce108a5 mysqld: /data/src/10.4/storage/innobase/rem/rem0rec.cc:1203: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool) [with bool mblob = false; ulint = long unsigned int]: Assertion `len <= field->col->len || ((field->col->mtype) == 5 || (field->col->mtype) == 14) || (field->col->len == 0 && field->col->mtype == 1)' failed. 181122 13:38:07 [ERROR] mysqld got signal 6 ;   #7 0x00007fa4b12a9ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000056405c84c3c7 in rec_get_converted_size_comp_prefix_low<false> (index=0x7fa4340da9b8, dfield=0x7fa4386e8cd0, n_fields=3, extra=0x7fa4b0132b80, status=REC_STATUS_ORDINARY, temp=false) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1200 #9 0x000056405c847382 in rec_get_converted_size_temp (index=0x7fa4340da9b8, fields=0x7fa4386e8cd0, n_fields=3, extra=0x7fa4b0132b80, status=REC_STATUS_ORDINARY) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1790 #10 0x000056405c8a51f0 in row_log_table_low (rec=0x7fa4925f80b1 "", index=0x7fa4300f6bb8, offsets=0x7fa4b0132d30, insert=false, old_pk=0x7fa4386e8c88) at /data/src/10.4/storage/innobase/row/row0log.cc:1038 #11 0x000056405c8a5588 in row_log_table_update (rec=0x7fa4925f80b1 "", index=0x7fa4300f6bb8, offsets=0x7fa4b0132d30, old_pk=0x7fa4386e8c88) at /data/src/10.4/storage/innobase/row/row0log.cc:1108 #12 0x000056405c8e430c in row_upd_clust_rec (flags=0, node=0x7fa4387419a8, index=0x7fa4300f6bb8, offsets=0x7fa4b0132d30, offsets_heap=0x7fa4b0132ce0, thr=0x7fa438741d10, mtr=0x7fa4b0133050) at /data/src/10.4/storage/innobase/row/row0upd.cc:2922 #13 0x000056405c8e5064 in row_upd_clust_step (node=0x7fa4387419a8, thr=0x7fa438741d10) at /data/src/10.4/storage/innobase/row/row0upd.cc:3191 #14 0x000056405c8e546a in row_upd (node=0x7fa4387419a8, thr=0x7fa438741d10) at /data/src/10.4/storage/innobase/row/row0upd.cc:3288 #15 0x000056405c8e5958 in row_upd_step (thr=0x7fa438741d10) at /data/src/10.4/storage/innobase/row/row0upd.cc:3432 #16 0x000056405c894e03 in row_update_for_mysql (prebuilt=0x7fa438741198) at /data/src/10.4/storage/innobase/row/row0mysql.cc:1889 #17 0x000056405c734f6a in ha_innobase::update_row (this=0x7fa43874ead8, old_row=0x7fa438743f18 "\374\001 \350\250s8\244\177", new_row=0x7fa438743f00 "\374\001 \350\250s8\244\177") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:8813 #18 0x000056405c41661e in handler::ha_update_row (this=0x7fa43874ead8, old_data=0x7fa438743f18 "\374\001 \350\250s8\244\177", new_data=0x7fa438743f00 "\374\001 \350\250s8\244\177") at /data/src/10.4/sql/handler.cc:6270 #19 0x000056405c1fd4dc in mysql_update (thd=0x7fa438000b00, table_list=0x7fa438015c68, fields=..., values=..., conds=0x0, order_num=0, order=0x0, limit=2, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7fa4b0133f70, updated_return=0x7fa4b0134030) at /data/src/10.4/sql/sql_update.cc:947 #20 0x000056405c1036c8 in mysql_execute_command (thd=0x7fa438000b00) at /data/src/10.4/sql/sql_parse.cc:4585 #21 0x000056405c10e938 in mysql_parse (thd=0x7fa438000b00, rawbuf=0x7fa438015b48 "UPDATE t1 SET col2 = 3 LIMIT 2 /* QNO 19710 CON_ID 15 */", length=57, parser_state=0x7fa4b0134650, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #22 0x000056405c0fbc37 in dispatch_command (command=COM_QUERY, thd=0x7fa438000b00, packet=0x7fa43801c451 "UPDATE t1 SET col2 = 3 LIMIT 2 /* QNO 19710 CON_ID 15 */ ", packet_length=58, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #23 0x000056405c0fa65b in do_command (thd=0x7fa438000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #24 0x000056405c264a9c in do_handle_one_connection (connect=0x56405fee45a0) at /data/src/10.4/sql/sql_connect.cc:1402 #25 0x000056405c264820 in handle_one_connection (arg=0x56405fee45a0) at /data/src/10.4/sql/sql_connect.cc:1308 #26 0x00007fa4b2d65494 in start_thread (arg=0x7fa4b0135700) at pthread_create.c:333 #27 0x00007fa4b136693f in clone () from /lib/x86_64-linux-gnu/libc.so.6 github.com/MariaDB/randgen elenst-dev 539d817245163 perl ./runall-trials.pl --trials=5 --no-mask --seed=1542727721 --duration=400 --queries=100M --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ConvertSubqueriesToViews,ConvertTablesToDerived,Count,DisableIndexes,DisableOptimizations,Distinct,EnableOptimizations,ExecuteAsCTE,ExecuteAsDeleteReturning,ExecuteAsDerived,ExecuteAsExcept,ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsIntersect,ExecuteAsSelectItem,ExecuteAsUnion,ExecuteAsUpdateDelete,ExecuteAsView,ExecuteAsWhereSubquery,Having,InlineSubqueries,InlineVirtualColumns,LimitRowsExamined,OrderBy,StraightJoin,ExecuteAsPreparedTwice,ExecuteAsTrigger,ExecuteAsSPTwice,ExecuteAsFunctionTwice --mysqld=--log_output=FILE --mysqld=--lock-wait-timeout=5 --mysqld=--innodb-lock-wait-timeout=3 --querytimeout=30 --vcols --threads=6 --grammar=conf/runtime/alter_online.yy --gendata=conf/mariadb/oltp.zz --engine=MyIsam --basedir1=/data/bld/10.4-mdev17721 --vardir1=/dev/shm/vardir

            10.4 4be0855cf5

            mysqld: /home/travis/src/storage/innobase/handler/handler0alter.cc:5475: bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*): Assertion `!"wrong page type"' failed.
            181122 15:37:43 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007fed40787c82 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000055df7fe5df83 in innobase_instant_try (ha_alter_info=0x7fed3c553c00, ctx=0x7fed38309180, altered_table=0x7fed380c01c0, table=0x7fed381497b0, trx=0x7fed3d417818) at /home/travis/src/storage/innobase/handler/handler0alter.cc:5475
            #9  0x000055df7fe78604 in commit_try_norebuild (ha_alter_info=0x7fed3c553c00, ctx=0x7fed38309180, altered_table=0x7fed380c01c0, old_table=0x7fed381497b0, trx=0x7fed3d417818, table_name=0x7fed383c3cad "table100_int_autoinc") at /home/travis/src/storage/innobase/handler/handler0alter.cc:9949
            #10 0x000055df7fe6bbc1 in ha_innobase::commit_inplace_alter_table (this=0x7fed3816c2e8, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, commit=true) at /home/travis/src/storage/innobase/handler/handler0alter.cc:10578
            #11 0x000055df7fc14a4e in handler::ha_commit_inplace_alter_table (this=0x7fed3816c2e8, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, commit=true) at /home/travis/src/sql/handler.cc:4457
            #12 0x000055df803883b4 in ha_partition::commit_inplace_alter_table (this=0x7fed3856b338, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, commit=true) at /home/travis/src/sql/ha_partition.cc:10130
            #13 0x000055df7fc14a4e in handler::ha_commit_inplace_alter_table (this=0x7fed3856b338, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, commit=true) at /home/travis/src/sql/handler.cc:4457
            #14 0x000055df7f9dd6d1 in mysql_inplace_alter_table (thd=0x7fed381ebf40, table_list=0x7fed38304cf0, table=0x7fed381497b0, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fed3c553d30, alter_ctx=0x7fed3c554920) at /home/travis/src/sql/sql_table.cc:7599
            #15 0x000055df7f9e34d0 in mysql_alter_table (thd=0x7fed381ebf40, new_db=0x7fed381f05f8, new_name=0x7fed381f09c8, create_info=0x7fed3c555510, table_list=0x7fed38304cf0, alter_info=0x7fed3c555450, order_num=0, order=0x0, ignore=false) at /home/travis/src/sql/sql_table.cc:9690
            #16 0x000055df7fa6c662 in Sql_cmd_alter_table::execute (this=0x7fed38305450, thd=0x7fed381ebf40) at /home/travis/src/sql/sql_alter.cc:497
            #17 0x000055df7f90bbbd in mysql_execute_command (thd=0x7fed381ebf40) at /home/travis/src/sql/sql_parse.cc:6289
            #18 0x000055df7f910dae in mysql_parse (thd=0x7fed381ebf40, rawbuf=0x7fed38304ae8 "ALTER TABLE `table100_int_autoinc` ADD COLUMN IF NOT EXISTS tscol6 TIMESTAMP NULL, ALGORITHM=INPLACE  /* QNO 1273 CON_ID 19 */", length=126, parser_state=0x7fed3c556650, is_com_multi=false, is_next_command=false) at /home/travis/src/sql/sql_parse.cc:8091
            #19 0x000055df7f8fdd7d in dispatch_command (command=COM_QUERY, thd=0x7fed381ebf40, packet=0x7fed381dbf11 "ALTER TABLE `table100_int_autoinc` ADD COLUMN IF NOT EXISTS tscol6 TIMESTAMP NULL, ALGORITHM=INPLACE  /* QNO 1273 CON_ID 19 */ ", packet_length=127, is_com_multi=false, is_next_command=false) at /home/travis/src/sql/sql_parse.cc:1851
            #20 0x000055df7f8fc79a in do_command (thd=0x7fed381ebf40) at /home/travis/src/sql/sql_parse.cc:1396
            #21 0x000055df7fa668de in do_handle_one_connection (connect=0x55df82688780) at /home/travis/src/sql/sql_connect.cc:1402
            #22 0x000055df7fa6662f in handle_one_connection (arg=0x55df82688780) at /home/travis/src/sql/sql_connect.cc:1308
            #23 0x00007fed413cc6ba in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
            #24 0x00007fed4086141d in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            https://travis-ci.org/elenst/travis-tests/jobs/458432454

            Not reproducible locally so far, but I have the datadir from the above. The server crashes with a different assertion failure when I try to start it on this datadir:

            10.4 46a411088c

            mysqld: /data/src/10.4/storage/innobase/include/rem0rec.h:774: bool rec_is_metadata(const rec_t*, const dict_index_t&): Assertion `!is || index.is_instant()' failed.
            181122 19:10:56 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f9465288ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000055aaa6353dd3 in rec_is_metadata (rec=0x7f944048ddb6 "", index=...) at /data/src/10.4/storage/innobase/include/rem0rec.h:774
            #9  0x000055aaa63e67c2 in page_cur_search_with_match_bytes (block=0x7f943fa45fe8, index=0x7f9404016eb8, tuple=0x7f941c022a10, mode=PAGE_CUR_LE, iup_matched_fields=0x7f9423ffcda8, iup_matched_bytes=0x7f9423ffcdb0, ilow_matched_fields=0x7f9423ffcdb8, ilow_matched_bytes=0x7f9423ffcdc0, cursor=0x55aaaa0326f0) at /data/src/10.4/storage/innobase/page/page0cur.cc:737
            #10 0x000055aaa655d3e0 in btr_cur_search_to_nth_level_func (index=0x7f9404016eb8, level=0, tuple=0x7f941c022a10, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x55aaaa0326e8, ahi_latch=0x0, file=0x55aaa6b01be8 "/data/src/10.4/storage/innobase/row/row0row.cc", line=1219, mtr=0x7f9423ffe240, autoinc=0) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:1899
            #11 0x000055aaa6495e08 in btr_pcur_open_low (index=0x7f9404016eb8, level=0, tuple=0x7f941c022a10, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x55aaaa0326e8, file=0x55aaa6b01be8 "/data/src/10.4/storage/innobase/row/row0row.cc", line=1219, autoinc=0, mtr=0x7f9423ffe240) at /data/src/10.4/storage/innobase/include/btr0pcur.ic:464
            #12 0x000055aaa6498fe3 in row_search_on_row_ref (pcur=0x55aaaa0326e8, mode=2, table=0x7f94040158d8, ref=0x7f941c022a10, mtr=0x7f9423ffe240) at /data/src/10.4/storage/innobase/row/row0row.cc:1219
            #13 0x000055aaa648d520 in row_purge_reposition_pcur (mode=2, node=0x55aaaa032650, mtr=0x7f9423ffe240) at /data/src/10.4/storage/innobase/row/row0purge.cc:104
            #14 0x000055aaa648d6f7 in row_purge_remove_clust_if_poss_low (node=0x55aaaa032650, mode=2) at /data/src/10.4/storage/innobase/row/row0purge.cc:148
            #15 0x000055aaa648da5b in row_purge_remove_clust_if_poss (node=0x55aaaa032650) at /data/src/10.4/storage/innobase/row/row0purge.cc:216
            #16 0x000055aaa648f2c7 in row_purge_del_mark (node=0x55aaaa032650) at /data/src/10.4/storage/innobase/row/row0purge.cc:806
            #17 0x000055aaa6490851 in row_purge_record_func (node=0x55aaaa032650, undo_rec=0x7f941c018a98 "", thr=0x55aaaa032598, updated_extern=false) at /data/src/10.4/storage/innobase/row/row0purge.cc:1191
            #18 0x000055aaa6490b8e in row_purge (node=0x55aaaa032650, undo_rec=0x7f941c018a98 "", thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/row/row0purge.cc:1258
            #19 0x000055aaa6490f3c in row_purge_step (thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/row/row0purge.cc:1344
            #20 0x000055aaa64136e0 in que_thr_step (thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/que/que0que.cc:1042
            #21 0x000055aaa6413913 in que_run_threads_low (thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/que/que0que.cc:1104
            #22 0x000055aaa6413b04 in que_run_threads (thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/que/que0que.cc:1144
            #23 0x000055aaa64faae3 in trx_purge (n_purge_threads=4, truncate=false) at /data/src/10.4/storage/innobase/trx/trx0purge.cc:1328
            #24 0x000055aaa64d0711 in srv_do_purge (n_total_purged=0x7f9423ffeed0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2589
            #25 0x000055aaa64d0b3a in srv_purge_coordinator_thread (arg=0x0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2712
            #26 0x00007f9466d44494 in start_thread (arg=0x7f9423fff700) at pthread_create.c:333
            #27 0x00007f946534593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            elenst Elena Stepanova added a comment - 10.4 4be0855cf5 mysqld: /home/travis/src/storage/innobase/handler/handler0alter.cc:5475: bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*): Assertion `!"wrong page type"' failed. 181122 15:37:43 [ERROR] mysqld got signal 6 ;   #7 0x00007fed40787c82 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000055df7fe5df83 in innobase_instant_try (ha_alter_info=0x7fed3c553c00, ctx=0x7fed38309180, altered_table=0x7fed380c01c0, table=0x7fed381497b0, trx=0x7fed3d417818) at /home/travis/src/storage/innobase/handler/handler0alter.cc:5475 #9 0x000055df7fe78604 in commit_try_norebuild (ha_alter_info=0x7fed3c553c00, ctx=0x7fed38309180, altered_table=0x7fed380c01c0, old_table=0x7fed381497b0, trx=0x7fed3d417818, table_name=0x7fed383c3cad "table100_int_autoinc") at /home/travis/src/storage/innobase/handler/handler0alter.cc:9949 #10 0x000055df7fe6bbc1 in ha_innobase::commit_inplace_alter_table (this=0x7fed3816c2e8, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, commit=true) at /home/travis/src/storage/innobase/handler/handler0alter.cc:10578 #11 0x000055df7fc14a4e in handler::ha_commit_inplace_alter_table (this=0x7fed3816c2e8, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, commit=true) at /home/travis/src/sql/handler.cc:4457 #12 0x000055df803883b4 in ha_partition::commit_inplace_alter_table (this=0x7fed3856b338, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, commit=true) at /home/travis/src/sql/ha_partition.cc:10130 #13 0x000055df7fc14a4e in handler::ha_commit_inplace_alter_table (this=0x7fed3856b338, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, commit=true) at /home/travis/src/sql/handler.cc:4457 #14 0x000055df7f9dd6d1 in mysql_inplace_alter_table (thd=0x7fed381ebf40, table_list=0x7fed38304cf0, table=0x7fed381497b0, altered_table=0x7fed380c01c0, ha_alter_info=0x7fed3c553c00, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fed3c553d30, alter_ctx=0x7fed3c554920) at /home/travis/src/sql/sql_table.cc:7599 #15 0x000055df7f9e34d0 in mysql_alter_table (thd=0x7fed381ebf40, new_db=0x7fed381f05f8, new_name=0x7fed381f09c8, create_info=0x7fed3c555510, table_list=0x7fed38304cf0, alter_info=0x7fed3c555450, order_num=0, order=0x0, ignore=false) at /home/travis/src/sql/sql_table.cc:9690 #16 0x000055df7fa6c662 in Sql_cmd_alter_table::execute (this=0x7fed38305450, thd=0x7fed381ebf40) at /home/travis/src/sql/sql_alter.cc:497 #17 0x000055df7f90bbbd in mysql_execute_command (thd=0x7fed381ebf40) at /home/travis/src/sql/sql_parse.cc:6289 #18 0x000055df7f910dae in mysql_parse (thd=0x7fed381ebf40, rawbuf=0x7fed38304ae8 "ALTER TABLE `table100_int_autoinc` ADD COLUMN IF NOT EXISTS tscol6 TIMESTAMP NULL, ALGORITHM=INPLACE /* QNO 1273 CON_ID 19 */", length=126, parser_state=0x7fed3c556650, is_com_multi=false, is_next_command=false) at /home/travis/src/sql/sql_parse.cc:8091 #19 0x000055df7f8fdd7d in dispatch_command (command=COM_QUERY, thd=0x7fed381ebf40, packet=0x7fed381dbf11 "ALTER TABLE `table100_int_autoinc` ADD COLUMN IF NOT EXISTS tscol6 TIMESTAMP NULL, ALGORITHM=INPLACE /* QNO 1273 CON_ID 19 */ ", packet_length=127, is_com_multi=false, is_next_command=false) at /home/travis/src/sql/sql_parse.cc:1851 #20 0x000055df7f8fc79a in do_command (thd=0x7fed381ebf40) at /home/travis/src/sql/sql_parse.cc:1396 #21 0x000055df7fa668de in do_handle_one_connection (connect=0x55df82688780) at /home/travis/src/sql/sql_connect.cc:1402 #22 0x000055df7fa6662f in handle_one_connection (arg=0x55df82688780) at /home/travis/src/sql/sql_connect.cc:1308 #23 0x00007fed413cc6ba in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 #24 0x00007fed4086141d in clone () from /lib/x86_64-linux-gnu/libc.so.6 https://travis-ci.org/elenst/travis-tests/jobs/458432454 Not reproducible locally so far, but I have the datadir from the above. The server crashes with a different assertion failure when I try to start it on this datadir: 10.4 46a411088c mysqld: /data/src/10.4/storage/innobase/include/rem0rec.h:774: bool rec_is_metadata(const rec_t*, const dict_index_t&): Assertion `!is || index.is_instant()' failed. 181122 19:10:56 [ERROR] mysqld got signal 6 ;   #7 0x00007f9465288ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000055aaa6353dd3 in rec_is_metadata (rec=0x7f944048ddb6 "", index=...) at /data/src/10.4/storage/innobase/include/rem0rec.h:774 #9 0x000055aaa63e67c2 in page_cur_search_with_match_bytes (block=0x7f943fa45fe8, index=0x7f9404016eb8, tuple=0x7f941c022a10, mode=PAGE_CUR_LE, iup_matched_fields=0x7f9423ffcda8, iup_matched_bytes=0x7f9423ffcdb0, ilow_matched_fields=0x7f9423ffcdb8, ilow_matched_bytes=0x7f9423ffcdc0, cursor=0x55aaaa0326f0) at /data/src/10.4/storage/innobase/page/page0cur.cc:737 #10 0x000055aaa655d3e0 in btr_cur_search_to_nth_level_func (index=0x7f9404016eb8, level=0, tuple=0x7f941c022a10, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x55aaaa0326e8, ahi_latch=0x0, file=0x55aaa6b01be8 "/data/src/10.4/storage/innobase/row/row0row.cc", line=1219, mtr=0x7f9423ffe240, autoinc=0) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:1899 #11 0x000055aaa6495e08 in btr_pcur_open_low (index=0x7f9404016eb8, level=0, tuple=0x7f941c022a10, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x55aaaa0326e8, file=0x55aaa6b01be8 "/data/src/10.4/storage/innobase/row/row0row.cc", line=1219, autoinc=0, mtr=0x7f9423ffe240) at /data/src/10.4/storage/innobase/include/btr0pcur.ic:464 #12 0x000055aaa6498fe3 in row_search_on_row_ref (pcur=0x55aaaa0326e8, mode=2, table=0x7f94040158d8, ref=0x7f941c022a10, mtr=0x7f9423ffe240) at /data/src/10.4/storage/innobase/row/row0row.cc:1219 #13 0x000055aaa648d520 in row_purge_reposition_pcur (mode=2, node=0x55aaaa032650, mtr=0x7f9423ffe240) at /data/src/10.4/storage/innobase/row/row0purge.cc:104 #14 0x000055aaa648d6f7 in row_purge_remove_clust_if_poss_low (node=0x55aaaa032650, mode=2) at /data/src/10.4/storage/innobase/row/row0purge.cc:148 #15 0x000055aaa648da5b in row_purge_remove_clust_if_poss (node=0x55aaaa032650) at /data/src/10.4/storage/innobase/row/row0purge.cc:216 #16 0x000055aaa648f2c7 in row_purge_del_mark (node=0x55aaaa032650) at /data/src/10.4/storage/innobase/row/row0purge.cc:806 #17 0x000055aaa6490851 in row_purge_record_func (node=0x55aaaa032650, undo_rec=0x7f941c018a98 "", thr=0x55aaaa032598, updated_extern=false) at /data/src/10.4/storage/innobase/row/row0purge.cc:1191 #18 0x000055aaa6490b8e in row_purge (node=0x55aaaa032650, undo_rec=0x7f941c018a98 "", thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/row/row0purge.cc:1258 #19 0x000055aaa6490f3c in row_purge_step (thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/row/row0purge.cc:1344 #20 0x000055aaa64136e0 in que_thr_step (thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/que/que0que.cc:1042 #21 0x000055aaa6413913 in que_run_threads_low (thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/que/que0que.cc:1104 #22 0x000055aaa6413b04 in que_run_threads (thr=0x55aaaa032598) at /data/src/10.4/storage/innobase/que/que0que.cc:1144 #23 0x000055aaa64faae3 in trx_purge (n_purge_threads=4, truncate=false) at /data/src/10.4/storage/innobase/trx/trx0purge.cc:1328 #24 0x000055aaa64d0711 in srv_do_purge (n_total_purged=0x7f9423ffeed0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2589 #25 0x000055aaa64d0b3a in srv_purge_coordinator_thread (arg=0x0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2712 #26 0x00007f9466d44494 in start_thread (arg=0x7f9423fff700) at pthread_create.c:333 #27 0x00007f946534593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            elenst Elena Stepanova added a comment - - edited

            Non-deterministic test case for

            void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_core_fields == n_core_fields'
            

            Run with --repeat=N. It usually fails for me within 20 attempts, but it can vary on different machines and builds.

            --source include/have_innodb.inc
             
            --connect (con1,localhost,root,,test)
            CREATE TABLE t1 (f1 INT, f2 INT, f3 VARCHAR(3)) ENGINE=InnoDB;
            INSERT INTO t1 (f1,f2,f3) VALUES (1,1,'foo'),(2,2,'bar'),(3,3,'foo'),(4,4,'bar');
             
            ALTER TABLE t1 ADD FULLTEXT KEY ftidx(f3);
            ALTER TABLE t1 DROP KEY ftidx;
            ALTER TABLE t1 DROP COLUMN f1;
            ALTER TABLE t1 ADD COLUMN f4 INT;
            ALTER TABLE t1 CHANGE COLUMN f4 f1 INT;
             
            --send
              DELETE FROM t1;
             
            --connection default
            ALTER TABLE t1 DROP COLUMN f2;
             
            # Cleanup
            --connection con1
            --reap
            --disconnect con1
            --connection default
            DROP TABLE t1;
            

            10.4 46a411088c

            mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:338: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_core_fields == n_core_fields' failed.
            181123  4:15:16 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007f1301abcee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000055afe5c5341b in dict_index_t::instant_add_field (this=0x7f12a361d7c8, instant=...) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:338
            #9  0x000055afe5c547fa in dict_table_t::instant_column (this=0x7f12a00fc938, table=..., col_map=0x7f12ac070898) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:487
            #10 0x000055afe5c3dca6 in innobase_instant_try (ha_alter_info=0x7f12fc060bb0, ctx=0x7f12ac0163a0, altered_table=0x7f12ac06eb80, table=0x7f12ac1a4fc0, trx=0x7f12fc0fc318) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5294
            #11 0x000055afe5c59497 in commit_try_norebuild (ha_alter_info=0x7f12fc060bb0, ctx=0x7f12ac0163a0, altered_table=0x7f12ac06eb80, old_table=0x7f12ac1a4fc0, trx=0x7f12fc0fc318, table_name=0x7f12a00ef49d "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:9949
            #12 0x000055afe5c4ca48 in ha_innobase::commit_inplace_alter_table (this=0x7f12ac06c408, altered_table=0x7f12ac06eb80, ha_alter_info=0x7f12fc060bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10578
            #13 0x000055afe58e7a78 in handler::ha_commit_inplace_alter_table (this=0x7f12ac06c408, altered_table=0x7f12ac06eb80, ha_alter_info=0x7f12fc060bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457
            #14 0x000055afe56b1918 in mysql_inplace_alter_table (thd=0x7f12ac000b00, table_list=0x7f12ac014fa8, table=0x7f12ac1a4fc0, altered_table=0x7f12ac06eb80, ha_alter_info=0x7f12fc060bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f12fc060ce0, alter_ctx=0x7f12fc0618d0) at /data/src/10.4/sql/sql_table.cc:7599
            #15 0x000055afe56b7733 in mysql_alter_table (thd=0x7f12ac000b00, new_db=0x7f12ac0051b8, new_name=0x7f12ac005588, create_info=0x7f12fc0624c0, table_list=0x7f12ac014fa8, alter_info=0x7f12fc062400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692
            #16 0x000055afe57408bd in Sql_cmd_alter_table::execute (this=0x7f12ac015610, thd=0x7f12ac000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #17 0x000055afe55dfab4 in mysql_execute_command (thd=0x7f12ac000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #18 0x000055afe55e49d8 in mysql_parse (thd=0x7f12ac000b00, rawbuf=0x7f12ac014ec0 "ALTER TABLE t1 DROP COLUMN f2", length=29, parser_state=0x7f12fc063600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #19 0x000055afe55d1cd7 in dispatch_command (command=COM_QUERY, thd=0x7f12ac000b00, packet=0x7f12ac00b401 "ALTER TABLE t1 DROP COLUMN f2", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #20 0x000055afe55d06fb in do_command (thd=0x7f12ac000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #21 0x000055afe573ab3c in do_handle_one_connection (connect=0x55afe7ed25c0) at /data/src/10.4/sql/sql_connect.cc:1402
            #22 0x000055afe573a8c0 in handle_one_connection (arg=0x55afe7ed25c0) at /data/src/10.4/sql/sql_connect.cc:1308
            #23 0x000055afe5be80a1 in pfs_spawn_thread (arg=0x55afe7f57890) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #24 0x00007f1303578494 in start_thread (arg=0x7f12fc064700) at pthread_create.c:333
            #25 0x00007f1301b7993f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            Couldn't reproduce on 10.3.

            elenst Elena Stepanova added a comment - - edited Non-deterministic test case for void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_core_fields == n_core_fields' Run with --repeat=N . It usually fails for me within 20 attempts, but it can vary on different machines and builds. --source include/have_innodb.inc   --connect (con1,localhost,root,,test) CREATE TABLE t1 (f1 INT , f2 INT , f3 VARCHAR (3)) ENGINE=InnoDB; INSERT INTO t1 (f1,f2,f3) VALUES (1,1, 'foo' ),(2,2, 'bar' ),(3,3, 'foo' ),(4,4, 'bar' );   ALTER TABLE t1 ADD FULLTEXT KEY ftidx(f3); ALTER TABLE t1 DROP KEY ftidx; ALTER TABLE t1 DROP COLUMN f1; ALTER TABLE t1 ADD COLUMN f4 INT ; ALTER TABLE t1 CHANGE COLUMN f4 f1 INT ;   --send DELETE FROM t1;   --connection default ALTER TABLE t1 DROP COLUMN f2;   # Cleanup --connection con1 --reap --disconnect con1 --connection default DROP TABLE t1; 10.4 46a411088c mysqld: /data/src/10.4/storage/innobase/handler/handler0alter.cc:338: void dict_index_t::instant_add_field(const dict_index_t&): Assertion `instant.n_core_fields == n_core_fields' failed. 181123 4:15:16 [ERROR] mysqld got signal 6 ;   #7 0x00007f1301abcee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000055afe5c5341b in dict_index_t::instant_add_field (this=0x7f12a361d7c8, instant=...) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:338 #9 0x000055afe5c547fa in dict_table_t::instant_column (this=0x7f12a00fc938, table=..., col_map=0x7f12ac070898) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:487 #10 0x000055afe5c3dca6 in innobase_instant_try (ha_alter_info=0x7f12fc060bb0, ctx=0x7f12ac0163a0, altered_table=0x7f12ac06eb80, table=0x7f12ac1a4fc0, trx=0x7f12fc0fc318) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5294 #11 0x000055afe5c59497 in commit_try_norebuild (ha_alter_info=0x7f12fc060bb0, ctx=0x7f12ac0163a0, altered_table=0x7f12ac06eb80, old_table=0x7f12ac1a4fc0, trx=0x7f12fc0fc318, table_name=0x7f12a00ef49d "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:9949 #12 0x000055afe5c4ca48 in ha_innobase::commit_inplace_alter_table (this=0x7f12ac06c408, altered_table=0x7f12ac06eb80, ha_alter_info=0x7f12fc060bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10578 #13 0x000055afe58e7a78 in handler::ha_commit_inplace_alter_table (this=0x7f12ac06c408, altered_table=0x7f12ac06eb80, ha_alter_info=0x7f12fc060bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457 #14 0x000055afe56b1918 in mysql_inplace_alter_table (thd=0x7f12ac000b00, table_list=0x7f12ac014fa8, table=0x7f12ac1a4fc0, altered_table=0x7f12ac06eb80, ha_alter_info=0x7f12fc060bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7f12fc060ce0, alter_ctx=0x7f12fc0618d0) at /data/src/10.4/sql/sql_table.cc:7599 #15 0x000055afe56b7733 in mysql_alter_table (thd=0x7f12ac000b00, new_db=0x7f12ac0051b8, new_name=0x7f12ac005588, create_info=0x7f12fc0624c0, table_list=0x7f12ac014fa8, alter_info=0x7f12fc062400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692 #16 0x000055afe57408bd in Sql_cmd_alter_table::execute (this=0x7f12ac015610, thd=0x7f12ac000b00) at /data/src/10.4/sql/sql_alter.cc:497 #17 0x000055afe55dfab4 in mysql_execute_command (thd=0x7f12ac000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #18 0x000055afe55e49d8 in mysql_parse (thd=0x7f12ac000b00, rawbuf=0x7f12ac014ec0 "ALTER TABLE t1 DROP COLUMN f2", length=29, parser_state=0x7f12fc063600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #19 0x000055afe55d1cd7 in dispatch_command (command=COM_QUERY, thd=0x7f12ac000b00, packet=0x7f12ac00b401 "ALTER TABLE t1 DROP COLUMN f2", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #20 0x000055afe55d06fb in do_command (thd=0x7f12ac000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #21 0x000055afe573ab3c in do_handle_one_connection (connect=0x55afe7ed25c0) at /data/src/10.4/sql/sql_connect.cc:1402 #22 0x000055afe573a8c0 in handle_one_connection (arg=0x55afe7ed25c0) at /data/src/10.4/sql/sql_connect.cc:1308 #23 0x000055afe5be80a1 in pfs_spawn_thread (arg=0x55afe7f57890) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #24 0x00007f1303578494 in start_thread (arg=0x7f12fc064700) at pthread_create.c:333 #25 0x00007f1301b7993f in clone () from /lib/x86_64-linux-gnu/libc.so.6 Couldn't reproduce on 10.3.

            This is a tricky test case. First, the creation of FULLTEXT INDEX will cause a hidden FTS_DOC_ID column to be created. This will actually cause the DROP COLUMN f1 to rebuild the table. Here is a simpler and equivalent test case, which uses a single connection, and also minimizes the columns and rows. It is still not deterministic:

            --source include/have_innodb.inc
            CREATE TABLE t1 (f2 INT) ENGINE=InnoDB;
            INSERT INTO t1 SET f2=1;
            ALTER TABLE t1 ADD COLUMN f1 INT;
            DELETE FROM t1;
            ALTER TABLE t1 DROP f2;
            DROP TABLE t1;
            

            During the execution of DROP f2, the table was emptied (due to the purge of the preceding DELETE) and converted to the canonical format.
            In the 10.3 version, two assertions in dict_index_t::instant_add_field() are more relaxed than in 10.4:

            	DBUG_ASSERT(instant.n_core_fields >= n_core_fields);
            	DBUG_ASSERT(instant.n_core_null_bytes >= n_core_null_bytes);
            

            In 10.3, these two assertions were already part of MDEV-11369.
            The 10.4 version uses == instead of >=. But, the problem is that in this case, we have instant.n_core_fields < n_core_fields, because purge executed in the middle of the ALTER TABLE execution, after instant was created.
            I will have to study the code carefully to see what else might have to be adjusted. With the assertions replaced, the test does not fail.

            Here is a variant of the test that should be compatible with MDEV-11369 in 10.3:

            --source include/have_innodb.inc
            CREATE TABLE t1 (f2 INT) ENGINE=InnoDB;
            INSERT INTO t1 SET f2=1;
            ALTER TABLE t1 ADD COLUMN f1 INT;
            DELETE FROM t1;
            ALTER TABLE t1 ADD COLUMN f3 INT;
            DROP TABLE t1;
            

            It does not crash in 10.3 nor in 10.4.

            marko Marko Mäkelä added a comment - This is a tricky test case. First, the creation of FULLTEXT INDEX will cause a hidden FTS_DOC_ID column to be created. This will actually cause the DROP COLUMN f1 to rebuild the table. Here is a simpler and equivalent test case, which uses a single connection, and also minimizes the columns and rows. It is still not deterministic: --source include/have_innodb.inc CREATE TABLE t1 (f2 INT ) ENGINE=InnoDB; INSERT INTO t1 SET f2=1; ALTER TABLE t1 ADD COLUMN f1 INT ; DELETE FROM t1; ALTER TABLE t1 DROP f2; DROP TABLE t1; During the execution of DROP f2 , the table was emptied (due to the purge of the preceding DELETE ) and converted to the canonical format. In the 10.3 version, two assertions in dict_index_t::instant_add_field() are more relaxed than in 10.4: DBUG_ASSERT(instant.n_core_fields >= n_core_fields); DBUG_ASSERT(instant.n_core_null_bytes >= n_core_null_bytes); In 10.3, these two assertions were already part of MDEV-11369 . The 10.4 version uses == instead of >= . But, the problem is that in this case, we have instant.n_core_fields < n_core_fields , because purge executed in the middle of the ALTER TABLE execution, after instant was created. I will have to study the code carefully to see what else might have to be adjusted. With the assertions replaced, the test does not fail. Here is a variant of the test that should be compatible with MDEV-11369 in 10.3: --source include/have_innodb.inc CREATE TABLE t1 (f2 INT ) ENGINE=InnoDB; INSERT INTO t1 SET f2=1; ALTER TABLE t1 ADD COLUMN f1 INT ; DELETE FROM t1; ALTER TABLE t1 ADD COLUMN f3 INT ; DROP TABLE t1; It does not crash in 10.3 nor in 10.4.

            I created a deterministic test that crashes also with ADD COLUMN f3 instead of DROP f2:

            --source include/have_innodb.inc
            --source include/have_debug.inc
            --source include/have_debug_sync.inc
             
            SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
            SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
             
            CREATE TABLE t1 (f2 INT) ENGINE=InnoDB;
            INSERT INTO t1 SET f2=1;
            ALTER TABLE t1 ADD COLUMN f1 INT;
             
            connect (purge_control,localhost,root);
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
             
            connection default;
            DELETE FROM t1;
             
            SET DEBUG_SYNC='innodb_commit_inplace_alter_table_enter SIGNAL go WAIT_FOR do';
            send ALTER TABLE t1 ADD COLUMN f3 INT;
             
            connection purge_control;
            SET DEBUG_SYNC='now WAIT_FOR go';
            COMMIT;
            --source include/wait_all_purged.inc
            SET DEBUG_SYNC='now SIGNAL do';
            disconnect purge_control;
             
            connection default;
            reap;
            SET DEBUG_SYNC=RESET;
            DROP TABLE t1;
            SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
            

            Again, no crash in 10.3.

            marko Marko Mäkelä added a comment - I created a deterministic test that crashes also with ADD COLUMN f3 instead of DROP f2 : --source include/have_innodb.inc --source include/have_debug.inc --source include/have_debug_sync.inc   SET @saved_frequency = @@ GLOBAL .innodb_purge_rseg_truncate_frequency; SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;   CREATE TABLE t1 (f2 INT ) ENGINE=InnoDB; INSERT INTO t1 SET f2=1; ALTER TABLE t1 ADD COLUMN f1 INT ;   connect (purge_control,localhost,root); START TRANSACTION WITH CONSISTENT SNAPSHOT;   connection default ; DELETE FROM t1;   SET DEBUG_SYNC= 'innodb_commit_inplace_alter_table_enter SIGNAL go WAIT_FOR do' ; send ALTER TABLE t1 ADD COLUMN f3 INT ;   connection purge_control; SET DEBUG_SYNC= 'now WAIT_FOR go' ; COMMIT ; --source include/wait_all_purged.inc SET DEBUG_SYNC= 'now SIGNAL do' ; disconnect purge_control;   connection default ; reap; SET DEBUG_SYNC=RESET; DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; Again, no crash in 10.3.

            I filed MDEV-17813 for the instant.n_core_fields == n_core_fields assertion failure.

            marko Marko Mäkelä added a comment - I filed MDEV-17813 for the instant.n_core_fields == n_core_fields assertion failure.

            Note: I'm not sure whether it's related, so I filed it separately as MDEV-17820. It has a test case.

            10.4 27f3329ff6

            mysqld: /data/src/10.4/storage/innobase/btr/btr0cur.cc:3743: dberr_t btr_cur_pessimistic_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, dtuple_t*, rec_t**, big_rec_t**, ulint, que_thr_t*, mtr_t*): Assertion `(flags & ulint(~BTR_KEEP_IBUF_BITMAP)) == BTR_NO_LOCKING_FLAG' failed.
            181123 21:44:54 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007ff877ebaee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x0000558da6e53ae4 in btr_cur_pessimistic_insert (flags=7, cursor=0x7ff8711fbde0, offsets=0x7ff8711fbd00, heap=0x7ff8711fbd08, entry=0x7ff82805adf8, rec=0x7ff8711fbbc0, big_rec=0x7ff8711fbbb8, n_ext=2, thr=0x0, mtr=0x7ff8711fbf00) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:3742
            #9  0x0000558da6e57fe2 in btr_cur_pessimistic_update (flags=10, cursor=0x7ff8711fbde0, offsets=0x7ff8711fbd00, offsets_heap=0x7ff8711fbd08, entry_heap=0x7ff828057ce0, big_rec=0x7ff8711fbd10, update=0x7ff82805a8e8, cmpl_info=1, thr=0x7ff82805a830, trx_id=46, mtr=0x7ff8711fbf00) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:5057
            #10 0x0000558da6c32529 in innobase_instant_try (ha_alter_info=0x7ff8711fdbb0, ctx=0x7ff828017218, altered_table=0x7ff8280555a0, table=0x7ff8280a7410, trx=0x7ff871cf8218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5586
            #11 0x0000558da6c4cfcb in commit_try_norebuild (ha_alter_info=0x7ff8711fdbb0, ctx=0x7ff828017218, altered_table=0x7ff8280555a0, old_table=0x7ff8280a7410, trx=0x7ff871cf8218, table_name=0x7ff82812cded "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10013
            #12 0x0000558da6c3fd02 in ha_innobase::commit_inplace_alter_table (this=0x7ff8280a8048, altered_table=0x7ff8280555a0, ha_alter_info=0x7ff8711fdbb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10642
            #13 0x0000558da68daa78 in handler::ha_commit_inplace_alter_table (this=0x7ff8280a8048, altered_table=0x7ff8280555a0, ha_alter_info=0x7ff8711fdbb0, commit=true) at /data/src/10.4/sql/handler.cc:4457
            #14 0x0000558da66a4918 in mysql_inplace_alter_table (thd=0x7ff828000b00, table_list=0x7ff828014e80, table=0x7ff8280a7410, altered_table=0x7ff8280555a0, ha_alter_info=0x7ff8711fdbb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7ff8711fdce0, alter_ctx=0x7ff8711fe8d0) at /data/src/10.4/sql/sql_table.cc:7599
            #15 0x0000558da66aa733 in mysql_alter_table (thd=0x7ff828000b00, new_db=0x7ff8280051b8, new_name=0x7ff828005588, create_info=0x7ff8711ff4c0, table_list=0x7ff828014e80, alter_info=0x7ff8711ff400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692
            #16 0x0000558da67338bd in Sql_cmd_alter_table::execute (this=0x7ff8280154e8, thd=0x7ff828000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #17 0x0000558da65d2ab4 in mysql_execute_command (thd=0x7ff828000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #18 0x0000558da65d79d8 in mysql_parse (thd=0x7ff828000b00, rawbuf=0x7ff828014d98 "ALTER TABLE t1 DROP COLUMN x", length=28, parser_state=0x7ff871200600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #19 0x0000558da65c4cd7 in dispatch_command (command=COM_QUERY, thd=0x7ff828000b00, packet=0x7ff828093db1 "ALTER TABLE t1 DROP COLUMN x", packet_length=28, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #20 0x0000558da65c36fb in do_command (thd=0x7ff828000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #21 0x0000558da672db3c in do_handle_one_connection (connect=0x558da9d5c5c0) at /data/src/10.4/sql/sql_connect.cc:1402
            #22 0x0000558da672d8c0 in handle_one_connection (arg=0x558da9d5c5c0) at /data/src/10.4/sql/sql_connect.cc:1308
            #23 0x0000558da6bdb0a1 in pfs_spawn_thread (arg=0x558da9de1890) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #24 0x00007ff879976494 in start_thread (arg=0x7ff871201700) at pthread_create.c:333
            #25 0x00007ff877f7793f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            elenst Elena Stepanova added a comment - Note: I'm not sure whether it's related, so I filed it separately as MDEV-17820 . It has a test case. 10.4 27f3329ff6 mysqld: /data/src/10.4/storage/innobase/btr/btr0cur.cc:3743: dberr_t btr_cur_pessimistic_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, dtuple_t*, rec_t**, big_rec_t**, ulint, que_thr_t*, mtr_t*): Assertion `(flags & ulint(~BTR_KEEP_IBUF_BITMAP)) == BTR_NO_LOCKING_FLAG' failed. 181123 21:44:54 [ERROR] mysqld got signal 6 ; #7 0x00007ff877ebaee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x0000558da6e53ae4 in btr_cur_pessimistic_insert (flags=7, cursor=0x7ff8711fbde0, offsets=0x7ff8711fbd00, heap=0x7ff8711fbd08, entry=0x7ff82805adf8, rec=0x7ff8711fbbc0, big_rec=0x7ff8711fbbb8, n_ext=2, thr=0x0, mtr=0x7ff8711fbf00) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:3742 #9 0x0000558da6e57fe2 in btr_cur_pessimistic_update (flags=10, cursor=0x7ff8711fbde0, offsets=0x7ff8711fbd00, offsets_heap=0x7ff8711fbd08, entry_heap=0x7ff828057ce0, big_rec=0x7ff8711fbd10, update=0x7ff82805a8e8, cmpl_info=1, thr=0x7ff82805a830, trx_id=46, mtr=0x7ff8711fbf00) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:5057 #10 0x0000558da6c32529 in innobase_instant_try (ha_alter_info=0x7ff8711fdbb0, ctx=0x7ff828017218, altered_table=0x7ff8280555a0, table=0x7ff8280a7410, trx=0x7ff871cf8218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5586 #11 0x0000558da6c4cfcb in commit_try_norebuild (ha_alter_info=0x7ff8711fdbb0, ctx=0x7ff828017218, altered_table=0x7ff8280555a0, old_table=0x7ff8280a7410, trx=0x7ff871cf8218, table_name=0x7ff82812cded "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10013 #12 0x0000558da6c3fd02 in ha_innobase::commit_inplace_alter_table (this=0x7ff8280a8048, altered_table=0x7ff8280555a0, ha_alter_info=0x7ff8711fdbb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10642 #13 0x0000558da68daa78 in handler::ha_commit_inplace_alter_table (this=0x7ff8280a8048, altered_table=0x7ff8280555a0, ha_alter_info=0x7ff8711fdbb0, commit=true) at /data/src/10.4/sql/handler.cc:4457 #14 0x0000558da66a4918 in mysql_inplace_alter_table (thd=0x7ff828000b00, table_list=0x7ff828014e80, table=0x7ff8280a7410, altered_table=0x7ff8280555a0, ha_alter_info=0x7ff8711fdbb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7ff8711fdce0, alter_ctx=0x7ff8711fe8d0) at /data/src/10.4/sql/sql_table.cc:7599 #15 0x0000558da66aa733 in mysql_alter_table (thd=0x7ff828000b00, new_db=0x7ff8280051b8, new_name=0x7ff828005588, create_info=0x7ff8711ff4c0, table_list=0x7ff828014e80, alter_info=0x7ff8711ff400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692 #16 0x0000558da67338bd in Sql_cmd_alter_table::execute (this=0x7ff8280154e8, thd=0x7ff828000b00) at /data/src/10.4/sql/sql_alter.cc:497 #17 0x0000558da65d2ab4 in mysql_execute_command (thd=0x7ff828000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #18 0x0000558da65d79d8 in mysql_parse (thd=0x7ff828000b00, rawbuf=0x7ff828014d98 "ALTER TABLE t1 DROP COLUMN x", length=28, parser_state=0x7ff871200600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #19 0x0000558da65c4cd7 in dispatch_command (command=COM_QUERY, thd=0x7ff828000b00, packet=0x7ff828093db1 "ALTER TABLE t1 DROP COLUMN x", packet_length=28, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #20 0x0000558da65c36fb in do_command (thd=0x7ff828000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #21 0x0000558da672db3c in do_handle_one_connection (connect=0x558da9d5c5c0) at /data/src/10.4/sql/sql_connect.cc:1402 #22 0x0000558da672d8c0 in handle_one_connection (arg=0x558da9d5c5c0) at /data/src/10.4/sql/sql_connect.cc:1308 #23 0x0000558da6bdb0a1 in pfs_spawn_thread (arg=0x558da9de1890) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #24 0x00007ff879976494 in start_thread (arg=0x7ff871201700) at pthread_create.c:333 #25 0x00007ff877f7793f in clone () from /lib/x86_64-linux-gnu/libc.so.6

            This one is filed as MDEV-17763, with a test case.

            10.4 27f3329ff6

            mysqld: /data/src/10.4/storage/innobase/rem/rem0rec.cc:1607: void rec_convert_dtuple_to_rec_comp(rec_t*, const dict_index_t*, const dfield_t*, ulint, rec_comp_status_t, bool) [with bool mblob = true; rec_t = unsigned char; ulint = long unsigned int]: Assertion `len == 20U' failed.
            181125 16:44:43 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007fa526be5ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000055f458e11551 in rec_convert_dtuple_to_rec_comp<true> (rec=0x7fa4d81deb7f "\200", index=0x7fa4d81db328, field=0x7fa4d81e0048, n_fields=13, status=REC_STATUS_INSTANT, temp=false) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1607
            #9  0x000055f458e0ae42 in rec_convert_dtuple_to_rec_new (buf=0x7fa4d81deb7f "\200", index=0x7fa4d81db328, dtuple=0x7fa4d81dffb8) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1722
            #10 0x000055f458e0b0a5 in rec_convert_dtuple_to_rec (buf=0x7fa4d81deb78 "", index=0x7fa4d81db328, dtuple=0x7fa4d81dffb8, n_ext=0) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1766
            #11 0x000055f458f20610 in page_cur_tuple_insert (cursor=0x7fa520126358, tuple=0x7fa4d81dffb8, index=0x7fa4d81db328, offsets=0x7fa5201262e8, heap=0x7fa5201262e0, n_ext=0, mtr=0x7fa520126770) at /data/src/10.4/storage/innobase/include/page0cur.ic:278
            #12 0x000055f458f2a416 in btr_page_split_and_insert (flags=2, cursor=0x7fa520126350, offsets=0x7fa5201262e8, heap=0x7fa5201262e0, tuple=0x7fa4d81dffb8, n_ext=0, mtr=0x7fa520126770) at /data/src/10.4/storage/innobase/btr/btr0btr.cc:3284
            #13 0x000055f458f4d7b7 in btr_cur_pessimistic_insert (flags=2, cursor=0x7fa520126350, offsets=0x7fa5201262e8, heap=0x7fa5201262e0, entry=0x7fa4d81dffb8, rec=0x7fa5201262f0, big_rec=0x7fa5201262d8, n_ext=0, thr=0x7fa4d81e0210, mtr=0x7fa520126770) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:3695
            #14 0x000055f458e34f95 in row_ins_clust_index_entry_low (flags=2, mode=33, index=0x7fa4d81db328, n_uniq=1, entry=0x7fa4d81dffb8, n_ext=0, thr=0x7fa4d81e0210, dup_chk_only=false) at /data/src/10.4/storage/innobase/row/row0ins.cc:2767
            #15 0x000055f458d2c8be in innobase_instant_try (ha_alter_info=0x7fa520128bb0, ctx=0x7fa4d8017228, altered_table=0x7fa4d807efb0, table=0x7fa4d81d5a50, trx=0x7fa520a23218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5647
            #16 0x000055f458d46fcb in commit_try_norebuild (ha_alter_info=0x7fa520128bb0, ctx=0x7fa4d8017228, altered_table=0x7fa4d807efb0, old_table=0x7fa4d81d5a50, trx=0x7fa520a23218, table_name=0x7fa4d81bf89d "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10013
            #17 0x000055f458d39d02 in ha_innobase::commit_inplace_alter_table (this=0x7fa4d80490e8, altered_table=0x7fa4d807efb0, ha_alter_info=0x7fa520128bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10642
            #18 0x000055f4589d4a78 in handler::ha_commit_inplace_alter_table (this=0x7fa4d80490e8, altered_table=0x7fa4d807efb0, ha_alter_info=0x7fa520128bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457
            #19 0x000055f45879e918 in mysql_inplace_alter_table (thd=0x7fa4d8000b00, table_list=0x7fa4d8014e80, table=0x7fa4d81d5a50, altered_table=0x7fa4d807efb0, ha_alter_info=0x7fa520128bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fa520128ce0, alter_ctx=0x7fa5201298d0) at /data/src/10.4/sql/sql_table.cc:7599
            #20 0x000055f4587a4733 in mysql_alter_table (thd=0x7fa4d8000b00, new_db=0x7fa4d80051b8, new_name=0x7fa4d8005588, create_info=0x7fa52012a4c0, table_list=0x7fa4d8014e80, alter_info=0x7fa52012a400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692
            #21 0x000055f45882d8bd in Sql_cmd_alter_table::execute (this=0x7fa4d80154e8, thd=0x7fa4d8000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #22 0x000055f4586ccab4 in mysql_execute_command (thd=0x7fa4d8000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #23 0x000055f4586d19d8 in mysql_parse (thd=0x7fa4d8000b00, rawbuf=0x7fa4d8014d98 "ALTER TABLE t1 DROP COLUMN f1", length=29, parser_state=0x7fa52012b600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #24 0x000055f4586becd7 in dispatch_command (command=COM_QUERY, thd=0x7fa4d8000b00, packet=0x7fa4d8093db1 "ALTER TABLE t1 DROP COLUMN f1", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #25 0x000055f4586bd6fb in do_command (thd=0x7fa4d8000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #26 0x000055f458827b3c in do_handle_one_connection (connect=0x55f45cae1660) at /data/src/10.4/sql/sql_connect.cc:1402
            #27 0x000055f4588278c0 in handle_one_connection (arg=0x55f45cae1660) at /data/src/10.4/sql/sql_connect.cc:1308
            #28 0x000055f458cd50a1 in pfs_spawn_thread (arg=0x55f45cb66930) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #29 0x00007fa5286a1494 in start_thread (arg=0x7fa52012c700) at pthread_create.c:333
            #30 0x00007fa526ca293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            elenst Elena Stepanova added a comment - This one is filed as MDEV-17763 , with a test case. 10.4 27f3329ff6 mysqld: /data/src/10.4/storage/innobase/rem/rem0rec.cc:1607: void rec_convert_dtuple_to_rec_comp(rec_t*, const dict_index_t*, const dfield_t*, ulint, rec_comp_status_t, bool) [with bool mblob = true; rec_t = unsigned char; ulint = long unsigned int]: Assertion `len == 20U' failed. 181125 16:44:43 [ERROR] mysqld got signal 6 ; #7 0x00007fa526be5ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000055f458e11551 in rec_convert_dtuple_to_rec_comp<true> (rec=0x7fa4d81deb7f "\200", index=0x7fa4d81db328, field=0x7fa4d81e0048, n_fields=13, status=REC_STATUS_INSTANT, temp=false) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1607 #9 0x000055f458e0ae42 in rec_convert_dtuple_to_rec_new (buf=0x7fa4d81deb7f "\200", index=0x7fa4d81db328, dtuple=0x7fa4d81dffb8) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1722 #10 0x000055f458e0b0a5 in rec_convert_dtuple_to_rec (buf=0x7fa4d81deb78 "", index=0x7fa4d81db328, dtuple=0x7fa4d81dffb8, n_ext=0) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1766 #11 0x000055f458f20610 in page_cur_tuple_insert (cursor=0x7fa520126358, tuple=0x7fa4d81dffb8, index=0x7fa4d81db328, offsets=0x7fa5201262e8, heap=0x7fa5201262e0, n_ext=0, mtr=0x7fa520126770) at /data/src/10.4/storage/innobase/include/page0cur.ic:278 #12 0x000055f458f2a416 in btr_page_split_and_insert (flags=2, cursor=0x7fa520126350, offsets=0x7fa5201262e8, heap=0x7fa5201262e0, tuple=0x7fa4d81dffb8, n_ext=0, mtr=0x7fa520126770) at /data/src/10.4/storage/innobase/btr/btr0btr.cc:3284 #13 0x000055f458f4d7b7 in btr_cur_pessimistic_insert (flags=2, cursor=0x7fa520126350, offsets=0x7fa5201262e8, heap=0x7fa5201262e0, entry=0x7fa4d81dffb8, rec=0x7fa5201262f0, big_rec=0x7fa5201262d8, n_ext=0, thr=0x7fa4d81e0210, mtr=0x7fa520126770) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:3695 #14 0x000055f458e34f95 in row_ins_clust_index_entry_low (flags=2, mode=33, index=0x7fa4d81db328, n_uniq=1, entry=0x7fa4d81dffb8, n_ext=0, thr=0x7fa4d81e0210, dup_chk_only=false) at /data/src/10.4/storage/innobase/row/row0ins.cc:2767 #15 0x000055f458d2c8be in innobase_instant_try (ha_alter_info=0x7fa520128bb0, ctx=0x7fa4d8017228, altered_table=0x7fa4d807efb0, table=0x7fa4d81d5a50, trx=0x7fa520a23218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5647 #16 0x000055f458d46fcb in commit_try_norebuild (ha_alter_info=0x7fa520128bb0, ctx=0x7fa4d8017228, altered_table=0x7fa4d807efb0, old_table=0x7fa4d81d5a50, trx=0x7fa520a23218, table_name=0x7fa4d81bf89d "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10013 #17 0x000055f458d39d02 in ha_innobase::commit_inplace_alter_table (this=0x7fa4d80490e8, altered_table=0x7fa4d807efb0, ha_alter_info=0x7fa520128bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10642 #18 0x000055f4589d4a78 in handler::ha_commit_inplace_alter_table (this=0x7fa4d80490e8, altered_table=0x7fa4d807efb0, ha_alter_info=0x7fa520128bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457 #19 0x000055f45879e918 in mysql_inplace_alter_table (thd=0x7fa4d8000b00, table_list=0x7fa4d8014e80, table=0x7fa4d81d5a50, altered_table=0x7fa4d807efb0, ha_alter_info=0x7fa520128bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fa520128ce0, alter_ctx=0x7fa5201298d0) at /data/src/10.4/sql/sql_table.cc:7599 #20 0x000055f4587a4733 in mysql_alter_table (thd=0x7fa4d8000b00, new_db=0x7fa4d80051b8, new_name=0x7fa4d8005588, create_info=0x7fa52012a4c0, table_list=0x7fa4d8014e80, alter_info=0x7fa52012a400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692 #21 0x000055f45882d8bd in Sql_cmd_alter_table::execute (this=0x7fa4d80154e8, thd=0x7fa4d8000b00) at /data/src/10.4/sql/sql_alter.cc:497 #22 0x000055f4586ccab4 in mysql_execute_command (thd=0x7fa4d8000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #23 0x000055f4586d19d8 in mysql_parse (thd=0x7fa4d8000b00, rawbuf=0x7fa4d8014d98 "ALTER TABLE t1 DROP COLUMN f1", length=29, parser_state=0x7fa52012b600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #24 0x000055f4586becd7 in dispatch_command (command=COM_QUERY, thd=0x7fa4d8000b00, packet=0x7fa4d8093db1 "ALTER TABLE t1 DROP COLUMN f1", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #25 0x000055f4586bd6fb in do_command (thd=0x7fa4d8000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #26 0x000055f458827b3c in do_handle_one_connection (connect=0x55f45cae1660) at /data/src/10.4/sql/sql_connect.cc:1402 #27 0x000055f4588278c0 in handle_one_connection (arg=0x55f45cae1660) at /data/src/10.4/sql/sql_connect.cc:1308 #28 0x000055f458cd50a1 in pfs_spawn_thread (arg=0x55f45cb66930) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #29 0x00007fa5286a1494 in start_thread (arg=0x7fa52012c700) at pthread_create.c:333 #30 0x00007fa526ca293f in clone () from /lib/x86_64-linux-gnu/libc.so.6

            This one is filed as MDEV-17826, with a test case. Might be related to, or be the same as the previous one.

            10.4 27f3329ff6

            mysqld: /data/src/10.4/storage/innobase/rem/rem0rec.cc:1608: void rec_convert_dtuple_to_rec_comp(rec_t*, const dict_index_t*, const dfield_t*, ulint, rec_comp_status_t, bool) [with bool mblob = true; rec_t = unsigned char; ulint = long unsigned int]: Assertion `dfield_is_ext(field)' failed.
            181125 17:07:13 [ERROR] mysqld got signal 6 ;
             
            #7  0x00007fa051265ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8  0x000055841261d59c in rec_convert_dtuple_to_rec_comp<true> (rec=0x7f9ff805b9ff "\200", index=0x7f9ff8097888, field=0x7f9ff805ce60, n_fields=12, status=REC_STATUS_INSTANT, temp=false) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1608
            #9  0x0000558412616e42 in rec_convert_dtuple_to_rec_new (buf=0x7f9ff805b9ff "\200", index=0x7f9ff8097888, dtuple=0x7f9ff805cdd0) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1722
            #10 0x00005584126170a5 in rec_convert_dtuple_to_rec (buf=0x7f9ff805b9f8 "", index=0x7f9ff8097888, dtuple=0x7f9ff805cdd0, n_ext=0) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1766
            #11 0x000055841272c610 in page_cur_tuple_insert (cursor=0x7fa04655f358, tuple=0x7f9ff805cdd0, index=0x7f9ff8097888, offsets=0x7fa04655f2e8, heap=0x7fa04655f2e0, n_ext=0, mtr=0x7fa04655f770) at /data/src/10.4/storage/innobase/include/page0cur.ic:278
            #12 0x0000558412736416 in btr_page_split_and_insert (flags=2, cursor=0x7fa04655f350, offsets=0x7fa04655f2e8, heap=0x7fa04655f2e0, tuple=0x7f9ff805cdd0, n_ext=0, mtr=0x7fa04655f770) at /data/src/10.4/storage/innobase/btr/btr0btr.cc:3284
            #13 0x00005584127597b7 in btr_cur_pessimistic_insert (flags=2, cursor=0x7fa04655f350, offsets=0x7fa04655f2e8, heap=0x7fa04655f2e0, entry=0x7f9ff805cdd0, rec=0x7fa04655f2f0, big_rec=0x7fa04655f2d8, n_ext=0, thr=0x7f9ff805d010, mtr=0x7fa04655f770) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:3695
            #14 0x0000558412640f95 in row_ins_clust_index_entry_low (flags=2, mode=33, index=0x7f9ff8097888, n_uniq=1, entry=0x7f9ff805cdd0, n_ext=0, thr=0x7f9ff805d010, dup_chk_only=false) at /data/src/10.4/storage/innobase/row/row0ins.cc:2767
            #15 0x00005584125388be in innobase_instant_try (ha_alter_info=0x7fa046561bb0, ctx=0x7f9ff8017030, altered_table=0x7f9ff804f4e0, table=0x7f9ff812d030, trx=0x7fa04c049218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5647
            #16 0x0000558412552fcb in commit_try_norebuild (ha_alter_info=0x7fa046561bb0, ctx=0x7f9ff8017030, altered_table=0x7f9ff804f4e0, old_table=0x7f9ff812d030, trx=0x7fa04c049218, table_name=0x7f9ff81304cd "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10013
            #17 0x0000558412545d02 in ha_innobase::commit_inplace_alter_table (this=0x7f9ff80944e8, altered_table=0x7f9ff804f4e0, ha_alter_info=0x7fa046561bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10642
            #18 0x00005584121e0a78 in handler::ha_commit_inplace_alter_table (this=0x7f9ff80944e8, altered_table=0x7f9ff804f4e0, ha_alter_info=0x7fa046561bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457
            #19 0x0000558411faa918 in mysql_inplace_alter_table (thd=0x7f9ff8000b00, table_list=0x7f9ff8014e80, table=0x7f9ff812d030, altered_table=0x7f9ff804f4e0, ha_alter_info=0x7fa046561bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fa046561ce0, alter_ctx=0x7fa0465628d0) at /data/src/10.4/sql/sql_table.cc:7599
            #20 0x0000558411fb0733 in mysql_alter_table (thd=0x7f9ff8000b00, new_db=0x7f9ff80051b8, new_name=0x7f9ff8005588, create_info=0x7fa0465634c0, table_list=0x7f9ff8014e80, alter_info=0x7fa046563400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692
            #21 0x00005584120398bd in Sql_cmd_alter_table::execute (this=0x7f9ff80154e8, thd=0x7f9ff8000b00) at /data/src/10.4/sql/sql_alter.cc:497
            #22 0x0000558411ed8ab4 in mysql_execute_command (thd=0x7f9ff8000b00) at /data/src/10.4/sql/sql_parse.cc:6289
            #23 0x0000558411edd9d8 in mysql_parse (thd=0x7f9ff8000b00, rawbuf=0x7f9ff8014d98 "ALTER TABLE t1 DROP COLUMN f1", length=29, parser_state=0x7fa046564600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091
            #24 0x0000558411ecacd7 in dispatch_command (command=COM_QUERY, thd=0x7f9ff8000b00, packet=0x7f9ff800b401 "ALTER TABLE t1 DROP COLUMN f1", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
            #25 0x0000558411ec96fb in do_command (thd=0x7f9ff8000b00) at /data/src/10.4/sql/sql_parse.cc:1396
            #26 0x0000558412033b3c in do_handle_one_connection (connect=0x55841585f3e0) at /data/src/10.4/sql/sql_connect.cc:1402
            #27 0x00005584120338c0 in handle_one_connection (arg=0x55841585f3e0) at /data/src/10.4/sql/sql_connect.cc:1308
            #28 0x00005584124e10a1 in pfs_spawn_thread (arg=0x5584158e46b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
            #29 0x00007fa052d21494 in start_thread (arg=0x7fa046565700) at pthread_create.c:333
            #30 0x00007fa05132293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            

            elenst Elena Stepanova added a comment - This one is filed as MDEV-17826 , with a test case. Might be related to, or be the same as the previous one. 10.4 27f3329ff6 mysqld: /data/src/10.4/storage/innobase/rem/rem0rec.cc:1608: void rec_convert_dtuple_to_rec_comp(rec_t*, const dict_index_t*, const dfield_t*, ulint, rec_comp_status_t, bool) [with bool mblob = true; rec_t = unsigned char; ulint = long unsigned int]: Assertion `dfield_is_ext(field)' failed. 181125 17:07:13 [ERROR] mysqld got signal 6 ; #7 0x00007fa051265ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 #8 0x000055841261d59c in rec_convert_dtuple_to_rec_comp<true> (rec=0x7f9ff805b9ff "\200", index=0x7f9ff8097888, field=0x7f9ff805ce60, n_fields=12, status=REC_STATUS_INSTANT, temp=false) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1608 #9 0x0000558412616e42 in rec_convert_dtuple_to_rec_new (buf=0x7f9ff805b9ff "\200", index=0x7f9ff8097888, dtuple=0x7f9ff805cdd0) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1722 #10 0x00005584126170a5 in rec_convert_dtuple_to_rec (buf=0x7f9ff805b9f8 "", index=0x7f9ff8097888, dtuple=0x7f9ff805cdd0, n_ext=0) at /data/src/10.4/storage/innobase/rem/rem0rec.cc:1766 #11 0x000055841272c610 in page_cur_tuple_insert (cursor=0x7fa04655f358, tuple=0x7f9ff805cdd0, index=0x7f9ff8097888, offsets=0x7fa04655f2e8, heap=0x7fa04655f2e0, n_ext=0, mtr=0x7fa04655f770) at /data/src/10.4/storage/innobase/include/page0cur.ic:278 #12 0x0000558412736416 in btr_page_split_and_insert (flags=2, cursor=0x7fa04655f350, offsets=0x7fa04655f2e8, heap=0x7fa04655f2e0, tuple=0x7f9ff805cdd0, n_ext=0, mtr=0x7fa04655f770) at /data/src/10.4/storage/innobase/btr/btr0btr.cc:3284 #13 0x00005584127597b7 in btr_cur_pessimistic_insert (flags=2, cursor=0x7fa04655f350, offsets=0x7fa04655f2e8, heap=0x7fa04655f2e0, entry=0x7f9ff805cdd0, rec=0x7fa04655f2f0, big_rec=0x7fa04655f2d8, n_ext=0, thr=0x7f9ff805d010, mtr=0x7fa04655f770) at /data/src/10.4/storage/innobase/btr/btr0cur.cc:3695 #14 0x0000558412640f95 in row_ins_clust_index_entry_low (flags=2, mode=33, index=0x7f9ff8097888, n_uniq=1, entry=0x7f9ff805cdd0, n_ext=0, thr=0x7f9ff805d010, dup_chk_only=false) at /data/src/10.4/storage/innobase/row/row0ins.cc:2767 #15 0x00005584125388be in innobase_instant_try (ha_alter_info=0x7fa046561bb0, ctx=0x7f9ff8017030, altered_table=0x7f9ff804f4e0, table=0x7f9ff812d030, trx=0x7fa04c049218) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:5647 #16 0x0000558412552fcb in commit_try_norebuild (ha_alter_info=0x7fa046561bb0, ctx=0x7f9ff8017030, altered_table=0x7f9ff804f4e0, old_table=0x7f9ff812d030, trx=0x7fa04c049218, table_name=0x7f9ff81304cd "t1") at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10013 #17 0x0000558412545d02 in ha_innobase::commit_inplace_alter_table (this=0x7f9ff80944e8, altered_table=0x7f9ff804f4e0, ha_alter_info=0x7fa046561bb0, commit=true) at /data/src/10.4/storage/innobase/handler/handler0alter.cc:10642 #18 0x00005584121e0a78 in handler::ha_commit_inplace_alter_table (this=0x7f9ff80944e8, altered_table=0x7f9ff804f4e0, ha_alter_info=0x7fa046561bb0, commit=true) at /data/src/10.4/sql/handler.cc:4457 #19 0x0000558411faa918 in mysql_inplace_alter_table (thd=0x7f9ff8000b00, table_list=0x7f9ff8014e80, table=0x7f9ff812d030, altered_table=0x7f9ff804f4e0, ha_alter_info=0x7fa046561bb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fa046561ce0, alter_ctx=0x7fa0465628d0) at /data/src/10.4/sql/sql_table.cc:7599 #20 0x0000558411fb0733 in mysql_alter_table (thd=0x7f9ff8000b00, new_db=0x7f9ff80051b8, new_name=0x7f9ff8005588, create_info=0x7fa0465634c0, table_list=0x7f9ff8014e80, alter_info=0x7fa046563400, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9692 #21 0x00005584120398bd in Sql_cmd_alter_table::execute (this=0x7f9ff80154e8, thd=0x7f9ff8000b00) at /data/src/10.4/sql/sql_alter.cc:497 #22 0x0000558411ed8ab4 in mysql_execute_command (thd=0x7f9ff8000b00) at /data/src/10.4/sql/sql_parse.cc:6289 #23 0x0000558411edd9d8 in mysql_parse (thd=0x7f9ff8000b00, rawbuf=0x7f9ff8014d98 "ALTER TABLE t1 DROP COLUMN f1", length=29, parser_state=0x7fa046564600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8091 #24 0x0000558411ecacd7 in dispatch_command (command=COM_QUERY, thd=0x7f9ff8000b00, packet=0x7f9ff800b401 "ALTER TABLE t1 DROP COLUMN f1", packet_length=29, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851 #25 0x0000558411ec96fb in do_command (thd=0x7f9ff8000b00) at /data/src/10.4/sql/sql_parse.cc:1396 #26 0x0000558412033b3c in do_handle_one_connection (connect=0x55841585f3e0) at /data/src/10.4/sql/sql_connect.cc:1402 #27 0x00005584120338c0 in handle_one_connection (arg=0x55841585f3e0) at /data/src/10.4/sql/sql_connect.cc:1308 #28 0x00005584124e10a1 in pfs_spawn_thread (arg=0x5584158e46b0) at /data/src/10.4/storage/perfschema/pfs.cc:1862 #29 0x00007fa052d21494 in start_thread (arg=0x7fa046565700) at pthread_create.c:333 #30 0x00007fa05132293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            mleich Matthias Leich added a comment - - edited

            I have tried all MTR based tests (code shown above) against a
            10.4 301bd62b2536f85a8ce418dcd5e705796d8c5763 2019-01-10 compiled with debug
            and none of them failed.
            Result of 2h RQG testing (~570 regular finished runs) with table_stress.yy and threads = 12.
            13 asserts hit

            List of unique asserts
            mysqld: storage/innobase/rem/rem0rec.cc:1200: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool) [with bool mblob = false; ulint = long unsigned int]: Assertion `len <= field->col->len || ((field->col->mtype) == 5 || (field->col->mtype) == 14) || (field->col->len == 0 && field->col->mtype == 1)' failed.
            mysqld: storage/innobase/rem/rem0rec.cc:1229: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool) [with bool mblob = false; ulint = long unsigned int]: Assertion `field->col->is_dropped() || !field->col->mbmaxlen || len >= field->col->mbminlen * fixed_len / field->col->mbmaxlen' failed.
            mysqld: storage/innobase/row/row0log.cc:680: void row_log_table_delete(const rec_t*, dict_index_t*, const ulint*, const byte*): Assertion `new_index->n_uniq == index->n_uniq' failed.
            mysqld: storage/innobase/row/row0log.cc:2111: dberr_t row_log_table_apply_update(que_thr_t*, ulint, const mrec_t*, const ulint*, mem_heap_t*, mem_heap_t*, row_merge_dup_t*, const dtuple_t*): Assertion `log->blobs' failed.
            mysqld: storage/innobase/row/row0log.cc:2430: const mrec_t* row_log_table_apply_op(que_thr_t*, ulint, row_merge_dup_t*, dberr_t*, mem_heap_t*, mem_heap_t*, const mrec_t*, const mrec_t*, ulint*): Assertion `0' failed.
            mysqld: storage/innobase/row/row0log.cc:2511: const mrec_t* row_log_table_apply_op(que_thr_t*, ulint, row_merge_dup_t*, dberr_t*, mem_heap_t*, mem_heap_t*, const mrec_t*, const mrec_t*, ulint*): Assertion `new_index->n_uniq == dup->index->n_uniq' failed.
             
            RQG tests using conf/mariadb/instant_add.yy (often used in the asserts reported above)
            were stopped after 1h because all passed.
            

            mleich Matthias Leich added a comment - - edited I have tried all MTR based tests (code shown above) against a 10.4 301bd62b2536f85a8ce418dcd5e705796d8c5763 2019-01-10 compiled with debug and none of them failed. Result of 2h RQG testing (~570 regular finished runs) with table_stress.yy and threads = 12. 13 asserts hit List of unique asserts mysqld: storage/innobase/rem/rem0rec.cc:1200: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool) [with bool mblob = false; ulint = long unsigned int]: Assertion `len <= field->col->len || ((field->col->mtype) == 5 || (field->col->mtype) == 14) || (field->col->len == 0 && field->col->mtype == 1)' failed. mysqld: storage/innobase/rem/rem0rec.cc:1229: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool) [with bool mblob = false; ulint = long unsigned int]: Assertion `field->col->is_dropped() || !field->col->mbmaxlen || len >= field->col->mbminlen * fixed_len / field->col->mbmaxlen' failed. mysqld: storage/innobase/row/row0log.cc:680: void row_log_table_delete(const rec_t*, dict_index_t*, const ulint*, const byte*): Assertion `new_index->n_uniq == index->n_uniq' failed. mysqld: storage/innobase/row/row0log.cc:2111: dberr_t row_log_table_apply_update(que_thr_t*, ulint, const mrec_t*, const ulint*, mem_heap_t*, mem_heap_t*, row_merge_dup_t*, const dtuple_t*): Assertion `log->blobs' failed. mysqld: storage/innobase/row/row0log.cc:2430: const mrec_t* row_log_table_apply_op(que_thr_t*, ulint, row_merge_dup_t*, dberr_t*, mem_heap_t*, mem_heap_t*, const mrec_t*, const mrec_t*, ulint*): Assertion `0' failed. mysqld: storage/innobase/row/row0log.cc:2511: const mrec_t* row_log_table_apply_op(que_thr_t*, ulint, row_merge_dup_t*, dberr_t*, mem_heap_t*, mem_heap_t*, const mrec_t*, const mrec_t*, ulint*): Assertion `new_index->n_uniq == dup->index->n_uniq' failed.   RQG tests using conf/mariadb/instant_add.yy (often used in the asserts reported above) were stopped after 1h because all passed.

            new_index->n_uniq == index->n_uniq is apparently MDEV-17376
            The rest should probably be filed as separate bugs, and this one can be closed then.

            elenst Elena Stepanova added a comment - new_index->n_uniq == index->n_uniq is apparently MDEV-17376 The rest should probably be filed as separate bugs, and this one can be closed then.
            mleich Matthias Leich added a comment - - edited
            mleich Matthias Leich added a comment - - edited None of the asserts hit by my RQG runs on actual 10.4 were mentioned above. https://jira.mariadb.org/browse/MDEV-18165 https://jira.mariadb.org/browse/MDEV-17376 https://jira.mariadb.org/browse/MDEV-17644

            Now that the code is more stable (after various fixes), let us close this for now and file new bugs for new failures.

            marko Marko Mäkelä added a comment - Now that the code is more stable (after various fixes), let us close this for now and file new bugs for new failures.

            People

              marko Marko Mäkelä
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.