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

Assertion `escape != -1' failed in Item_func_like::val_int

    XMLWordPrintable

Details

    Description

      SOURCE MDEV-25610.sql;     # Attached to bug
      

      Leads to:

      10.6.1 9db14e93acc4ec9023d50686c66dbef7d4d8c15c (Debug)

      mysqld: /test/10.6_dbg/sql/item_cmpfunc.cc:5619: virtual longlong Item_func_like::val_int(): Assertion `escape != -1' failed.
      

      10.6.1 9db14e93acc4ec9023d50686c66dbef7d4d8c15c (Debug)

      Core was generated by `/test/MD270421-mariadb-10.6.1-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 0x14e398bf0700 (LWP 1770553))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014e3a2055859 in __GI_abort () at abort.c:79
      #2  0x000014e3a2055729 in __assert_fail_base (fmt=0x14e3a21eb588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55d9ac89ffc4 "escape != -1", file=0x55d9ac89ffe0 "/test/10.6_dbg/sql/item_cmpfunc.cc", line=5619, function=<optimized out>) at assert.c:92
      #3  0x000014e3a2066f36 in __GI___assert_fail (assertion=assertion@entry=0x55d9ac89ffc4 "escape != -1", file=file@entry=0x55d9ac89ffe0 "/test/10.6_dbg/sql/item_cmpfunc.cc", line=line@entry=5619, function=function@entry=0x55d9ac8a1cf0 "virtual longlong Item_func_like::val_int()") at assert.c:101
      #4  0x000055d9abd9850e in Item_func_like::val_int (this=0x14e3500146d8) at /test/10.6_dbg/sql/item_cmpfunc.cc:5619
      #5  0x000055d9abc5dff9 in Type_handler::Item_send_long (this=<optimized out>, item=0x14e3500146d8, protocol=0x14e3500013a0, buf=<optimized out>) at /test/10.6_dbg/sql/sql_type.cc:7467
      #6  0x000055d9abc67309 in Type_handler_long::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.6_dbg/sql/sql_type.h:5675
      #7  0x000055d9ab9661a8 in Item::send (this=0x14e3500146d8, protocol=0x14e3500013a0, buffer=0x14e398bee390) at /test/10.6_dbg/sql/item.h:1076
      #8  0x000055d9ab9638bc in Protocol::send_result_set_row (this=this@entry=0x14e3500013a0, row_items=row_items@entry=0x14e3500141c0) at /test/10.6_dbg/sql/protocol.cc:1331
      #9  0x000055d9ab9f9fa1 in select_send::send_data (this=0x14e350015150, items=@0x14e3500141c0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14e350014838, last = 0x14e350014838, elements = 1}, <No data fields>}) at /test/10.6_dbg/sql/sql_class.cc:3020
      #10 0x000055d9abaead4a in select_result_sink::send_data_with_check (sent=0, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.6_dbg/sql/sql_class.h:5568
      #11 JOIN::exec_inner (this=this@entry=0x14e350015178) at /test/10.6_dbg/sql/sql_select.cc:4466
      #12 0x000055d9abaebda6 in JOIN::exec (this=this@entry=0x14e350015178) at /test/10.6_dbg/sql/sql_select.cc:4378
      #13 0x000055d9abae9e82 in mysql_select (thd=thd@entry=0x14e350000db8, tables=0x0, fields=@0x14e3500141c0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14e350014838, last = 0x14e350014838, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14e350015150, unit=0x14e350005118, select_lex=0x14e350014068) at /test/10.6_dbg/sql/sql_select.cc:4854
      #14 0x000055d9abaea148 in handle_select (thd=thd@entry=0x14e350000db8, lex=lex@entry=0x14e350005050, result=result@entry=0x14e350015150, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:446
      #15 0x000055d9aba5ce55 in execute_sqlcom_select (thd=thd@entry=0x14e350000db8, all_tables=0x0) at /test/10.6_dbg/sql/sql_parse.cc:6244
      #16 0x000055d9aba69d4e in mysql_execute_command (thd=thd@entry=0x14e350000db8) at /test/10.6_dbg/sql/sql_parse.cc:3940
      #17 0x000055d9aba55f81 in mysql_parse (thd=thd@entry=0x14e350000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14e398bef410) at /test/10.6_dbg/sql/sql_parse.cc:8018
      #18 0x000055d9aba64db3 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14e350000db8, packet=packet@entry=0x14e35000b789 "", packet_length=packet_length@entry=28, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1332
      #19 0x000055d9aba681a6 in do_command (thd=0x14e350000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1406
      #20 0x000055d9abbc2a6a in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55d9af6c5a28, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
      #21 0x000055d9abbc306f in handle_one_connection (arg=arg@entry=0x55d9af6c5a28) at /test/10.6_dbg/sql/sql_connect.cc:1312
      #22 0x000055d9ac0752ca in pfs_spawn_thread (arg=0x55d9af5af348) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
      #23 0x000014e3a2563609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #24 0x000014e3a2152293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      A bit different stack on 10.5 (note Type_handler::Item_send_long):

      10.5.10 dd07cfcecd4aabb0aeae9c4f5087f82b4080c1bd (Debug)

      mysqld: /test/10.5_dbg/sql/item_cmpfunc.cc:5619: virtual longlong Item_func_like::val_int(): Assertion `escape != -1' failed.
      

      10.5.10 dd07cfcecd4aabb0aeae9c4f5087f82b4080c1bd (Debug)

      Core was generated by `/test/MD270421-mariadb-10.5.10-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 0x151478818700 (LWP 1188881))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000151481c7d859 in __GI_abort () at abort.c:79
      #2  0x0000151481c7d729 in __assert_fail_base (fmt=0x151481e13588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55d6040c8ea4 "escape != -1", file=0x55d6040c8ec0 "/test/10.5_dbg/sql/item_cmpfunc.cc", line=5619, function=<optimized out>) at assert.c:92
      #3  0x0000151481c8ef36 in __GI___assert_fail (assertion=assertion@entry=0x55d6040c8ea4 "escape != -1", file=file@entry=0x55d6040c8ec0 "/test/10.5_dbg/sql/item_cmpfunc.cc", line=line@entry=5619, function=function@entry=0x55d6040cabd0 "virtual longlong Item_func_like::val_int()") at assert.c:101
      #4  0x000055d60357bf68 in Item_func_like::val_int (this=0x15141c0143d8) at /test/10.5_dbg/sql/item_cmpfunc.cc:5619
      #5  0x000055d6034453a7 in Type_handler::Item_send_long (this=<optimized out>, item=0x15141c0143d8, protocol=0x15141c001390, buf=<optimized out>) at /test/10.5_dbg/sql/sql_type.cc:7467
      #6  0x000055d60344e6b7 in Type_handler_long::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.5_dbg/sql/sql_type.h:5675
      #7  0x000055d6031442f6 in Item::send (this=0x15141c0143d8, protocol=0x15141c001390, buffer=0x151478816320) at /test/10.5_dbg/sql/item.h:1066
      #8  0x000055d603141812 in Protocol::send_result_set_row (this=this@entry=0x15141c001390, row_items=row_items@entry=0x15141c013ec8) at /test/10.5_dbg/sql/protocol.cc:1085
      #9  0x000055d6031db57d in select_send::send_data (this=0x15141c014e40, items=@0x15141c013ec8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15141c014538, last = 0x15141c014538, elements = 1}, <No data fields>}) at /test/10.5_dbg/sql/sql_class.cc:3018
      #10 0x000055d6032ce61f in select_result_sink::send_data_with_check (sent=0, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.5_dbg/sql/sql_class.h:5341
      #11 JOIN::exec_inner (this=this@entry=0x15141c014e68) at /test/10.5_dbg/sql/sql_select.cc:4362
      #12 0x000055d6032cf67c in JOIN::exec (this=this@entry=0x15141c014e68) at /test/10.5_dbg/sql/sql_select.cc:4274
      #13 0x000055d6032cd755 in mysql_select (thd=thd@entry=0x15141c000db8, tables=0x0, fields=@0x15141c013ec8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15141c014538, last = 0x15141c014538, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x15141c014e40, unit=0x15141c004f68, select_lex=0x15141c013d78) at /test/10.5_dbg/sql/sql_select.cc:4750
      #14 0x000055d6032cda1b in handle_select (thd=thd@entry=0x15141c000db8, lex=lex@entry=0x15141c004ea0, result=result@entry=0x15141c014e40, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:443
      #15 0x000055d60323f3ba in execute_sqlcom_select (thd=thd@entry=0x15141c000db8, all_tables=0x0) at /test/10.5_dbg/sql/sql_parse.cc:6313
      #16 0x000055d60324c937 in mysql_execute_command (thd=thd@entry=0x15141c000db8) at /test/10.5_dbg/sql/sql_parse.cc:4009
      #17 0x000055d60323834f in mysql_parse (thd=thd@entry=0x15141c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1514788173d0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8099
      #18 0x000055d603247565 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x15141c000db8, packet=packet@entry=0x15141c00b499 "", packet_length=packet_length@entry=28, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1270
      #19 0x000055d60324adea in do_command (thd=0x15141c000db8) at /test/10.5_dbg/sql/sql_parse.cc:1370
      #20 0x000055d6033a7379 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55d607c3e3f8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
      #21 0x000055d6033a7a7d in handle_one_connection (arg=arg@entry=0x55d607c3e3f8) at /test/10.5_dbg/sql/sql_connect.cc:1312
      #22 0x000055d603860885 in pfs_spawn_thread (arg=0x55d607b793c8) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #23 0x000015148218b609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #24 0x0000151481d7a293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.38 (dbg), 10.3.29 (dbg), 10.4.19 (dbg), 10.5.10 (dbg), 10.6.1 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.38 (opt), 10.3.29 (opt), 10.4.19 (opt), 10.5.10 (opt), 10.6.1 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.34 (dbg), 5.7.34 (opt), 8.0.24 (dbg), 8.0.24 (opt)

      Attachments

        Activity

          People

            bar Alexander Barkov
            Roel Roel Van de Paar
            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.