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

row0upd.ic:83: upd_field_t* upd_get_nth_field(const upd_t*, ulint): Assertion `n < update->n_fields' failed.

    XMLWordPrintable

Details

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

    Description

      The problem was found during RQG testing on MariaDB 10.4 30641f9df77be99d93524e39cdc2b2d783e6d3e1 2018-12-18
      compiled with debug.
      There was no replay of the assert on actual 10.2 and 10.3.
       
      ts_1.test
      --------------
      --source include/have_innodb.inc
      # --disable_abort_on_error
       
       CREATE TABLE t1 (col2 INT, col_int INTEGER) ENGINE = InnoDB ROW_FORMAT = Redundant  ;
       INSERT INTO t1 (col2, col_int) VALUES ( 1 , 1);
       ALTER TABLE t1 ADD UNIQUE INDEX IF NOT EXISTS `huhu1` ( col2 );
       ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS ( col_int ) ;
       
       ALTER TABLE t1 DROP PRIMARY KEY;
       ALTER TABLE t1 ADD UNIQUE INDEX IF NOT EXISTS `huhu2` ( col_int ) ;
       ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS ( col2 ) ;
       
       ALTER TABLE t1 ADD COLUMN IF NOT EXISTS col_int_copy INTEGER ;
      ALTER TABLE t1 CHANGE COLUMN col_int col_int INTEGER;
      --enable_abort_on_error
      SHOW PROCESSLIST;
       
      ....
      Version: '10.4.1-MariaDB-debug-log'  socket: 'bld_debug/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
      mysqld: storage/innobase/include/row0upd.ic:83: upd_field_t* upd_get_nth_field(const upd_t*, ulint): Assertion `n < update->n_fields' failed.
      181219 11:55:47 [ERROR] mysqld got signal 6 ;
      ...
      Query (0x7fd494014190): ALTER TABLE t1 CHANGE COLUMN col_int col_int INTEGER
      Connection ID (thread ID): 9
      Status: NOT_KILLED
      ...
      Thread 1 (Thread 0x7fd4e43e0700 (LWP 25811)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x0000564507e7eb94 in my_write_core (sig=6) at mysys/stacktrace.c:481
      #2  0x00005645076c4ca3 in handle_fatal_signal (sig=6) at sql/signal_handler.cc:305
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00007fd4ea85bf5d in __GI_abort () at abort.c:90
      #6  0x00007fd4ea851f17 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x56450823aa7c "n < update->n_fields", file=file@entry=0x56450823aa38 "storage/innobase/include/row0upd.ic", line=line@entry=83, function=function@entry=0x5645082418c0 <_ZZL17upd_get_nth_fieldPK5upd_tmE19__PRETTY_FUNCTION__> "upd_field_t* upd_get_nth_field(const upd_t*, ulint)") at assert.c:92
      #7  0x00007fd4ea851fc2 in __GI___assert_fail (assertion=0x56450823aa7c "n < update->n_fields", file=0x56450823aa38 "storage/innobase/include/row0upd.ic", line=83, function=0x5645082418c0 <_ZZL17upd_get_nth_fieldPK5upd_tmE19__PRETTY_FUNCTION__> "upd_field_t* upd_get_nth_field(const upd_t*, ulint)") at assert.c:101
      #8  0x0000564507b35cbb in upd_get_nth_field (update=0x7fd494070090, n=0) at storage/innobase/include/row0upd.ic:83
      #9  0x0000564507b431e8 in btr_cur_trim (entry=0x7fd494063430, index=0x7fd49406a958, update=0x7fd494070090, thr=0x7fd49406ffd8) at storage/innobase/btr/btr0cur.cc:4377
      #10 0x0000564507b43def in btr_cur_optimistic_update (flags=42, cursor=0x7fd4e43db090, offsets=0x7fd4e43dafb0, heap=0x7fd4e43dafb8, update=0x7fd494070090, cmpl_info=1, thr=0x7fd49406ffd8, trx_id=100, mtr=0x7fd4e43db1a0) at storage/innobase/btr/btr0cur.cc:4547
      #11 0x0000564507b44bde in btr_cur_pessimistic_update (flags=10, cursor=0x7fd4e43db090, offsets=0x7fd4e43dafb0, offsets_heap=0x7fd4e43dafb8, entry_heap=0x7fd49406a3c0, big_rec=0x7fd4e43dafc0, update=0x7fd494070090, cmpl_info=1, thr=0x7fd49406ffd8, trx_id=100, mtr=0x7fd4e43db1a0) at storage/innobase/btr/btr0cur.cc:4832
      #12 0x000056450791f382 in innobase_instant_try (ha_alter_info=0x7fd4e43dcbb0, ctx=0x7fd494015e28, altered_table=0x7fd49406e348, table=0x7fd49405c0e8, trx=0x7fd4e4677218) at storage/innobase/handler/handler0alter.cc:5618
      #13 0x0000564507939af9 in commit_try_norebuild (ha_alter_info=0x7fd4e43dcbb0, ctx=0x7fd494015e28, altered_table=0x7fd49406e348, old_table=0x7fd49405c0e8, trx=0x7fd4e4677218, table_name=0x7fd494069b95 "t1") at storage/innobase/handler/handler0alter.cc:10047
      #14 0x000056450792cc1d in ha_innobase::commit_inplace_alter_table (this=0x7fd494092400, altered_table=0x7fd49406e348, ha_alter_info=0x7fd4e43dcbb0, commit=true) at storage/innobase/handler/handler0alter.cc:10682
      #15 0x00005645076d104b in handler::ha_commit_inplace_alter_table (this=0x7fd494092400, altered_table=0x7fd49406e348, ha_alter_info=0x7fd4e43dcbb0, commit=true) at sql/handler.cc:4492
      #16 0x0000564507492448 in mysql_inplace_alter_table (thd=0x7fd494000ce8, table_list=0x7fd4940142a8, table=0x7fd49405c0e8, altered_table=0x7fd49406e348, ha_alter_info=0x7fd4e43dcbb0, inplace_supported=HA_ALTER_INPLACE_INSTANT, target_mdl_request=0x7fd4e43dcce0, alter_ctx=0x7fd4e43dd8d0) at sql/sql_table.cc:7590
      #17 0x0000564507498286 in mysql_alter_table (thd=0x7fd494000ce8, new_db=0x7fd4940053b0, new_name=0x7fd494005780, create_info=0x7fd4e43de4c0, table_list=0x7fd4940142a8, alter_info=0x7fd4e43de400, order_num=0, order=0x0, ignore=false) at sql/sql_table.cc:9688
      #18 0x000056450752226e in Sql_cmd_alter_table::execute (this=0x7fd494014a08, thd=0x7fd494000ce8) at sql/sql_alter.cc:491
      #19 0x00005645073c08d0 in mysql_execute_command (thd=0x7fd494000ce8) at sql/sql_parse.cc:6302
      #20 0x00005645073c5a8c in mysql_parse (thd=0x7fd494000ce8, rawbuf=0x7fd494014190 "ALTER TABLE t1 CHANGE COLUMN col_int col_int INTEGER", length=52, parser_state=0x7fd4e43df5f0, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:8104
      #21 0x00005645073b29ba in dispatch_command (command=COM_QUERY, thd=0x7fd494000ce8, packet=0x7fd49400acd9 "ALTER TABLE t1 CHANGE COLUMN col_int col_int INTEGER", packet_length=52, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:1850
      #22 0x00005645073b13cf in do_command (thd=0x7fd494000ce8) at sql/sql_parse.cc:1395
      #23 0x000056450751c29e in do_handle_one_connection (connect=0x56450b04c968) at sql/sql_connect.cc:1402
      #24 0x000056450751c015 in handle_one_connection (arg=0x56450b04c968) at sql/sql_connect.cc:1308
      #25 0x0000564507e16d63 in pfs_spawn_thread (arg=0x56450b092d98) at storage/perfschema/pfs.cc:1862
      #26 0x00007fd4eb4fd7fc in start_thread (arg=0x7fd4e43e0700) at pthread_create.c:465
      #27 0x00007fd4ea937b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              mleich Matthias Leich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.