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

Assertion `thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_stmt_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed

    XMLWordPrintable

Details

    Description

      The given test case crashes the server even after fixing the issues MDEV-32956/MDEV-32965

      CREATE TABLE t (a INT);
      PREPARE s FROM 'SELECT GROUP_CONCAT(t.a ORDER BY t.a) FROM t JOIN t t2 GROUP BY t.a WITH ROLLUP';
      EXECUTE s;
      SET NAMES utf8;
      EXECUTE s;
      

      Leads to:

      11.3.2 63fb478f88e0061d149f5cdd3c4d21d4a35c7bd9 (Debug)

      mariadbd: /test/11.3_dbg/sql/item_sum.cc:4295: virtual bool Item_func_group_concat::fix_fields(THD*, Item**): Assertion `thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_stmt_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed.
      

      11.3.2 63fb478f88e0061d149f5cdd3c4d21d4a35c7bd9 (Debug)

      Core was generated by `/test/MD020124-mariadb-11.3.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
      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 0x14ba5810c700 (LWP 1542848))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014ba6dfa9859 in __GI_abort () at abort.c:79
      #2  0x000014ba6dfa9729 in __assert_fail_base (fmt=0x14ba6e13f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5556fa9102a0 "thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_stmt_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY"..., file=0x5556fa90f930 "/test/11.3_dbg/sql/item_sum.cc", line=4295, function=<optimized out>) at assert.c:92
      #3  0x000014ba6dfbafd6 in __GI___assert_fail (assertion=assertion@entry=0x5556fa9102a0 "thd->active_stmt_arena_to_use()-> is_stmt_prepare_or_first_stmt_execute() || thd->active_stmt_arena_to_use()-> is_conventional() || thd->active_stmt_arena_to_use()->state == Query_arena::STMT_SP_QUERY"..., file=file@entry=0x5556fa90f930 "/test/11.3_dbg/sql/item_sum.cc", line=line@entry=4295, function=function@entry=0x5556fa910260 "virtual bool Item_func_group_concat::fix_fields(THD*, Item**)") at assert.c:101
      #4  0x00005556f9f04c1f in Item_func_group_concat::fix_fields (this=0x14ba2802a120, thd=0x14ba28000d48, ref=0x14ba2802a5a8) at /test/11.3_dbg/sql/sql_class.h:3374
      #5  0x00005556f9a2ce8e in Item::fix_fields_if_needed (ref=0x14ba2802a5a8, thd=0x14ba28000d48, this=0x14ba2802a120) at /test/11.3_dbg/sql/item.h:1162
      #6  Item::fix_fields_if_needed_for_scalar (ref=0x14ba2802a5a8, thd=0x14ba28000d48, this=0x14ba2802a120) at /test/11.3_dbg/sql/item.h:1162
      #7  setup_fields (thd=0x14ba28000d48, ref_pointer_array=<optimized out>, fields=<optimized out>, column_usage=<optimized out>, sum_func_list=sum_func_list@entry=0x14ba280139d0, pre_fix=0x14ba28029c28, allow_sum_func=true) at /test/11.3_dbg/sql/sql_base.cc:8084
      #8  0x00005556f9b2e5f9 in JOIN::prepare (this=this@entry=0x14ba28013628, tables_init=tables_init@entry=0x14ba2802a648, conds_init=conds_init@entry=0x0, og_num=og_num@entry=1, order_init=order_init@entry=0x0, skip_order_by=skip_order_by@entry=false, group_init=0x14ba2802bdc8, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x14ba28029958, unit_arg=0x14ba28027bf8) at /test/11.3_dbg/sql/sql_select.cc:1549
      #9  0x00005556f9b46fa1 in mysql_select (thd=thd@entry=0x14ba28000d48, tables=0x14ba2802a648, fields=@0x14ba28029c10: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14ba2802a5a0, last = 0x14ba2802a5a0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x14ba2802bdc8, having=0x0, proc_param=0x0, select_options=2201187781376, result=0x14ba2802c678, unit=0x14ba28027bf8, select_lex=0x14ba28029958) at /test/11.3_dbg/sql/sql_select.cc:5278
      #10 0x00005556f9b471cb in handle_select (thd=thd@entry=0x14ba28000d48, lex=lex@entry=0x14ba28027b18, result=result@entry=0x14ba2802c678, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/11.3_dbg/sql/sql_select.cc:630
      #11 0x00005556f9aa699a in execute_sqlcom_select (thd=thd@entry=0x14ba28000d48, all_tables=0x14ba2802a648) at /test/11.3_dbg/sql/sql_parse.cc:6077
      #12 0x00005556f9ab3493 in mysql_execute_command (thd=0x14ba28000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /test/11.3_dbg/sql/sql_parse.cc:3926
      #13 0x00005556f9adcfa3 in Prepared_statement::execute (this=this@entry=0x14ba28022ef8, expanded_query=expanded_query@entry=0x14ba5810ab70, open_cursor=open_cursor@entry=false) at /test/11.3_dbg/sql/sql_prepare.cc:5077
      #14 0x00005556f9add345 in Prepared_statement::execute_loop (this=this@entry=0x14ba28022ef8, expanded_query=expanded_query@entry=0x14ba5810ab70, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /test/11.3_dbg/sql/sql_prepare.cc:4461
      #15 0x00005556f9add7d1 in mysql_sql_stmt_execute (thd=thd@entry=0x14ba28000d48) at /test/11.3_dbg/sql/sql_prepare.cc:3480
      #16 0x00005556f9ab34f3 in mysql_execute_command (thd=thd@entry=0x14ba28000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.3_dbg/sql/sql_parse.cc:3942
      #17 0x00005556f9aa090a in mysql_parse (thd=thd@entry=0x14ba28000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ba5810b2b0) at /test/11.3_dbg/sql/sql_parse.cc:7798
      #18 0x00005556f9aae7f2 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14ba28000d48, packet=packet@entry=0x14ba2800b1b9 "EXECUTE s", packet_length=packet_length@entry=9, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_class.h:1550
      #19 0x00005556f9ab0f1e in do_command (thd=0x14ba28000d48, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_parse.cc:1406
      #20 0x00005556f9c2ba5d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5556fc35eb48, put_in_cache=put_in_cache@entry=true) at /test/11.3_dbg/sql/sql_connect.cc:1417
      #21 0x00005556f9c2c012 in handle_one_connection (arg=arg@entry=0x5556fc35eb48) at /test/11.3_dbg/sql/sql_connect.cc:1319
      #22 0x00005556fa09a02c in pfs_spawn_thread (arg=0x5556fc2d55c8) at /test/11.3_dbg/storage/perfschema/pfs.cc:2201
      #23 0x000014ba6e4ba609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #24 0x000014ba6e0a6133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.33 (dbg), 10.5.24 (dbg), 10.6.17 (dbg), 10.11.7 (dbg), 11.0.5 (dbg), 11.1.4 (dbg), 11.2.3 (dbg), 11.3.2 (dbg), 11.4.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.33 (opt), 10.5.24 (opt), 10.6.17 (opt), 10.11.7 (opt), 11.0.5 (opt), 11.1.4 (opt), 11.2.3 (opt), 11.3.2 (opt), 11.4.0 (opt)

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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