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

Assertion `len <= col->len || ((col->mtype) == 5 || (col->mtype) == 14) || (col->len == 0 && col->mtype == 1)' failed in rec_get_converted_size_comp_prefix_low

Details

    Description

      The problem was found when RQG testing with table_stress.yy on builds compiled with debug.
      10.3 d4144c8e010b61a440d422d0f1ca5b066532d173 2019-01-21
      10.4 382115b99297ceaa4c3067f79efb5c2515013be5  2019-01-21
      An actual 10.2 does not show that problem.
       
      Version: '10.3.13-MariaDB-debug-log'  socket: 'bld_debug/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
      mysqld: storage/innobase/rem/rem0rec.cc:1131: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool): Assertion `len <= col->len || ((col->mtype) == 5 || (col->mtype) == 14) || (col->len == 0 && col->mtype == 1)' failed.
      190122 11:15:55 [ERROR] mysqld got signal 6 ;
      ...
      Query (0x7f7cf8012db0): ROLLBACK /* E_R Thread1 QNO 122 CON_ID 15 */
      Connection ID (thread ID): 10
      Status: NOT_KILLED
      ...
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00007f7d586e0f5d in __GI_abort () at abort.c:90
      #6  0x00007f7d586d6f17 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x555c1bc96d18 "len <= col->len || ((col->mtype) == 5 || (col->mtype) == 14) || (col->len == 0 && col->mtype == 1)", file=file@entry=0x555c1bc96220 "storage/innobase/rem/rem0rec.cc", line=line@entry=1131, function=function@entry=0x555c1bc987e0 <rec_get_converted_size_comp_prefix_low(dict_index_t const*, dfield_t const*, unsigned long, unsigned long*, rec_comp_status_t, bool)::__PRETTY_FUNCTION__> "ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool)") at assert.c:92
      #7  0x00007f7d586d6fc2 in __GI___assert_fail (assertion=0x555c1bc96d18 "len <= col->len || ((col->mtype) == 5 || (col->mtype) == 14) || (col->len == 0 && col->mtype == 1)", file=0x555c1bc96220 "storage/innobase/rem/rem0rec.cc", line=1131, function=0x555c1bc987e0 <rec_get_converted_size_comp_prefix_low(dict_index_t const*, dfield_t const*, unsigned long, unsigned long*, rec_comp_status_t, bool)::__PRETTY_FUNCTION__> "ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool)") at assert.c:101
      #8  0x0000555c1b508645 in rec_get_converted_size_comp_prefix_low (index=0x7f7cec03b148, fields=0x7f7cf802e170, n_fields=3, extra=0x7f7d519cdc60, status=REC_STATUS_ORDINARY, temp=true) at storage/innobase/rem/rem0rec.cc:1131
      #9  0x0000555c1b50a2f7 in rec_get_converted_size_temp (index=0x7f7cec03b148, fields=0x7f7cf802e170, n_fields=3, extra=0x7f7d519cdc60, status=REC_STATUS_ORDINARY) at storage/innobase/rem/rem0rec.cc:1676
      #10 0x0000555c1b564e01 in row_log_table_delete (rec=0x7f7d523040b4 "", index=0x7f7cec02e528, offsets=0x7f7cf8036fe8, sys=0x0) at storage/innobase/row/row0log.cc:742
      #11 0x0000555c1b7a2ce8 in row_undo_ins_remove_clust_rec (node=0x7f7cf8036118) at storage/innobase/row/row0uins.cc:120
      #12 0x0000555c1b7a4449 in row_undo_ins (node=0x7f7cf8036118, thr=0x7f7cf80206b8) at storage/innobase/row/row0uins.cc:612
      #13 0x0000555c1b5a6b96 in row_undo (node=0x7f7cf8036118, thr=0x7f7cf80206b8) at storage/innobase/row/row0undo.cc:301
      #14 0x0000555c1b5a6df8 in row_undo_step (thr=0x7f7cf80206b8) at storage/innobase/row/row0undo.cc:360
      #15 0x0000555c1b4fa8c7 in que_thr_step (thr=0x7f7cf80206b8) at storage/innobase/que/que0que.cc:1040
      #16 0x0000555c1b4fab1b in que_run_threads_low (thr=0x7f7cf80206b8) at storage/innobase/que/que0que.cc:1104
      #17 0x0000555c1b4fad0d in que_run_threads (thr=0x7f7cf80206b8) at storage/innobase/que/que0que.cc:1144
      #18 0x0000555c1b605ef0 in trx_rollback_to_savepoint_low (trx=0x7f7d525111c8, savept=0x0) at storage/innobase/trx/trx0roll.cc:141
      #19 0x0000555c1b6062e0 in trx_rollback_for_mysql_low (trx=0x7f7d525111c8) at storage/innobase/trx/trx0roll.cc:210
      #20 0x0000555c1b606633 in trx_rollback_for_mysql (trx=0x7f7d525111c8) at storage/innobase/trx/trx0roll.cc:236
      #21 0x0000555c1b3f0760 in innobase_rollback (hton=0x555c1e8aff48, thd=0x7f7cf8000ce8, rollback_trx=true) at storage/innobase/handler/ha_innodb.cc:4720
      #22 0x0000555c1b1e6171 in ha_rollback_trans (thd=0x7f7cf8000ce8, all=true) at sql/handler.cc:1722
      #23 0x0000555c1b062840 in trans_rollback (thd=0x7f7cf8000ce8) at sql/transaction.cc:423
      #24 0x0000555c1aef525a in mysql_execute_command (thd=0x7f7cf8000ce8) at sql/sql_parse.cc:5832
      #25 0x0000555c1aefbee7 in mysql_parse (thd=0x7f7cf8000ce8, rawbuf=0x7f7cf8012db0 "ROLLBACK /* E_R Thread1 QNO 122 CON_ID 15 */", length=44, parser_state=0x7f7d519cf5e0, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:8092
      #26 0x0000555c1aee8dec in dispatch_command (command=COM_QUERY, thd=0x7f7cf8000ce8, packet=0x7f7cf800aa99 "ROLLBACK /* E_R Thread1 QNO 122 CON_ID 15 */ ", packet_length=45, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:1850
      #27 0x0000555c1aee784d in do_command (thd=0x7f7cf8000ce8) at sql/sql_parse.cc:1395
      #28 0x0000555c1b04e5f8 in do_handle_one_connection (connect=0x555c1eb7f798) at sql/sql_connect.cc:1402
      #29 0x0000555c1b04e36f in handle_one_connection (arg=0x555c1eb7f798) at sql/sql_connect.cc:1308
      #30 0x0000555c1b92d173 in pfs_spawn_thread (arg=0x555c1eb03478) at storage/perfschema/pfs.cc:1862
      #31 0x00007f7d593827fc in start_thread (arg=0x7f7d519d0700) at pthread_create.c:465
      #32 0x00007f7d587bcb5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      The corresponding assert in 10.4 is
      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.
      
      

      Attachments

        1. ts_13.tgz
          2 kB
        2. prt
          61 kB

        Issue Links

          Activity

            mleich Matthias Leich added a comment - - edited

            How to replay
            ---------------------
            cd <tree>/mysql-test
            tar xvzf ts_13.tgz
            cd <tree with binaries>/mysql-test
            ./mysql-test-run.pl --mem ts_13
            You might need several attempts but on my box I get a replay on every test run.
            One remarkable statement between the SQLs executed is
            ALTER TABLE t4 ADD UNIQUE INDEX uidx2 ( col2 ), ADD UNIQUE INDEX uidx3 ( col2 );
            trying to create two unique indexes on the same column.
            Therefore I assume that only a very small fraction of users will hit that problem too.
            But its a serious obstacle when running RQG tests where generating such ugly SQL
            is not that rare and preventing that requires a lot costly additional code.

            mleich Matthias Leich added a comment - - edited How to replay --------------------- cd <tree>/mysql-test tar xvzf ts_13.tgz cd <tree with binaries>/mysql-test ./mysql-test-run.pl --mem ts_13 You might need several attempts but on my box I get a replay on every test run. One remarkable statement between the SQLs executed is ALTER TABLE t4 ADD UNIQUE INDEX uidx2 ( col2 ), ADD UNIQUE INDEX uidx3 ( col2 ); trying to create two unique indexes on the same column. Therefore I assume that only a very small fraction of users will hit that problem too. But its a serious obstacle when running RQG tests where generating such ugly SQL is not that rare and preventing that requires a lot costly additional code.
            mleich Matthias Leich added a comment - - edited

            This bug might look like an duplicate of https://jira.mariadb.org/browse/MDEV-18086
            but here neither a release upgrade nor virtual columns are involved.

            mleich Matthias Leich added a comment - - edited This bug might look like an duplicate of https://jira.mariadb.org/browse/MDEV-18086 but here neither a release upgrade nor virtual columns are involved.
            mleich Matthias Leich added a comment - - edited

            Assert found during RQG testing and most probably caused by the same reason.
             
            10.3.14 commit  0ffea01da5a0fef14558ed6217e0da98089dee55 2019-04-01T09:22:19+03:00
            mysqld: storage/innobase/rem/rem0rec.cc:1157: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool): Assertion `!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen' failed.
            ....
            Query (0x7f094c012ac0): INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL)  /* E_R Thread3 QNO 34 CON_ID 18 */
            # 2019-04-01T12:17:37 [186208] | Connection ID (thread ID): 18
            # 2019-04-01T12:17:37 [186208] | Status: NOT_KILLED
             
            My attempts to write some MTR based brute force replay test were not successful.
             
            So we need to go with the simplified RQG grammar.
             
            RQG YY grammar
            --------------------------
            query:
                DELETE FROM t2 WHERE col2 IS NULL ; INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL) , (NULL,NULL,NULL) ; ROLLBACK ;
             
            query_init:
                { sleep 5; return undef } ; CREATE TABLE IF NOT EXISTS t2 ( col2 INT, col_int INTEGER , col_string CHAR(20) ) ENGINE = InnoDB ROW_FORMAT = Compressed ; thread_connect ;
             
            thread1:
                ALTER TABLE t2 DROP PRIMARY KEY , ADD UNIQUE INDEX IF NOT EXISTS uidx1 ( col_int ) ; ALTER TABLE t2 ADD PRIMARY KEY IF NOT EXISTS ( col_string ) ; ALTER TABLE t2 ADD PRIMARY KEY IF NOT EXISTS ( col_int ) ;
             
            thread_connect:
                SET AUTOCOMMIT = 0; SET SESSION lock_wait_timeout = 2 ; SET SESSION innodb_lock_wait_timeout = 1 ;
            
            

            mleich Matthias Leich added a comment - - edited Assert found during RQG testing and most probably caused by the same reason. 10.3.14 commit 0ffea01da5a0fef14558ed6217e0da98089dee55 2019-04-01T09:22:19+03:00 mysqld: storage/innobase/rem/rem0rec.cc:1157: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool): Assertion `!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen' failed. .... Query (0x7f094c012ac0): INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL) /* E_R Thread3 QNO 34 CON_ID 18 */ # 2019-04-01T12:17:37 [186208] | Connection ID (thread ID): 18 # 2019-04-01T12:17:37 [186208] | Status: NOT_KILLED   My attempts to write some MTR based brute force replay test were not successful.   So we need to go with the simplified RQG grammar.   RQG YY grammar -------------------------- query: DELETE FROM t2 WHERE col2 IS NULL ; INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL) , (NULL,NULL,NULL) ; ROLLBACK ;   query_init: { sleep 5; return undef } ; CREATE TABLE IF NOT EXISTS t2 ( col2 INT, col_int INTEGER , col_string CHAR(20) ) ENGINE = InnoDB ROW_FORMAT = Compressed ; thread_connect ;   thread1: ALTER TABLE t2 DROP PRIMARY KEY , ADD UNIQUE INDEX IF NOT EXISTS uidx1 ( col_int ) ; ALTER TABLE t2 ADD PRIMARY KEY IF NOT EXISTS ( col_string ) ; ALTER TABLE t2 ADD PRIMARY KEY IF NOT EXISTS ( col_int ) ;   thread_connect: SET AUTOCOMMIT = 0; SET SESSION lock_wait_timeout = 2 ; SET SESSION innodb_lock_wait_timeout = 1 ;

            Retest on 10.3.15 commit e8dd18a474ee6b48eb7f92e3831f9e359b0bdc6e 2019-05-04
            1. The MTR based test (see on top) did not replay any assert at all.
            2. The simplified RQG grammar (see above) replays quite fast some slightly different assert
                 storage/innobase/rem/rem0rec.cc:1146: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool): Assertion `!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen' failed.
                 [ERROR] mysqld got signal 6 ;
                 ...
                Query (0x7f90bc010880): INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL)  /* E_R Thread9 QNO 358 CON_ID 24 */
                Connection ID (thread ID): 24
                Status: NOT_KILLED
                ...
                #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
            #5  0x00007f917b95837a in __GI_abort () at abort.c:89
            #6  0x00007f917b94eb47 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x5647f0980c58 "!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen", file=file@entry=0x5647f0980098 "storage/innobase/rem/rem0rec.cc", line=line@entry=1146, function=function@entry=0x5647f0982600 <rec_get_converted_size_comp_prefix_low(dict_index_t const*, dfield_t const*, unsigned long, unsigned long*, rec_comp_status_t, bool)::__PRETTY_FUNCTION__> "ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool)") at assert.c:92
            #7  0x00007f917b94ebf2 in __GI___assert_fail (assertion=0x5647f0980c58 "!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen", file=0x5647f0980098 "storage/innobase/rem/rem0rec.cc", line=1146, function=0x5647f0982600 <rec_get_converted_size_comp_prefix_low(dict_index_t const*, dfield_t const*, unsigned long, unsigned long*, rec_comp_status_t, bool)::__PRETTY_FUNCTION__> "ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool)") at assert.c:101
            #8  0x00005647f01d0eb7 in rec_get_converted_size_comp_prefix_low (index=0x7f90dc2db868, fields=0x7f90bc0289e0, n_fields=3, extra=0x7f917371e210, status=REC_STATUS_ORDINARY, temp=false) at storage/innobase/rem/rem0rec.cc:1146
            #9  0x00005647f01d28be in rec_get_converted_size_temp (index=0x7f90dc2db868, fields=0x7f90bc0289e0, n_fields=3, extra=0x7f917371e210, status=REC_STATUS_ORDINARY) at storage/innobase/rem/rem0rec.cc:1665
            #10 0x00005647f022a210 in row_log_table_delete (rec=0x7f91588f407e "\200", index=0x7f90dc2d82d8, offsets=0x7f90bc0288b8, sys=0x0) at storage/innobase/row/row0log.cc:746
            #11 0x00005647f04601c8 in row_undo_ins_remove_clust_rec (node=0x7f90bc027de8) at storage/innobase/row/row0uins.cc:120
            #12 0x00005647f0461919 in row_undo_ins (node=0x7f90bc027de8, thr=0x7f90bc027c18) at storage/innobase/row/row0uins.cc:612
            #13 0x00005647f0269e6f in row_undo (node=0x7f90bc027de8, thr=0x7f90bc027c18) at storage/innobase/row/row0undo.cc:302
            #14 0x00005647f026a0d0 in row_undo_step (thr=0x7f90bc027c18) at storage/innobase/row/row0undo.cc:361
            #15 0x00005647f01c2b09 in que_thr_step (thr=0x7f90bc027c18) at storage/innobase/que/que0que.cc:1040
            #16 0x00005647f01c2d5b in que_run_threads_low (thr=0x7f90bc027c18) at storage/innobase/que/que0que.cc:1104
            #17 0x00005647f01c2f4d in que_run_threads (thr=0x7f90bc027c18) at storage/innobase/que/que0que.cc:1144
            #18 0x00005647f02c9036 in trx_rollback_to_savepoint_low (trx=0x7f917865c450, savept=0x7f917865d410) at storage/innobase/trx/trx0roll.cc:140
            #19 0x00005647f02c93ea in trx_rollback_to_savepoint (trx=0x7f917865c450, savept=0x7f917865d410) at storage/innobase/trx/trx0roll.cc:188
            #20 0x00005647f02c9ea8 in trx_rollback_last_sql_stat_for_mysql (trx=0x7f917865c450) at storage/innobase/trx/trx0roll.cc:322
            #21 0x00005647f00b7f44 in innobase_rollback (hton=0x5647f305d1a8, thd=0x7f90bc000a98, rollback_trx=false) at storage/innobase/handler/ha_innodb.cc:4734
            #22 0x00005647efeaef6d in ha_rollback_trans (thd=0x7f90bc000a98, all=false) at sql/handler.cc:1722
            #23 0x00005647efd29f50 in trans_rollback_stmt (thd=0x7f90bc000a98) at sql/transaction.cc:568
            #24 0x00005647efbbd0f2 in mysql_execute_command (thd=0x7f90bc000a98) at sql/sql_parse.cc:6334
            #25 0x00005647efbc1ef0 in mysql_parse (thd=0x7f90bc000a98, rawbuf=0x7f90bc010880 "INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL)  /* E_R Thread9 QNO 358 CON_ID 24 */", length=121, parser_state=0x7f917371f640, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:8091
            #26 0x00005647efbaef40 in dispatch_command (command=COM_QUERY, thd=0x7f90bc000a98, packet=0x7f90bc008549 " INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL)  /* E_R Thread9 QNO 358 CON_ID 24 */ ", packet_length=123, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:1858
            #27 0x00005647efbad965 in do_command (thd=0x7f90bc000a98) at sql/sql_parse.cc:1403
            #28 0x00005647efd15707 in do_handle_one_connection (connect=0x5647f3b68ba8) at sql/sql_connect.cc:1402
            #29 0x00005647efd1547e in handle_one_connection (arg=0x5647f3b68ba8) at sql/sql_connect.cc:1308
            #30 0x00007f917c5976da in start_thread (arg=0x7f9173720700) at pthread_create.c:456
            #31 0x00007f917ba29d7f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
            

            mleich Matthias Leich added a comment - Retest on 10.3.15 commit e8dd18a474ee6b48eb7f92e3831f9e359b0bdc6e 2019-05-04 1. The MTR based test (see on top) did not replay any assert at all. 2. The simplified RQG grammar (see above) replays quite fast some slightly different assert storage/innobase/rem/rem0rec.cc:1146: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool): Assertion `!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen' failed. [ERROR] mysqld got signal 6 ; ... Query (0x7f90bc010880): INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL) /* E_R Thread9 QNO 358 CON_ID 24 */ Connection ID (thread ID): 24 Status: NOT_KILLED ... #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58 #5 0x00007f917b95837a in __GI_abort () at abort.c:89 #6 0x00007f917b94eb47 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x5647f0980c58 "!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen", file=file@entry=0x5647f0980098 "storage/innobase/rem/rem0rec.cc", line=line@entry=1146, function=function@entry=0x5647f0982600 <rec_get_converted_size_comp_prefix_low(dict_index_t const*, dfield_t const*, unsigned long, unsigned long*, rec_comp_status_t, bool)::__PRETTY_FUNCTION__> "ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool)") at assert.c:92 #7 0x00007f917b94ebf2 in __GI___assert_fail (assertion=0x5647f0980c58 "!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen", file=0x5647f0980098 "storage/innobase/rem/rem0rec.cc", line=1146, function=0x5647f0982600 <rec_get_converted_size_comp_prefix_low(dict_index_t const*, dfield_t const*, unsigned long, unsigned long*, rec_comp_status_t, bool)::__PRETTY_FUNCTION__> "ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool)") at assert.c:101 #8 0x00005647f01d0eb7 in rec_get_converted_size_comp_prefix_low (index=0x7f90dc2db868, fields=0x7f90bc0289e0, n_fields=3, extra=0x7f917371e210, status=REC_STATUS_ORDINARY, temp=false) at storage/innobase/rem/rem0rec.cc:1146 #9 0x00005647f01d28be in rec_get_converted_size_temp (index=0x7f90dc2db868, fields=0x7f90bc0289e0, n_fields=3, extra=0x7f917371e210, status=REC_STATUS_ORDINARY) at storage/innobase/rem/rem0rec.cc:1665 #10 0x00005647f022a210 in row_log_table_delete (rec=0x7f91588f407e "\200", index=0x7f90dc2d82d8, offsets=0x7f90bc0288b8, sys=0x0) at storage/innobase/row/row0log.cc:746 #11 0x00005647f04601c8 in row_undo_ins_remove_clust_rec (node=0x7f90bc027de8) at storage/innobase/row/row0uins.cc:120 #12 0x00005647f0461919 in row_undo_ins (node=0x7f90bc027de8, thr=0x7f90bc027c18) at storage/innobase/row/row0uins.cc:612 #13 0x00005647f0269e6f in row_undo (node=0x7f90bc027de8, thr=0x7f90bc027c18) at storage/innobase/row/row0undo.cc:302 #14 0x00005647f026a0d0 in row_undo_step (thr=0x7f90bc027c18) at storage/innobase/row/row0undo.cc:361 #15 0x00005647f01c2b09 in que_thr_step (thr=0x7f90bc027c18) at storage/innobase/que/que0que.cc:1040 #16 0x00005647f01c2d5b in que_run_threads_low (thr=0x7f90bc027c18) at storage/innobase/que/que0que.cc:1104 #17 0x00005647f01c2f4d in que_run_threads (thr=0x7f90bc027c18) at storage/innobase/que/que0que.cc:1144 #18 0x00005647f02c9036 in trx_rollback_to_savepoint_low (trx=0x7f917865c450, savept=0x7f917865d410) at storage/innobase/trx/trx0roll.cc:140 #19 0x00005647f02c93ea in trx_rollback_to_savepoint (trx=0x7f917865c450, savept=0x7f917865d410) at storage/innobase/trx/trx0roll.cc:188 #20 0x00005647f02c9ea8 in trx_rollback_last_sql_stat_for_mysql (trx=0x7f917865c450) at storage/innobase/trx/trx0roll.cc:322 #21 0x00005647f00b7f44 in innobase_rollback (hton=0x5647f305d1a8, thd=0x7f90bc000a98, rollback_trx=false) at storage/innobase/handler/ha_innodb.cc:4734 #22 0x00005647efeaef6d in ha_rollback_trans (thd=0x7f90bc000a98, all=false) at sql/handler.cc:1722 #23 0x00005647efd29f50 in trans_rollback_stmt (thd=0x7f90bc000a98) at sql/transaction.cc:568 #24 0x00005647efbbd0f2 in mysql_execute_command (thd=0x7f90bc000a98) at sql/sql_parse.cc:6334 #25 0x00005647efbc1ef0 in mysql_parse (thd=0x7f90bc000a98, rawbuf=0x7f90bc010880 "INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL) /* E_R Thread9 QNO 358 CON_ID 24 */", length=121, parser_state=0x7f917371f640, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:8091 #26 0x00005647efbaef40 in dispatch_command (command=COM_QUERY, thd=0x7f90bc000a98, packet=0x7f90bc008549 " INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL) /* E_R Thread9 QNO 358 CON_ID 24 */ ", packet_length=123, is_com_multi=false, is_next_command=false) at sql/sql_parse.cc:1858 #27 0x00005647efbad965 in do_command (thd=0x7f90bc000a98) at sql/sql_parse.cc:1403 #28 0x00005647efd15707 in do_handle_one_connection (connect=0x5647f3b68ba8) at sql/sql_connect.cc:1402 #29 0x00005647efd1547e in handle_one_connection (arg=0x5647f3b68ba8) at sql/sql_connect.cc:1308 #30 0x00007f917c5976da in start_thread (arg=0x7f9173720700) at pthread_create.c:456 #31 0x00007f917ba29d7f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105

            Replay attempt against actual (2021-01) 10.6 with the simplified grammar from above
            No success because of
            CREATE TABLE IF NOT EXISTS t2 ( col2 INT, col_int INTEGER, col_string CHAR(20) ) ENGINE = InnoDB ROW_FORMAT = Compressed  /* E_R Thread2 QNO 3 CON_ID 18 */  failed: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.. Further errors of this kind will be suppressed.
            

            mleich Matthias Leich added a comment - Replay attempt against actual (2021-01) 10.6 with the simplified grammar from above No success because of CREATE TABLE IF NOT EXISTS t2 ( col2 INT, col_int INTEGER, col_string CHAR(20) ) ENGINE = InnoDB ROW_FORMAT = Compressed /* E_R Thread2 QNO 3 CON_ID 18 */ failed: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.. Further errors of this kind will be suppressed.
            mleich Matthias Leich added a comment - - edited

            I am removing the label "affects-tests" because
            - per my RQG testing result bookkeeping the assertions
               `!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen' failed
               `len <= col->len || ((col->mtype) == 5 || (col->mtype) == 14) || (col->len == 0 && col->mtype == 1)'
               and similar were no more observed since my systematic bookkeeping exists (~ 2020-11)
            - most testing happens on higher MariaDB versions where the problem seems to be
              - fixed (IMHO very likely)
              or
              - maybe shows up with some very different text about the assertion (IMHO very unlikely)
              or
              - maybe shows up with some very different RQG test (IMHO very unlikely)
             
            Results of RQG testing with the simplified grammar
            -------------------------------------------------------------------------------
            rem0rec.cc:1157: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool): Assertion `!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen' failed.
            was
            - not repeatable (within ~ 3000 test runs) on
               10.3.32   25d6bbcd5172eb9af0a68be11fb662457a7d572b 2021-09-21T14:44:39+07:00
               And there were also no other bad effects which might be some "replacement" showing up.
            - quite fast repeatable on
               10.3.13   d4144c8e010b61a440d422d0f1ca5b066532d173 2019-01-21T09:50:52+02:00
                pluto:/data/Results/1632230503/TBR-571-MDEV-18334/dev/shm/vardir/1632230503/48/1/rr
                (rr) bt
            #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #1  0x000039687cfb8859 in __GI_abort () at abort.c:79
            #2  0x000039687cfb8729 in __assert_fail_base (fmt=0x39687d14e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55fe05c87b20 "!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen", 
                file=0x55fe05c85f40 "/data/Server/10.3_old/storage/innobase/rem/rem0rec.cc", line=1157, function=<optimized out>) at assert.c:92
            #3  0x000039687cfc9f36 in __GI___assert_fail (assertion=0x55fe05c87b20 "!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen", file=0x55fe05c85f40 "/data/Server/10.3_old/storage/innobase/rem/rem0rec.cc", line=1157, 
                function=0x55fe05c87580 "ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool)") at assert.c:101
            #4  0x000055fe04b21e13 in rec_get_converted_size_comp_prefix_low (index=0x617000201408, fields=0x6120000f0e90, n_fields=3, extra=0x6ffd9ee0, status=REC_STATUS_ORDINARY, temp=false) at /data/Server/10.3_old/storage/innobase/rem/rem0rec.cc:1157
            #5  0x000055fe04b24c7f in rec_get_converted_size_temp (index=0x617000201408, fields=0x6120000f0e90, n_fields=3, extra=0x6ffd9ee0, status=REC_STATUS_ORDINARY) at /data/Server/10.3_old/storage/innobase/rem/rem0rec.cc:1675
            #6  0x000055fe04bde21a in row_log_table_delete (rec=0x64000880007e "\200", index=0x6170001f7d88, offsets=0x6110000f0708, sys=0x0) at /data/Server/10.3_old/storage/innobase/row/row0log.cc:742
            #7  0x000055fe05068f67 in row_undo_ins_remove_clust_rec (node=0x61b000171508) at /data/Server/10.3_old/storage/innobase/row/row0uins.cc:120
            #8  0x000055fe0506bccd in row_undo_ins (node=0x61b000171508, thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/row/row0uins.cc:612
            #9  0x000055fe04c67a60 in row_undo (node=0x61b000171508, thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/row/row0undo.cc:301
            #10 0x000055fe04c67fba in row_undo_step (thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/row/row0undo.cc:360
            #11 0x000055fe04b061fe in que_thr_step (thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/que/que0que.cc:1040
            #12 0x000055fe04b065f5 in que_run_threads_low (thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/que/que0que.cc:1104
            #13 0x000055fe04b069c3 in que_run_threads (thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/que/que0que.cc:1144
            #14 0x000055fe04d2ea2c in trx_rollback_to_savepoint_low (trx=0x301c28470f58, savept=0x301c28471f10) at /data/Server/10.3_old/storage/innobase/trx/trx0roll.cc:141
            #15 0x000055fe04d2f24b in trx_rollback_to_savepoint (trx=0x301c28470f58, savept=0x301c28471f10) at /data/Server/10.3_old/storage/innobase/trx/trx0roll.cc:189
            #16 0x000055fe04d30d29 in trx_rollback_last_sql_stat_for_mysql (trx=0x301c28470f58) at /data/Server/10.3_old/storage/innobase/trx/trx0roll.cc:322
            #17 0x000055fe048c8622 in innobase_rollback (hton=0x614000002848, thd=0x62a00021c208, rollback_trx=false) at /data/Server/10.3_old/storage/innobase/handler/ha_innodb.cc:4725
            #18 0x000055fe043a535e in ha_rollback_trans (thd=0x62a00021c208, all=false) at /data/Server/10.3_old/sql/handler.cc:1722
            #19 0x000055fe0405aa41 in trans_rollback_stmt (thd=0x62a00021c208) at /data/Server/10.3_old/sql/transaction.cc:583
            #20 0x000055fe03cbb6fe in mysql_execute_command (thd=0x62a00021c208) at /data/Server/10.3_old/sql/sql_parse.cc:6334
            #21 0x000055fe03cc6d83 in mysql_parse (thd=0x62a00021c208, rawbuf=0x62b00011f220 "INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL)  /* E_R Thread8 QNO 17 CON_ID 27 */", length=120, parser_state=0x6ffdcd00, 
                is_com_multi=false, is_next_command=false) at /data/Server/10.3_old/sql/sql_parse.cc:8092
            #22 0x000055fe03c9e1ef in dispatch_command (command=COM_QUERY, thd=0x62a00021c208, packet=0x6290008de209 " INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL)  /* E_R Thread8 QNO 17 CON_ID 27 */ ", packet_length=122, 
                is_com_multi=false, is_next_command=false) at /data/Server/10.3_old/sql/sql_parse.cc:1850
            #23 0x000055fe03c9afab in do_command (thd=0x62a00021c208) at /data/Server/10.3_old/sql/sql_parse.cc:1395
            #24 0x000055fe0402aaff in do_handle_one_connection (connect=0x6080000011a8) at /data/Server/10.3_old/sql/sql_connect.cc:1402
            #25 0x000055fe0402a426 in handle_one_connection (arg=0x6080000011a8) at /data/Server/10.3_old/sql/sql_connect.cc:1308
            #26 0x00006d507925f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #27 0x000039687d0b5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            (rr)
            
            

            mleich Matthias Leich added a comment - - edited I am removing the label "affects-tests" because - per my RQG testing result bookkeeping the assertions `!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen' failed `len <= col->len || ((col->mtype) == 5 || (col->mtype) == 14) || (col->len == 0 && col->mtype == 1)' and similar were no more observed since my systematic bookkeeping exists (~ 2020-11) - most testing happens on higher MariaDB versions where the problem seems to be - fixed (IMHO very likely) or - maybe shows up with some very different text about the assertion (IMHO very unlikely) or - maybe shows up with some very different RQG test (IMHO very unlikely)   Results of RQG testing with the simplified grammar ------------------------------------------------------------------------------- rem0rec.cc:1157: ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool): Assertion `!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen' failed. was - not repeatable (within ~ 3000 test runs) on 10.3.32 25d6bbcd5172eb9af0a68be11fb662457a7d572b 2021-09-21T14:44:39+07:00 And there were also no other bad effects which might be some "replacement" showing up. - quite fast repeatable on 10.3.13 d4144c8e010b61a440d422d0f1ca5b066532d173 2019-01-21T09:50:52+02:00 pluto:/data/Results/1632230503/TBR-571-MDEV-18334/dev/shm/vardir/1632230503/48/1/rr (rr) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x000039687cfb8859 in __GI_abort () at abort.c:79 #2 0x000039687cfb8729 in __assert_fail_base (fmt=0x39687d14e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55fe05c87b20 "!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen", file=0x55fe05c85f40 "/data/Server/10.3_old/storage/innobase/rem/rem0rec.cc", line=1157, function=<optimized out>) at assert.c:92 #3 0x000039687cfc9f36 in __GI___assert_fail (assertion=0x55fe05c87b20 "!col->mbmaxlen || len >= col->mbminlen * fixed_len / col->mbmaxlen", file=0x55fe05c85f40 "/data/Server/10.3_old/storage/innobase/rem/rem0rec.cc", line=1157, function=0x55fe05c87580 "ulint rec_get_converted_size_comp_prefix_low(const dict_index_t*, const dfield_t*, ulint, ulint*, rec_comp_status_t, bool)") at assert.c:101 #4 0x000055fe04b21e13 in rec_get_converted_size_comp_prefix_low (index=0x617000201408, fields=0x6120000f0e90, n_fields=3, extra=0x6ffd9ee0, status=REC_STATUS_ORDINARY, temp=false) at /data/Server/10.3_old/storage/innobase/rem/rem0rec.cc:1157 #5 0x000055fe04b24c7f in rec_get_converted_size_temp (index=0x617000201408, fields=0x6120000f0e90, n_fields=3, extra=0x6ffd9ee0, status=REC_STATUS_ORDINARY) at /data/Server/10.3_old/storage/innobase/rem/rem0rec.cc:1675 #6 0x000055fe04bde21a in row_log_table_delete (rec=0x64000880007e "\200", index=0x6170001f7d88, offsets=0x6110000f0708, sys=0x0) at /data/Server/10.3_old/storage/innobase/row/row0log.cc:742 #7 0x000055fe05068f67 in row_undo_ins_remove_clust_rec (node=0x61b000171508) at /data/Server/10.3_old/storage/innobase/row/row0uins.cc:120 #8 0x000055fe0506bccd in row_undo_ins (node=0x61b000171508, thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/row/row0uins.cc:612 #9 0x000055fe04c67a60 in row_undo (node=0x61b000171508, thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/row/row0undo.cc:301 #10 0x000055fe04c67fba in row_undo_step (thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/row/row0undo.cc:360 #11 0x000055fe04b061fe in que_thr_step (thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/que/que0que.cc:1040 #12 0x000055fe04b065f5 in que_run_threads_low (thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/que/que0que.cc:1104 #13 0x000055fe04b069c3 in que_run_threads (thr=0x6170001d27c8) at /data/Server/10.3_old/storage/innobase/que/que0que.cc:1144 #14 0x000055fe04d2ea2c in trx_rollback_to_savepoint_low (trx=0x301c28470f58, savept=0x301c28471f10) at /data/Server/10.3_old/storage/innobase/trx/trx0roll.cc:141 #15 0x000055fe04d2f24b in trx_rollback_to_savepoint (trx=0x301c28470f58, savept=0x301c28471f10) at /data/Server/10.3_old/storage/innobase/trx/trx0roll.cc:189 #16 0x000055fe04d30d29 in trx_rollback_last_sql_stat_for_mysql (trx=0x301c28470f58) at /data/Server/10.3_old/storage/innobase/trx/trx0roll.cc:322 #17 0x000055fe048c8622 in innobase_rollback (hton=0x614000002848, thd=0x62a00021c208, rollback_trx=false) at /data/Server/10.3_old/storage/innobase/handler/ha_innodb.cc:4725 #18 0x000055fe043a535e in ha_rollback_trans (thd=0x62a00021c208, all=false) at /data/Server/10.3_old/sql/handler.cc:1722 #19 0x000055fe0405aa41 in trans_rollback_stmt (thd=0x62a00021c208) at /data/Server/10.3_old/sql/transaction.cc:583 #20 0x000055fe03cbb6fe in mysql_execute_command (thd=0x62a00021c208) at /data/Server/10.3_old/sql/sql_parse.cc:6334 #21 0x000055fe03cc6d83 in mysql_parse (thd=0x62a00021c208, rawbuf=0x62b00011f220 "INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL) /* E_R Thread8 QNO 17 CON_ID 27 */", length=120, parser_state=0x6ffdcd00, is_com_multi=false, is_next_command=false) at /data/Server/10.3_old/sql/sql_parse.cc:8092 #22 0x000055fe03c9e1ef in dispatch_command (command=COM_QUERY, thd=0x62a00021c208, packet=0x6290008de209 " INSERT INTO t2 (col2, col_int, col_string) VALUES (NULL,NULL,NULL), (NULL,NULL,NULL) /* E_R Thread8 QNO 17 CON_ID 27 */ ", packet_length=122, is_com_multi=false, is_next_command=false) at /data/Server/10.3_old/sql/sql_parse.cc:1850 #23 0x000055fe03c9afab in do_command (thd=0x62a00021c208) at /data/Server/10.3_old/sql/sql_parse.cc:1395 #24 0x000055fe0402aaff in do_handle_one_connection (connect=0x6080000011a8) at /data/Server/10.3_old/sql/sql_connect.cc:1402 #25 0x000055fe0402a426 in handle_one_connection (arg=0x6080000011a8) at /data/Server/10.3_old/sql/sql_connect.cc:1308 #26 0x00006d507925f609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #27 0x000039687d0b5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 (rr)

            I can repeat the issue with the following test case in 10.3.15

            --source include/have_innodb.inc
            set @@sql_mode= 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
            create table t1(f1 INT, f2 INT, f3 char(20))engine=innodb;
            ALTER TABLE t1 add primary key(f2);
            ALTER TABLE t1 DROP PRIMARY KEY, ADD UNIQUE INDEX uidx(f2);
            set DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL alter_signal WAIT_FOR insert_signal";
            send ALTER TABLE t1 ADD PRIMARY KEY (f3);
            connect(con1,localhost,root,,,);
            set debug_sync="now WAIT_FOR alter_signal";
            set @@sql_mode= 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
            INSERT INTO t1 VALUES (NULL,NULL,NULL) , (NULL,NULL,NULL) ;
            set debug_sync="now SIGNAL insert_signal";
            connection default;
            reap;
            disconnect con1;
            DROP TABLE t1;
            

            The problem is that InnoDB fetches the wrong column position from clustered index instead of table column position.
            It is fixed as part of MDEV-22637 patch.

            commit 7476e8c7cdd73d60294126a2840baee97e7644b6
            Author: Thirunarayanan Balathandayuthapani <thiru@mariadb.com>
            Date:   Mon May 25 21:42:26 2020 +0530
             
                MDEV-22637 Rollback of insert fails when column reorder happens
                
                - During column reorder table rebuild, rollback of insert fails.
                Reason is that InnoDB tries to fetch the column position from
                new clustered index and it exceeds default column value tuple fields.
                So InnoDB should use the table column position while searching for
                defaults column value.
            
            

            thiru Thirunarayanan Balathandayuthapani added a comment - I can repeat the issue with the following test case in 10.3.15 --source include/have_innodb.inc set @@sql_mode= 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; create table t1(f1 INT, f2 INT, f3 char(20))engine=innodb; ALTER TABLE t1 add primary key(f2); ALTER TABLE t1 DROP PRIMARY KEY, ADD UNIQUE INDEX uidx(f2); set DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL alter_signal WAIT_FOR insert_signal"; send ALTER TABLE t1 ADD PRIMARY KEY (f3); connect(con1,localhost,root,,,); set debug_sync="now WAIT_FOR alter_signal"; set @@sql_mode= 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; INSERT INTO t1 VALUES (NULL,NULL,NULL) , (NULL,NULL,NULL) ; set debug_sync="now SIGNAL insert_signal"; connection default; reap; disconnect con1; DROP TABLE t1; The problem is that InnoDB fetches the wrong column position from clustered index instead of table column position. It is fixed as part of MDEV-22637 patch. commit 7476e8c7cdd73d60294126a2840baee97e7644b6 Author: Thirunarayanan Balathandayuthapani <thiru@mariadb.com> Date: Mon May 25 21:42:26 2020 +0530   MDEV-22637 Rollback of insert fails when column reorder happens - During column reorder table rebuild, rollback of insert fails. Reason is that InnoDB tries to fetch the column position from new clustered index and it exceeds default column value tuple fields. So InnoDB should use the table column position while searching for defaults column value.

            People

              thiru Thirunarayanan Balathandayuthapani
              mleich Matthias Leich
              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.