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

MDEV-25440: Assertion `(cs->state & 0x20000) == 0' failed in my_strnncollsp_nchars_generic_8bit

Details

    Description

      Appears only in the MDEV-25440 branch, and only in debug. Likely other versions affected.

      CREATE TABLE t (a INT KEY,b INT,c CHAR,KEY(b),KEY(c)) ROW_FORMAT=REDUNDANT COLLATE=tis620_thai_nopad_ci ENGINE=InnoDB;
      INSERT INTO t VALUES (3,4,4);
      

      Leads to:

      10.5.14 cf63eecef44f189ce2d221612dee9dfc1885ba4e (Debug)

      mysqld: /test/MDEV-25440-2-bb-10.5-release_dbg/strings/ctype.c:1380: my_strnncollsp_nchars_generic_8bit: Assertion `(cs->state & 0x20000) == 0' failed.
      

      10.5.14 cf63eecef44f189ce2d221612dee9dfc1885ba4e (Debug)

      Core was generated by `/test/MDEV-25440-2-MD040222-mariadb-10.5.14-linux-x86_64-dbg/bin/mysqld --no-de'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x1534e55cc700 (LWP 3277868))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00001534fc47b859 in __GI_abort () at abort.c:79
      #2  0x00001534fc47b729 in __assert_fail_base (fmt=0x1534fc611588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55f5f488374f "(cs->state & 0x20000) == 0", file=0x55f5f4883998 "/test/MDEV-25440-2-bb-10.5-release_dbg/strings/ctype.c", line=1380, function=<optimized out>) at assert.c:92
      #3  0x00001534fc48cf36 in __GI___assert_fail (assertion=assertion@entry=0x55f5f488374f "(cs->state & 0x20000) == 0", file=file@entry=0x55f5f4883998 "/test/MDEV-25440-2-bb-10.5-release_dbg/strings/ctype.c", line=line@entry=1380, function=function@entry=0x55f5f48848c0 <__PRETTY_FUNCTION__.13851> "my_strnncollsp_nchars_generic_8bit") at assert.c:101
      #4  0x000055f5f41be4b5 in my_strnncollsp_nchars_generic_8bit (cs=<optimized out>, str1=<optimized out>, len1=<optimized out>, str2=<optimized out>, len2=<optimized out>, nchars=<optimized out>) at /test/MDEV-25440-2-bb-10.5-release_dbg/strings/ctype.c:1380
      #5  0x000055f5f3de62d4 in cmp_data (mtype=<optimized out>, prtype=<optimized out>, data1=data1@entry=0x15345c025821 "4", '\245' <repeats 22 times>, "\320X\002\\4\025", len1=len1@entry=1, data2=data2@entry=0x1534d87a4085 "4\200", len2=len2@entry=1) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/rem/rem0cmp.cc:293
      #6  0x000055f5f3de6ef4 in cmp_dtuple_rec_with_match_low (dtuple=dtuple@entry=0x15345c021e70, rec=rec@entry=0x1534d87a4085 "4\200", offsets=offsets@entry=0x1534e55c94f0, n_cmp=2, matched_fields=matched_fields@entry=0x1534e55c8d88) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/rem/rem0cmp.cc:411
      #7  0x000055f5f3de728e in cmp_dtuple_rec (dtuple=dtuple@entry=0x15345c021e70, rec=rec@entry=0x1534d87a4085 "4\200", offsets=0x1534e55c94f0) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/include/data0data.inl:253
      #8  0x000055f5f3f64556 in page_cur_tuple_insert (cursor=cursor@entry=0x1534e55c9368, tuple=tuple@entry=0x15345c021e70, index=index@entry=0x15345c0238b8, offsets=offsets@entry=0x1534e55c92b8, heap=heap@entry=0x1534e55c92a8, n_ext=<optimized out>, mtr=0x1534e55c98d0) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/include/page0cur.inl:289
      #9  0x000055f5f3f685da in btr_cur_optimistic_insert (flags=flags@entry=0, cursor=cursor@entry=0x1534e55c9360, offsets=offsets@entry=0x1534e55c92b8, heap=heap@entry=0x1534e55c92a8, entry=entry@entry=0x15345c021e70, rec=rec@entry=0x1534e55c9310, big_rec=0x1534e55c9400, n_ext=<optimized out>, thr=0x15345c028640, mtr=0x1534e55c98d0) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/btr/btr0cur.cc:3564
      #10 0x000055f5f3e2493b in row_ins_sec_index_entry_low (flags=flags@entry=0, mode=mode@entry=2, index=index@entry=0x15345c0238b8, offsets_heap=<optimized out>, offsets_heap@entry=0x15345c06c928, heap=heap@entry=0x15345c06cdc8, entry=entry@entry=0x15345c021e70, trx_id=0, thr=0x15345c028640) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/row/row0ins.cc:3093
      #11 0x000055f5f3e2acb8 in row_ins_sec_index_entry (index=index@entry=0x15345c0238b8, entry=entry@entry=0x15345c021e70, thr=thr@entry=0x15345c028640, check_foreign=check_foreign@entry=true) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/row/row0ins.cc:3294
      #12 0x000055f5f3e2c9bb in row_ins_index_entry (thr=0x15345c028640, entry=0x15345c021e70, index=0x15345c0238b8) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/row/row0ins.cc:3342
      #13 row_ins_index_entry_step (thr=0x15345c028640, node=0x15345c0283e0) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/row/row0ins.cc:3508
      #14 row_ins (thr=0x15345c028640, node=0x15345c0283e0) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/row/row0ins.cc:3667
      #15 row_ins_step (thr=thr@entry=0x15345c028640) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/row/row0ins.cc:3817
      #16 0x000055f5f3e516aa in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x15345c025818 "\371\003", prebuilt=0x15345c027e88, ins_mode=ROW_INS_NORMAL) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/row/row0mysql.cc:1400
      #17 0x000055f5f3cbd954 in ha_innobase::write_row (this=0x15345c01e660, record=0x15345c025818 "\371\003") at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/innobase/handler/ha_innodb.cc:7708
      #18 0x000055f5f38cdff6 in handler::ha_write_row (this=0x15345c01e660, buf=0x15345c025818 "\371\003") at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/handler.cc:7174
      #19 0x000055f5f359cb94 in write_record (thd=thd@entry=0x15345c000db8, table=table@entry=0x15345c026d08, info=info@entry=0x1534e55cac70, sink=sink@entry=0x0) at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/sql_insert.cc:2140
      #20 0x000055f5f35a922b in mysql_insert (thd=thd@entry=0x15345c000db8, table_list=0x15345c013dd0, fields=@0x15345c005e38: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55f5f4c64300 <end_of_list>, last = 0x15345c005e38, elements = 0}, <No data fields>}, values_list=@0x15345c005e80: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15345c014b60, last = 0x15345c014b60, elements = 1}, <No data fields>}, update_fields=@0x15345c005e68: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55f5f4c64300 <end_of_list>, last = 0x15345c005e68, elements = 0}, <No data fields>}, update_values=@0x15345c005e50: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55f5f4c64300 <end_of_list>, last = 0x15345c005e50, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/sql_insert.cc:1118
      #21 0x000055f5f35f15ed in mysql_execute_command (thd=thd@entry=0x15345c000db8) at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/sql_parse.cc:4624
      #22 0x000055f5f35daf34 in mysql_parse (thd=thd@entry=0x15345c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1534e55cb3d0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/sql_parse.cc:8100
      #23 0x000055f5f35ea787 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x15345c000db8, packet=packet@entry=0x15345c00b4a9 "INSERT INTO t VALUES (3,4,4)", packet_length=packet_length@entry=28, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/sql_class.h:1290
      #24 0x000055f5f35ee003 in do_command (thd=0x15345c000db8) at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/sql_parse.cc:1370
      #25 0x000055f5f374ad24 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55f5f7126ad8, put_in_cache=put_in_cache@entry=true) at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/sql_connect.cc:1418
      #26 0x000055f5f374b427 in handle_one_connection (arg=arg@entry=0x55f5f7126ad8) at /test/MDEV-25440-2-bb-10.5-release_dbg/sql/sql_connect.cc:1312
      #27 0x000055f5f3c04845 in pfs_spawn_thread (arg=0x55f5f7064588) at /test/MDEV-25440-2-bb-10.5-release_dbg/storage/perfschema/pfs.cc:2201
      #28 0x00001534fc98a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #29 0x00001534fc578293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Issue Links

          Activity

            Yet another stack with this testcase

            CREATE TABLE t (a CHAR,b CHAR) COLLATE=tis620_thai_nopad_ci;
            INSERT INTO t VALUES (0,0);
            SELECT a,SUM(DISTINCT a),MIN(b) FROM t GROUP BY a;
            

            Leads to:

            10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug)

            mysqld: /test/10.9_dbg/strings/ctype.c:1381: my_strnncollsp_nchars_generic_8bit: Assertion `(cs->state & 0x20000) == 0' failed.
            

            10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug)

            Core was generated by `/test/MD260222-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            [Current thread is 1 (Thread 0x1504f81fa700 (LWP 744415))]
            (gdb) bt
            #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #1  0x000015050d2a8859 in __GI_abort () at abort.c:79
            #2  0x000015050d2a8729 in __assert_fail_base (fmt=0x15050d43e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b5d96c418f "(cs->state & 0x20000) == 0", file=0x55b5d96c43d8 "/test/10.9_dbg/strings/ctype.c", line=1381, function=<optimized out>) at assert.c:92
            #3  0x000015050d2b9f36 in __GI___assert_fail (assertion=assertion@entry=0x55b5d96c418f "(cs->state & 0x20000) == 0", file=file@entry=0x55b5d96c43d8 "/test/10.9_dbg/strings/ctype.c", line=line@entry=1381, function=function@entry=0x55b5d96c5300 <__PRETTY_FUNCTION__.15161> "my_strnncollsp_nchars_generic_8bit") at assert.c:101
            #4  0x000055b5d8fed6b2 in my_strnncollsp_nchars_generic_8bit (cs=<optimized out>, str1=<optimized out>, len1=<optimized out>, str2=<optimized out>, len2=<optimized out>, nchars=<optimized out>) at /test/10.9_dbg/strings/ctype.c:1381
            #5  0x000055b5d8745416 in Field_string::cmp (this=<optimized out>, a_ptr=<optimized out>, b_ptr=<optimized out>) at /test/10.9_dbg/sql/field.h:2100
            #6  0x000055b5d87c9bf4 in Field::cmp (str=<optimized out>, this=<optimized out>) at /test/10.9_dbg/sql/field.h:1281
            #7  Cached_item_field::cmp (this=0x1504a0017d98) at /test/10.9_dbg/sql/item_buff.cc:197
            #8  0x000055b5d84efd31 in test_if_group_changed (list=@0x1504a0015d48: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1504a006d1a8, last = 0x1504a006d1a8, elements = 1}, <No data fields>}) at /test/10.9_dbg/sql/sql_select.cc:25695
            #9  0x000055b5d84f9985 in end_send_group (join=0x1504a0015bd0, join_tab=<optimized out>, end_of_records=<optimized out>) at /test/10.9_dbg/sql/sql_select.cc:22542
            #10 0x000055b5d84c012c in evaluate_join_record (join=join@entry=0x1504a0015bd0, join_tab=join_tab@entry=0x1504a0017448, error=error@entry=0) at /test/10.9_dbg/sql/sql_select.cc:21325
            #11 0x000055b5d84d655b in sub_select (join=0x1504a0015bd0, join_tab=0x1504a0017448, end_of_records=<optimized out>) at /test/10.9_dbg/sql/sql_select.cc:21095
            #12 0x000055b5d850e386 in do_select (procedure=0x0, join=0x1504a0015bd0) at /test/10.9_dbg/sql/sql_select.cc:20640
            #13 JOIN::exec_inner (this=this@entry=0x1504a0015bd0) at /test/10.9_dbg/sql/sql_select.cc:4749
            #14 0x000055b5d850e932 in JOIN::exec (this=this@entry=0x1504a0015bd0) at /test/10.9_dbg/sql/sql_select.cc:4527
            #15 0x000055b5d850c941 in mysql_select (thd=thd@entry=0x1504a0000db8, tables=0x1504a0014a78, fields=@0x1504a0014140: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1504a0014438, last = 0x1504a0014a18, elements = 3}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x1504a0015290, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1504a0015ba8, unit=0x1504a00051c8, select_lex=0x1504a0013ea0) at /test/10.9_dbg/sql/sql_select.cc:5007
            #16 0x000055b5d850cbf6 in handle_select (thd=thd@entry=0x1504a0000db8, lex=lex@entry=0x1504a00050f0, result=result@entry=0x1504a0015ba8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:543
            #17 0x000055b5d846c152 in execute_sqlcom_select (thd=thd@entry=0x1504a0000db8, all_tables=0x1504a0014a78) at /test/10.9_dbg/sql/sql_parse.cc:6252
            #18 0x000055b5d84790b9 in mysql_execute_command (thd=thd@entry=0x1504a0000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3943
            #19 0x000055b5d8465343 in mysql_parse (thd=thd@entry=0x1504a0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1504f81f9400) at /test/10.9_dbg/sql/sql_parse.cc:8027
            #20 0x000055b5d8473fdf in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1504a0000db8, packet=packet@entry=0x1504a000b889 "", packet_length=packet_length@entry=49, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1362
            #21 0x000055b5d8477426 in do_command (thd=0x1504a0000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1402
            #22 0x000055b5d85f2036 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b5db7c08a8, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
            #23 0x000055b5d85f263b in handle_one_connection (arg=arg@entry=0x55b5db7c08a8) at /test/10.9_dbg/sql/sql_connect.cc:1312
            #24 0x000055b5d8a78d23 in pfs_spawn_thread (arg=0x55b5db703328) at /test/10.9_dbg/storage/perfschema/pfs.cc:2201
            #25 0x000015050d7b7609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #26 0x000015050d3a5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.4.25 (dbg), 10.5.16 (dbg), 10.6.8 (dbg), 10.7.4 (dbg), 10.8.3 (dbg), 10.9.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (opt), 10.5.16 (opt), 10.6.8 (opt), 10.7.4 (opt), 10.8.3 (opt), 10.9.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)

            Roel Roel Van de Paar added a comment - Yet another stack with this testcase CREATE TABLE t (a CHAR ,b CHAR ) COLLATE =tis620_thai_nopad_ci; INSERT INTO t VALUES (0,0); SELECT a, SUM ( DISTINCT a), MIN (b) FROM t GROUP BY a; Leads to: 10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug) mysqld: /test/10.9_dbg/strings/ctype.c:1381: my_strnncollsp_nchars_generic_8bit: Assertion `(cs->state & 0x20000) == 0' failed. 10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug) Core was generated by `/test/MD260222-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGABRT, Aborted. #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 [Current thread is 1 (Thread 0x1504f81fa700 (LWP 744415))] (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x000015050d2a8859 in __GI_abort () at abort.c:79 #2 0x000015050d2a8729 in __assert_fail_base (fmt=0x15050d43e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b5d96c418f "(cs->state & 0x20000) == 0", file=0x55b5d96c43d8 "/test/10.9_dbg/strings/ctype.c", line=1381, function=<optimized out>) at assert.c:92 #3 0x000015050d2b9f36 in __GI___assert_fail (assertion=assertion@entry=0x55b5d96c418f "(cs->state & 0x20000) == 0", file=file@entry=0x55b5d96c43d8 "/test/10.9_dbg/strings/ctype.c", line=line@entry=1381, function=function@entry=0x55b5d96c5300 <__PRETTY_FUNCTION__.15161> "my_strnncollsp_nchars_generic_8bit") at assert.c:101 #4 0x000055b5d8fed6b2 in my_strnncollsp_nchars_generic_8bit (cs=<optimized out>, str1=<optimized out>, len1=<optimized out>, str2=<optimized out>, len2=<optimized out>, nchars=<optimized out>) at /test/10.9_dbg/strings/ctype.c:1381 #5 0x000055b5d8745416 in Field_string::cmp (this=<optimized out>, a_ptr=<optimized out>, b_ptr=<optimized out>) at /test/10.9_dbg/sql/field.h:2100 #6 0x000055b5d87c9bf4 in Field::cmp (str=<optimized out>, this=<optimized out>) at /test/10.9_dbg/sql/field.h:1281 #7 Cached_item_field::cmp (this=0x1504a0017d98) at /test/10.9_dbg/sql/item_buff.cc:197 #8 0x000055b5d84efd31 in test_if_group_changed (list=@0x1504a0015d48: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1504a006d1a8, last = 0x1504a006d1a8, elements = 1}, <No data fields>}) at /test/10.9_dbg/sql/sql_select.cc:25695 #9 0x000055b5d84f9985 in end_send_group (join=0x1504a0015bd0, join_tab=<optimized out>, end_of_records=<optimized out>) at /test/10.9_dbg/sql/sql_select.cc:22542 #10 0x000055b5d84c012c in evaluate_join_record (join=join@entry=0x1504a0015bd0, join_tab=join_tab@entry=0x1504a0017448, error=error@entry=0) at /test/10.9_dbg/sql/sql_select.cc:21325 #11 0x000055b5d84d655b in sub_select (join=0x1504a0015bd0, join_tab=0x1504a0017448, end_of_records=<optimized out>) at /test/10.9_dbg/sql/sql_select.cc:21095 #12 0x000055b5d850e386 in do_select (procedure=0x0, join=0x1504a0015bd0) at /test/10.9_dbg/sql/sql_select.cc:20640 #13 JOIN::exec_inner (this=this@entry=0x1504a0015bd0) at /test/10.9_dbg/sql/sql_select.cc:4749 #14 0x000055b5d850e932 in JOIN::exec (this=this@entry=0x1504a0015bd0) at /test/10.9_dbg/sql/sql_select.cc:4527 #15 0x000055b5d850c941 in mysql_select (thd=thd@entry=0x1504a0000db8, tables=0x1504a0014a78, fields=@0x1504a0014140: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1504a0014438, last = 0x1504a0014a18, elements = 3}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x1504a0015290, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1504a0015ba8, unit=0x1504a00051c8, select_lex=0x1504a0013ea0) at /test/10.9_dbg/sql/sql_select.cc:5007 #16 0x000055b5d850cbf6 in handle_select (thd=thd@entry=0x1504a0000db8, lex=lex@entry=0x1504a00050f0, result=result@entry=0x1504a0015ba8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:543 #17 0x000055b5d846c152 in execute_sqlcom_select (thd=thd@entry=0x1504a0000db8, all_tables=0x1504a0014a78) at /test/10.9_dbg/sql/sql_parse.cc:6252 #18 0x000055b5d84790b9 in mysql_execute_command (thd=thd@entry=0x1504a0000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3943 #19 0x000055b5d8465343 in mysql_parse (thd=thd@entry=0x1504a0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1504f81f9400) at /test/10.9_dbg/sql/sql_parse.cc:8027 #20 0x000055b5d8473fdf in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1504a0000db8, packet=packet@entry=0x1504a000b889 "", packet_length=packet_length@entry=49, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1362 #21 0x000055b5d8477426 in do_command (thd=0x1504a0000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1402 #22 0x000055b5d85f2036 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b5db7c08a8, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418 #23 0x000055b5d85f263b in handle_one_connection (arg=arg@entry=0x55b5db7c08a8) at /test/10.9_dbg/sql/sql_connect.cc:1312 #24 0x000055b5d8a78d23 in pfs_spawn_thread (arg=0x55b5db703328) at /test/10.9_dbg/storage/perfschema/pfs.cc:2201 #25 0x000015050d7b7609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #26 0x000015050d3a5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.4.25 (dbg), 10.5.16 (dbg), 10.6.8 (dbg), 10.7.4 (dbg), 10.8.3 (dbg), 10.9.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (opt), 10.5.16 (opt), 10.6.8 (opt), 10.7.4 (opt), 10.8.3 (opt), 10.9.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)

            And one more differing stack with this testcase:

            CREATE TABLE t (a CHAR,b CHAR,KEY(a,b)) ROW_FORMAT=DYNAMIC COLLATE=tis620_thai_nopad_ci ENGINE=InnoDB;
            SET unique_checks=0,foreign_key_checks=0,autocommit=0;
            INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0);
            

            Leads to:

            10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug)

            mysqld: /test/10.9_dbg/strings/ctype.c:1381: my_strnncollsp_nchars_generic_8bit: Assertion `(cs->state & 0x20000) == 0' failed.
            

            10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug)

            Core was generated by `/test/MD260222-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            [Current thread is 1 (Thread 0x149b963a2700 (LWP 3386051))]
            (gdb) bt
            #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #1  0x0000149bb5a32859 in __GI_abort () at abort.c:79
            #2  0x0000149bb5a32729 in __assert_fail_base (fmt=0x149bb5bc8588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x561c2e97e18f "(cs->state & 0x20000) == 0", file=0x561c2e97e3d8 "/test/10.9_dbg/strings/ctype.c", line=1381, function=<optimized out>) at assert.c:92
            #3  0x0000149bb5a44006 in __GI___assert_fail (assertion=assertion@entry=0x561c2e97e18f "(cs->state & 0x20000) == 0", file=file@entry=0x561c2e97e3d8 "/test/10.9_dbg/strings/ctype.c", line=line@entry=1381, function=function@entry=0x561c2e97f300 <__PRETTY_FUNCTION__.15161> "my_strnncollsp_nchars_generic_8bit") at assert.c:101
            #4  0x0000561c2e2a76b2 in my_strnncollsp_nchars_generic_8bit (cs=<optimized out>, str1=<optimized out>, len1=<optimized out>, str2=<optimized out>, len2=<optimized out>, nchars=<optimized out>) at /test/10.9_dbg/strings/ctype.c:1381
            #5  0x0000561c2df0bff1 in cmp_data (mtype=<optimized out>, prtype=<optimized out>, descending=descending@entry=false, data1=0x149b58332920 "0", len1=len1@entry=1, data2=data2@entry=0x149b58332980 "0", len2=1) at /test/10.9_dbg/storage/innobase/rem/rem0cmp.cc:305
            #6  0x0000561c2df5acfd in cmp_dfield_dfield (descending=<optimized out>, dfield2=0x149b58332950, dfield1=0x149b583328d8) at /test/10.9_dbg/storage/innobase/include/data0data.h:589
            #7  row_merge_tuple_cmp (index=index@entry=0x149b58023618, n_uniq=n_uniq@entry=3, n_field=n_field@entry=3, a=@0x149b58132840: {fields = 0x149b583328d8}, b=@0x149b58132848: {fields = 0x149b58332938}, dup=dup@entry=0x0) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:952
            #8  0x0000561c2df5afe5 in row_merge_tuple_sort (index=index@entry=0x149b58023618, n_uniq=n_uniq@entry=3, n_field=n_field@entry=3, dup=dup@entry=0x0, tuples=tuples@entry=0x149b58132838, aux=aux@entry=0x149b58232838, low=1, high=3) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:1028
            #9  0x0000561c2df5ae56 in row_merge_tuple_sort (index=index@entry=0x149b58023618, n_uniq=n_uniq@entry=3, n_field=n_field@entry=3, dup=dup@entry=0x0, tuples=tuples@entry=0x149b58132838, aux=aux@entry=0x149b58232838, low=0, high=3) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:1028
            #10 0x0000561c2df5ae34 in row_merge_tuple_sort (index=0x149b58023618, n_uniq=3, n_field=3, dup=dup@entry=0x0, tuples=0x149b58132838, aux=0x149b58232838, low=0, high=7) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:1028
            #11 0x0000561c2df5b11d in row_merge_buf_sort (buf=buf@entry=0x149b963a0220, dup=dup@entry=0x0) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:1042
            #12 0x0000561c2df6715a in row_merge_bulk_t::write_to_index (this=this@entry=0x149b5806f640, index_no=index_no@entry=1, trx=trx@entry=0x149bb486b1e0) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:5234
            #13 0x0000561c2df67316 in row_merge_bulk_t::write_to_table (this=0x149b5806f640, table=<optimized out>, trx=trx@entry=0x149bb486b1e0) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:5278
            #14 0x0000561c2e01ed9f in trx_mod_table_time_t::write_bulk (trx=0x149bb486b1e0, table=<optimized out>, this=0x149b58021590) at /test/10.9_dbg/storage/innobase/include/trx0trx.h:519
            #15 trx_t::bulk_insert_apply (this=<optimized out>) at /test/10.9_dbg/storage/innobase/include/trx0trx.h:1133
            #16 trx_mark_sql_stat_end (trx=trx@entry=0x149bb486b1e0) at /test/10.9_dbg/storage/innobase/trx/trx0trx.cc:1630
            #17 0x0000561c2dddbfa6 in innobase_commit (hton=<optimized out>, thd=0x149b58000db8, commit_trx=<optimized out>) at /test/10.9_dbg/storage/innobase/handler/ha_innodb.cc:4564
            #18 0x0000561c2da3d379 in commit_one_phase_2 (thd=thd@entry=0x149b58000db8, all=all@entry=false, trans=trans@entry=0x149b58004758, is_real_trans=is_real_trans@entry=false) at /test/10.9_dbg/sql/handler.cc:2051
            #19 0x0000561c2da3d691 in ha_commit_one_phase (thd=thd@entry=0x149b58000db8, all=all@entry=false) at /test/10.9_dbg/sql/handler.cc:2004
            #20 0x0000561c2da51aae in ha_commit_trans (thd=thd@entry=0x149b58000db8, all=all@entry=false) at /test/10.9_dbg/sql/handler.cc:1798
            #21 0x0000561c2d8c2c38 in trans_commit_stmt (thd=thd@entry=0x149b58000db8) at /test/10.9_dbg/sql/transaction.cc:472
            #22 0x0000561c2d7391be in mysql_execute_command (thd=thd@entry=0x149b58000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:6048
            #23 0x0000561c2d71f343 in mysql_parse (thd=thd@entry=0x149b58000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x149b963a1400) at /test/10.9_dbg/sql/sql_parse.cc:8027
            #24 0x0000561c2d72dfdf in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149b58000db8, packet=packet@entry=0x149b5800b889 "INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0)", packet_length=packet_length@entry=62, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1362
            #25 0x0000561c2d731426 in do_command (thd=0x149b58000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1402
            #26 0x0000561c2d8ac036 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x561c308bf968, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
            #27 0x0000561c2d8ac63b in handle_one_connection (arg=arg@entry=0x561c308bf968) at /test/10.9_dbg/sql/sql_connect.cc:1312
            #28 0x0000561c2dd32d23 in pfs_spawn_thread (arg=0x561c307d2738) at /test/10.9_dbg/storage/perfschema/pfs.cc:2201
            #29 0x0000149bb5f43609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #30 0x0000149bb5b2f163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.4.25 (dbg), 10.5.16 (dbg), 10.6.8 (dbg), 10.7.4 (dbg), 10.8.3 (dbg), 10.9.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (opt),10.5.16 (opt), 10.6.8 (opt), 10.7.4 (opt), 10.8.3 (opt), 10.9.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)

            Roel Roel Van de Paar added a comment - And one more differing stack with this testcase: CREATE TABLE t (a CHAR ,b CHAR , KEY (a,b)) ROW_FORMAT= DYNAMIC COLLATE =tis620_thai_nopad_ci ENGINE=InnoDB; SET unique_checks=0,foreign_key_checks=0,autocommit=0; INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0); Leads to: 10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug) mysqld: /test/10.9_dbg/strings/ctype.c:1381: my_strnncollsp_nchars_generic_8bit: Assertion `(cs->state & 0x20000) == 0' failed. 10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug) Core was generated by `/test/MD260222-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGABRT, Aborted. #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 [Current thread is 1 (Thread 0x149b963a2700 (LWP 3386051))] (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x0000149bb5a32859 in __GI_abort () at abort.c:79 #2 0x0000149bb5a32729 in __assert_fail_base (fmt=0x149bb5bc8588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x561c2e97e18f "(cs->state & 0x20000) == 0", file=0x561c2e97e3d8 "/test/10.9_dbg/strings/ctype.c", line=1381, function=<optimized out>) at assert.c:92 #3 0x0000149bb5a44006 in __GI___assert_fail (assertion=assertion@entry=0x561c2e97e18f "(cs->state & 0x20000) == 0", file=file@entry=0x561c2e97e3d8 "/test/10.9_dbg/strings/ctype.c", line=line@entry=1381, function=function@entry=0x561c2e97f300 <__PRETTY_FUNCTION__.15161> "my_strnncollsp_nchars_generic_8bit") at assert.c:101 #4 0x0000561c2e2a76b2 in my_strnncollsp_nchars_generic_8bit (cs=<optimized out>, str1=<optimized out>, len1=<optimized out>, str2=<optimized out>, len2=<optimized out>, nchars=<optimized out>) at /test/10.9_dbg/strings/ctype.c:1381 #5 0x0000561c2df0bff1 in cmp_data (mtype=<optimized out>, prtype=<optimized out>, descending=descending@entry=false, data1=0x149b58332920 "0", len1=len1@entry=1, data2=data2@entry=0x149b58332980 "0", len2=1) at /test/10.9_dbg/storage/innobase/rem/rem0cmp.cc:305 #6 0x0000561c2df5acfd in cmp_dfield_dfield (descending=<optimized out>, dfield2=0x149b58332950, dfield1=0x149b583328d8) at /test/10.9_dbg/storage/innobase/include/data0data.h:589 #7 row_merge_tuple_cmp (index=index@entry=0x149b58023618, n_uniq=n_uniq@entry=3, n_field=n_field@entry=3, a=@0x149b58132840: {fields = 0x149b583328d8}, b=@0x149b58132848: {fields = 0x149b58332938}, dup=dup@entry=0x0) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:952 #8 0x0000561c2df5afe5 in row_merge_tuple_sort (index=index@entry=0x149b58023618, n_uniq=n_uniq@entry=3, n_field=n_field@entry=3, dup=dup@entry=0x0, tuples=tuples@entry=0x149b58132838, aux=aux@entry=0x149b58232838, low=1, high=3) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:1028 #9 0x0000561c2df5ae56 in row_merge_tuple_sort (index=index@entry=0x149b58023618, n_uniq=n_uniq@entry=3, n_field=n_field@entry=3, dup=dup@entry=0x0, tuples=tuples@entry=0x149b58132838, aux=aux@entry=0x149b58232838, low=0, high=3) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:1028 #10 0x0000561c2df5ae34 in row_merge_tuple_sort (index=0x149b58023618, n_uniq=3, n_field=3, dup=dup@entry=0x0, tuples=0x149b58132838, aux=0x149b58232838, low=0, high=7) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:1028 #11 0x0000561c2df5b11d in row_merge_buf_sort (buf=buf@entry=0x149b963a0220, dup=dup@entry=0x0) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:1042 #12 0x0000561c2df6715a in row_merge_bulk_t::write_to_index (this=this@entry=0x149b5806f640, index_no=index_no@entry=1, trx=trx@entry=0x149bb486b1e0) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:5234 #13 0x0000561c2df67316 in row_merge_bulk_t::write_to_table (this=0x149b5806f640, table=<optimized out>, trx=trx@entry=0x149bb486b1e0) at /test/10.9_dbg/storage/innobase/row/row0merge.cc:5278 #14 0x0000561c2e01ed9f in trx_mod_table_time_t::write_bulk (trx=0x149bb486b1e0, table=<optimized out>, this=0x149b58021590) at /test/10.9_dbg/storage/innobase/include/trx0trx.h:519 #15 trx_t::bulk_insert_apply (this=<optimized out>) at /test/10.9_dbg/storage/innobase/include/trx0trx.h:1133 #16 trx_mark_sql_stat_end (trx=trx@entry=0x149bb486b1e0) at /test/10.9_dbg/storage/innobase/trx/trx0trx.cc:1630 #17 0x0000561c2dddbfa6 in innobase_commit (hton=<optimized out>, thd=0x149b58000db8, commit_trx=<optimized out>) at /test/10.9_dbg/storage/innobase/handler/ha_innodb.cc:4564 #18 0x0000561c2da3d379 in commit_one_phase_2 (thd=thd@entry=0x149b58000db8, all=all@entry=false, trans=trans@entry=0x149b58004758, is_real_trans=is_real_trans@entry=false) at /test/10.9_dbg/sql/handler.cc:2051 #19 0x0000561c2da3d691 in ha_commit_one_phase (thd=thd@entry=0x149b58000db8, all=all@entry=false) at /test/10.9_dbg/sql/handler.cc:2004 #20 0x0000561c2da51aae in ha_commit_trans (thd=thd@entry=0x149b58000db8, all=all@entry=false) at /test/10.9_dbg/sql/handler.cc:1798 #21 0x0000561c2d8c2c38 in trans_commit_stmt (thd=thd@entry=0x149b58000db8) at /test/10.9_dbg/sql/transaction.cc:472 #22 0x0000561c2d7391be in mysql_execute_command (thd=thd@entry=0x149b58000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:6048 #23 0x0000561c2d71f343 in mysql_parse (thd=thd@entry=0x149b58000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x149b963a1400) at /test/10.9_dbg/sql/sql_parse.cc:8027 #24 0x0000561c2d72dfdf in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149b58000db8, packet=packet@entry=0x149b5800b889 "INSERT INTO t VALUES (0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0)", packet_length=packet_length@entry=62, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1362 #25 0x0000561c2d731426 in do_command (thd=0x149b58000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1402 #26 0x0000561c2d8ac036 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x561c308bf968, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418 #27 0x0000561c2d8ac63b in handle_one_connection (arg=arg@entry=0x561c308bf968) at /test/10.9_dbg/sql/sql_connect.cc:1312 #28 0x0000561c2dd32d23 in pfs_spawn_thread (arg=0x561c307d2738) at /test/10.9_dbg/storage/perfschema/pfs.cc:2201 #29 0x0000149bb5f43609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #30 0x0000149bb5b2f163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.4.25 (dbg), 10.5.16 (dbg), 10.6.8 (dbg), 10.7.4 (dbg), 10.8.3 (dbg), 10.9.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (opt),10.5.16 (opt), 10.6.8 (opt), 10.7.4 (opt), 10.8.3 (opt), 10.9.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)
            Roel Roel Van de Paar added a comment - - edited

            Additional smaller testcase without ROW_FORMAT. Index is required.

            CREATE TABLE t (a CHAR,KEY(a)) ENGINE=InnoDB COLLATE=tis620_thai_nopad_ci;
            INSERT INTO t VALUES (0);
            

            Roel Roel Van de Paar added a comment - - edited Additional smaller testcase without ROW_FORMAT . Index is required. CREATE TABLE t (a CHAR , KEY (a)) ENGINE=InnoDB COLLATE =tis620_thai_nopad_ci; INSERT INTO t VALUES (0);
            Roel Roel Van de Paar added a comment - - edited

            Additional stack with this testcase

            CREATE TABLE t (a CHAR,b CHAR,KEY(a,b)) ROW_FORMAT=DYNAMIC COLLATE=tis620_thai_nopad_ci;
            SET foreign_key_checks=0;
            SET SESSION unique_checks=0;
            INSERT IGNORE INTO t VALUES (1,0),(1,0),(0,0),(0,0),(0,0),(0,0);
            

            Leads to:

            10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

            mysqld: /test/10.11_dbg/strings/ctype.c:1384: my_strnncollsp_nchars_generic_8bit: Assertion `(cs->state & 0x20000) == 0' failed.
            

            10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

            Core was generated by `/test/MD190822-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            [Current thread is 1 (Thread 0x14ebe5f78700 (LWP 2191610))]
            (gdb) bt
            #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #1  0x000014ec02f4b859 in __GI_abort () at abort.c:79
            #2  0x000014ec02f4b729 in __assert_fail_base (fmt=0x14ec030e1588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c525403069 "(cs->state & 0x20000) == 0", file=0x55c5254032b0 "/test/10.11_dbg/strings/ctype.c", line=1384, function=<optimized out>) at assert.c:92
            #3  0x000014ec02f5cfd6 in __GI___assert_fail (assertion=assertion@entry=0x55c525403069 "(cs->state & 0x20000) == 0", file=file@entry=0x55c5254032b0 "/test/10.11_dbg/strings/ctype.c", line=line@entry=1384, function=function@entry=0x55c5254041c0 <__PRETTY_FUNCTION__.15203> "my_strnncollsp_nchars_generic_8bit") at assert.c:101
            #4  0x000055c524cde773 in my_strnncollsp_nchars_generic_8bit (cs=<optimized out>, str1=<optimized out>, len1=<optimized out>, str2=<optimized out>, len2=<optimized out>, nchars=<optimized out>) at /test/10.11_dbg/strings/ctype.c:1384
            #5  0x000055c52497a69e in cmp_data (mtype=<optimized out>, prtype=<optimized out>, descending=<optimized out>, data1=data1@entry=0x14eba801eb59 "10", '\245' <repeats 13 times>, "\250\353\001\250\353\024", len1=len1@entry=1, data2=data2@entry=0x14ec00ac407e "10", len2=1) at /test/10.11_dbg/storage/innobase/rem/rem0cmp.cc:303
            #6  0x000055c52497b283 in cmp_dtuple_rec_with_match_low (dtuple=dtuple@entry=0x14eba8020ed0, rec=rec@entry=0x14ec00ac407e "10", index=index@entry=0x14eba8021a60, offsets=offsets@entry=0x14ebe5f73c60, n_cmp=3, matched_fields=matched_fields@entry=0x14ebe5f73ec0) at /test/10.11_dbg/storage/innobase/include/dict0mem.h:1207
            #7  0x000055c52493ec90 in page_cur_search_with_match (block=block@entry=0x14ec009dcd80, index=index@entry=0x14eba8021a60, tuple=tuple@entry=0x14eba8020ed0, mode=mode@entry=PAGE_CUR_LE, iup_matched_fields=iup_matched_fields@entry=0x14ebe5f74758, ilow_matched_fields=ilow_matched_fields@entry=0x14ebe5f74768, cursor=0x14ebe5f753f8, rtr_info=0x0) at /test/10.11_dbg/storage/innobase/include/data0data.inl:253
            #8  0x000055c524ada649 in btr_cur_search_to_nth_level_func (index=index@entry=0x14eba8021a60, level=level@entry=0, tuple=tuple@entry=0x14eba8020ed0, mode=mode@entry=PAGE_CUR_LE, latch_mode=<optimized out>, latch_mode@entry=2114, cursor=cursor@entry=0x14ebe5f753f0, ahi_latch=<optimized out>, mtr=<optimized out>, autoinc=<optimized out>) at /test/10.11_dbg/storage/innobase/btr/btr0cur.cc:1943
            #9  0x000055c5249b4b51 in row_ins_sec_index_entry_low (flags=flags@entry=0, mode=mode@entry=2, index=index@entry=0x14eba8021a60, offsets_heap=<optimized out>, offsets_heap@entry=0x14eba806fc10, heap=heap@entry=0x14eba80700a0, entry=entry@entry=0x14eba8020ed0, trx_id=0, thr=0x14eba8029910) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:2942
            #10 0x000055c5249b6aa2 in row_ins_sec_index_entry (index=index@entry=0x14eba8021a60, entry=entry@entry=0x14eba8020ed0, thr=thr@entry=0x14eba8029910, check_foreign=check_foreign@entry=true) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3251
            #11 0x000055c5249bb86c in row_ins_index_entry (thr=0x14eba8029910, entry=0x14eba8020ed0, index=0x14eba8021a60) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3310
            #12 row_ins_index_entry_step (thr=0x14eba8029910, node=<optimized out>) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3476
            #13 row_ins (thr=0x14eba8029910, node=<optimized out>) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3622
            #14 row_ins_step (thr=thr@entry=0x14eba8029910) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3762
            #15 0x000055c5249dddd1 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x14eba801eb58 "\374\061\060", '\245' <repeats 13 times>, "\250\353\001\250\353\024", prebuilt=0x14eba80291c0, ins_mode=ROW_INS_NORMAL) at /test/10.11_dbg/storage/innobase/row/row0mysql.cc:1313
            #16 0x000055c52486b1e1 in ha_innobase::write_row (this=0x14eba8028970, record=0x14eba801eb58 "\374\061\060", '\245' <repeats 13 times>, "\250\353\001\250\353\024") at /test/10.11_dbg/storage/innobase/handler/ha_innodb.cc:7855
            #17 0x000055c5245544b7 in handler::ha_write_row (this=0x14eba8028970, buf=0x14eba801eb58 "\374\061\060", '\245' <repeats 13 times>, "\250\353\001\250\353\024") at /test/10.11_dbg/sql/handler.cc:7577
            #18 0x000055c52421360c in write_record (thd=thd@entry=0x14eba8000db8, table=table@entry=0x14eba801e258, info=info@entry=0x14ebe5f76c30, sink=sink@entry=0x0) at /test/10.11_dbg/sql/sql_insert.cc:2191
            #19 0x000055c52421e188 in mysql_insert (thd=thd@entry=0x14eba8000db8, table_list=<optimized out>, fields=@0x14eba8005ea8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55c525825c20 <end_of_list>, last = 0x14eba8005ea8, elements = 0}, <No data fields>}, values_list=@0x14eba8005ef0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14eba8014a00, last = 0x14eba8015068, elements = 6}, <No data fields>}, update_fields=@0x14eba8005ed8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55c525825c20 <end_of_list>, last = 0x14eba8005ed8, elements = 0}, <No data fields>}, update_values=@0x14eba8005ec0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55c525825c20 <end_of_list>, last = 0x14eba8005ec0, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=true, result=0x0) at /test/10.11_dbg/sql/sql_insert.cc:1146
            #20 0x000055c52426124c in mysql_execute_command (thd=thd@entry=0x14eba8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:4563
            #21 0x000055c52424d882 in mysql_parse (thd=thd@entry=0x14eba8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ebe5f77330) at /test/10.11_dbg/sql/sql_parse.cc:8035
            #22 0x000055c52425ae6a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14eba8000db8, packet=packet@entry=0x14eba800b6e9 "INSERT IGNORE INTO t VALUES (1,0),(1,0),(0,0),(0,0),(0,0),(0,0)", packet_length=packet_length@entry=63, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1339
            #23 0x000055c52425d574 in do_command (thd=0x14eba8000db8, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
            #24 0x000055c5243bf1da in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c52765ec08, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1418
            #25 0x000055c5243bf6e3 in handle_one_connection (arg=0x55c52765ec08) at /test/10.11_dbg/sql/sql_connect.cc:1312
            #26 0x000014ec0345c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #27 0x000014ec03048133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.2 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.2 (opt), 10.10.2 (opt), 10.11.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)

            (cs->state & 0x20000) == 0|SIGABRT|my_strnncollsp_nchars_generic_8bit|cmp_data|cmp_dtuple_rec_with_match_low|page_cur_search_with_match
            

            Roel Roel Van de Paar added a comment - - edited Additional stack with this testcase CREATE TABLE t (a CHAR ,b CHAR , KEY (a,b)) ROW_FORMAT= DYNAMIC COLLATE =tis620_thai_nopad_ci; SET foreign_key_checks=0; SET SESSION unique_checks=0; INSERT IGNORE INTO t VALUES (1,0),(1,0),(0,0),(0,0),(0,0),(0,0); Leads to: 10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug) mysqld: /test/10.11_dbg/strings/ctype.c:1384: my_strnncollsp_nchars_generic_8bit: Assertion `(cs->state & 0x20000) == 0' failed. 10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug) Core was generated by `/test/MD190822-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'. Program terminated with signal SIGABRT, Aborted. #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 [Current thread is 1 (Thread 0x14ebe5f78700 (LWP 2191610))] (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x000014ec02f4b859 in __GI_abort () at abort.c:79 #2 0x000014ec02f4b729 in __assert_fail_base (fmt=0x14ec030e1588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c525403069 "(cs->state & 0x20000) == 0", file=0x55c5254032b0 "/test/10.11_dbg/strings/ctype.c", line=1384, function=<optimized out>) at assert.c:92 #3 0x000014ec02f5cfd6 in __GI___assert_fail (assertion=assertion@entry=0x55c525403069 "(cs->state & 0x20000) == 0", file=file@entry=0x55c5254032b0 "/test/10.11_dbg/strings/ctype.c", line=line@entry=1384, function=function@entry=0x55c5254041c0 <__PRETTY_FUNCTION__.15203> "my_strnncollsp_nchars_generic_8bit") at assert.c:101 #4 0x000055c524cde773 in my_strnncollsp_nchars_generic_8bit (cs=<optimized out>, str1=<optimized out>, len1=<optimized out>, str2=<optimized out>, len2=<optimized out>, nchars=<optimized out>) at /test/10.11_dbg/strings/ctype.c:1384 #5 0x000055c52497a69e in cmp_data (mtype=<optimized out>, prtype=<optimized out>, descending=<optimized out>, data1=data1@entry=0x14eba801eb59 "10", '\245' <repeats 13 times>, "\250\353\001\250\353\024", len1=len1@entry=1, data2=data2@entry=0x14ec00ac407e "10", len2=1) at /test/10.11_dbg/storage/innobase/rem/rem0cmp.cc:303 #6 0x000055c52497b283 in cmp_dtuple_rec_with_match_low (dtuple=dtuple@entry=0x14eba8020ed0, rec=rec@entry=0x14ec00ac407e "10", index=index@entry=0x14eba8021a60, offsets=offsets@entry=0x14ebe5f73c60, n_cmp=3, matched_fields=matched_fields@entry=0x14ebe5f73ec0) at /test/10.11_dbg/storage/innobase/include/dict0mem.h:1207 #7 0x000055c52493ec90 in page_cur_search_with_match (block=block@entry=0x14ec009dcd80, index=index@entry=0x14eba8021a60, tuple=tuple@entry=0x14eba8020ed0, mode=mode@entry=PAGE_CUR_LE, iup_matched_fields=iup_matched_fields@entry=0x14ebe5f74758, ilow_matched_fields=ilow_matched_fields@entry=0x14ebe5f74768, cursor=0x14ebe5f753f8, rtr_info=0x0) at /test/10.11_dbg/storage/innobase/include/data0data.inl:253 #8 0x000055c524ada649 in btr_cur_search_to_nth_level_func (index=index@entry=0x14eba8021a60, level=level@entry=0, tuple=tuple@entry=0x14eba8020ed0, mode=mode@entry=PAGE_CUR_LE, latch_mode=<optimized out>, latch_mode@entry=2114, cursor=cursor@entry=0x14ebe5f753f0, ahi_latch=<optimized out>, mtr=<optimized out>, autoinc=<optimized out>) at /test/10.11_dbg/storage/innobase/btr/btr0cur.cc:1943 #9 0x000055c5249b4b51 in row_ins_sec_index_entry_low (flags=flags@entry=0, mode=mode@entry=2, index=index@entry=0x14eba8021a60, offsets_heap=<optimized out>, offsets_heap@entry=0x14eba806fc10, heap=heap@entry=0x14eba80700a0, entry=entry@entry=0x14eba8020ed0, trx_id=0, thr=0x14eba8029910) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:2942 #10 0x000055c5249b6aa2 in row_ins_sec_index_entry (index=index@entry=0x14eba8021a60, entry=entry@entry=0x14eba8020ed0, thr=thr@entry=0x14eba8029910, check_foreign=check_foreign@entry=true) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3251 #11 0x000055c5249bb86c in row_ins_index_entry (thr=0x14eba8029910, entry=0x14eba8020ed0, index=0x14eba8021a60) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3310 #12 row_ins_index_entry_step (thr=0x14eba8029910, node=<optimized out>) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3476 #13 row_ins (thr=0x14eba8029910, node=<optimized out>) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3622 #14 row_ins_step (thr=thr@entry=0x14eba8029910) at /test/10.11_dbg/storage/innobase/row/row0ins.cc:3762 #15 0x000055c5249dddd1 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x14eba801eb58 "\374\061\060", '\245' <repeats 13 times>, "\250\353\001\250\353\024", prebuilt=0x14eba80291c0, ins_mode=ROW_INS_NORMAL) at /test/10.11_dbg/storage/innobase/row/row0mysql.cc:1313 #16 0x000055c52486b1e1 in ha_innobase::write_row (this=0x14eba8028970, record=0x14eba801eb58 "\374\061\060", '\245' <repeats 13 times>, "\250\353\001\250\353\024") at /test/10.11_dbg/storage/innobase/handler/ha_innodb.cc:7855 #17 0x000055c5245544b7 in handler::ha_write_row (this=0x14eba8028970, buf=0x14eba801eb58 "\374\061\060", '\245' <repeats 13 times>, "\250\353\001\250\353\024") at /test/10.11_dbg/sql/handler.cc:7577 #18 0x000055c52421360c in write_record (thd=thd@entry=0x14eba8000db8, table=table@entry=0x14eba801e258, info=info@entry=0x14ebe5f76c30, sink=sink@entry=0x0) at /test/10.11_dbg/sql/sql_insert.cc:2191 #19 0x000055c52421e188 in mysql_insert (thd=thd@entry=0x14eba8000db8, table_list=<optimized out>, fields=@0x14eba8005ea8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55c525825c20 <end_of_list>, last = 0x14eba8005ea8, elements = 0}, <No data fields>}, values_list=@0x14eba8005ef0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14eba8014a00, last = 0x14eba8015068, elements = 6}, <No data fields>}, update_fields=@0x14eba8005ed8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55c525825c20 <end_of_list>, last = 0x14eba8005ed8, elements = 0}, <No data fields>}, update_values=@0x14eba8005ec0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55c525825c20 <end_of_list>, last = 0x14eba8005ec0, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=true, result=0x0) at /test/10.11_dbg/sql/sql_insert.cc:1146 #20 0x000055c52426124c in mysql_execute_command (thd=thd@entry=0x14eba8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:4563 #21 0x000055c52424d882 in mysql_parse (thd=thd@entry=0x14eba8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ebe5f77330) at /test/10.11_dbg/sql/sql_parse.cc:8035 #22 0x000055c52425ae6a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14eba8000db8, packet=packet@entry=0x14eba800b6e9 "INSERT IGNORE INTO t VALUES (1,0),(1,0),(0,0),(0,0),(0,0),(0,0)", packet_length=packet_length@entry=63, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1339 #23 0x000055c52425d574 in do_command (thd=0x14eba8000db8, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407 #24 0x000055c5243bf1da in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c52765ec08, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1418 #25 0x000055c5243bf6e3 in handle_one_connection (arg=0x55c52765ec08) at /test/10.11_dbg/sql/sql_connect.cc:1312 #26 0x000014ec0345c609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #27 0x000014ec03048133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.2 (dbg), 10.10.2 (dbg), 10.11.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.2 (opt), 10.10.2 (opt), 10.11.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt) (cs->state & 0x20000) == 0|SIGABRT|my_strnncollsp_nchars_generic_8bit|cmp_data|cmp_dtuple_rec_with_match_low|page_cur_search_with_match

            A similar crash in my_strnncollsp_nchars_generic_8bit happens with this script:

            CREATE OR REPLACE TABLE t1
            (
              id INT NOT NULL,
              data VARCHAR(2),
              KEY data_id (data(1),id)
            ) COLLATE tis620_thai_nopad_ci ENGINE=MyISAM
            PARTITION BY RANGE (id)
            (
              PARTITION p10 VALUES LESS THAN (10),
              PARTITION p20 VALUES LESS THAN (20)
            );
            INSERT INTO t1 VALUES (4, 'ab'), (14, 'ab'), (19,''),(9,'') ;
            SELECT id FROM t1 WHERE data='' ORDER BY id;
            DROP TABLE t1;
            

            bar Alexander Barkov added a comment - A similar crash in my_strnncollsp_nchars_generic_8bit happens with this script: CREATE OR REPLACE TABLE t1 ( id INT NOT NULL , data VARCHAR (2), KEY data_id (data(1),id) ) COLLATE tis620_thai_nopad_ci ENGINE=MyISAM PARTITION BY RANGE (id) ( PARTITION p10 VALUES LESS THAN (10), PARTITION p20 VALUES LESS THAN (20) ); INSERT INTO t1 VALUES (4, 'ab' ), (14, 'ab' ), (19, '' ),(9, '' ) ; SELECT id FROM t1 WHERE data= '' ORDER BY id; DROP TABLE t1;

            People

              bar Alexander Barkov
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.