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

Server crash on selecting some data from information_schema

Details

    • Bug
    • Status: In Review (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 10.6.4, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.4, 11.8
    • 10.5, 10.6, 10.11, 11.4, 11.8
    • Prepared Statements
    • Linux Ubuntu 20.04.3 LTS, 5.4.0-88-generic
      MariaDB 10.6.4

    Description

      I have two queries that return some data from information_schema about table structures and foreign keys (sql.txt).
      But once per 5-6 executions mariadb-server crashed and goes to restart.
      Same logs are appear in journalctl (log.txt).
      Executing CALL `forms_data_columns`('', 'U') cause crash each even times.

      Reproduce

      create table t1 (i int);
       
      prepare stmt from " SELECT x FROM
       ( SELECT i AS y, (SELECT y FROM t1 LIMIT 1 ) AS x FROM  t1 a) dt;";
       
      execute stmt;
      execute stmt;
      

      Result

      #12 0x00007ef53d039206 in __assert_fail (assertion=0x56c024ff175b "(*select_ref)->is_fixed()", file=0x56c024f1cdec "../src/sql/item.cc", line=5681, function=0x56c024f2bba2 "Item **resolve_ref_in_select_and_group(THD *, Item_ident *, SELECT_LEX *)") at ./assert/assert.c:101
      #13 0x000056c0256558bc in resolve_ref_in_select_and_group (thd=0x7ef51c000d58, ref=0x7ef51c11a0d0, select=0x7ef51c1195c0) at ../src/sql/item.cc:5681
      #14 0x000056c025654acd in Item_field::fix_outer_field (this=0x7ef51c11a0d0, thd=0x7ef51c000d58, from_field=0x7ef5382bbbd8, reference=0x7ef51c11a218) at ../src/sql/item.cc:5959
      #15 0x000056c025655ea6 in Item_field::fix_fields (this=0x7ef51c11a0d0, thd=0x7ef51c000d58, reference=0x7ef51c11a218) at ../src/sql/item.cc:6248
      #16 0x000056c02562e5c1 in Item::fix_fields_if_needed (this=0x7ef51c11a0d0, thd=0x7ef51c000d58, ref=0x7ef51c11a218) at ../src/sql/item.h:1005
      #17 0x000056c025631ba9 in Item::fix_fields_if_needed_for_scalar (this=0x7ef51c11a0d0, thd=0x7ef51c000d58, ref=0x7ef51c11a218) at ../src/sql/item.h:1009
      #18 0x000056c0258789fe in setup_fields (thd=0x7ef51c000d58, ref_pointer_array=..., fields=..., column_usage=MARK_COLUMNS_READ, sum_func_list=0x7ef51c014750, pre_fix=0x7ef51c119d78, allow_sum_func=true) at ../src/sql/sql_base.cc:7693
      #19 0x000056c025a1f78b in JOIN::prepare (this=0x7ef51c014418, tables_init=0x7ef51c11a258, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7ef51c119bf8, unit_arg=0x7ef51c11a980) at ../src/sql/sql_select.cc:1375
      #20 0x000056c02590698b in subselect_single_select_engine::prepare (this=0x7ef51c11b430, thd=0x7ef51c000d58) at ../src/sql/item_subselect.cc:3883
      #21 0x000056c0258f63fd in Item_subselect::fix_fields (this=0x7ef51c11b288, thd_param=0x7ef51c000d58, ref=0x7ef51c11cda8) at ../src/sql/item_subselect.cc:293
      #22 0x000056c025b2e003 in create_view_field (thd=0x7ef51c000d58, view=0x7ef51c11c478, field_ref=0x7ef51c11cda8, name=0x7ef51c11cdb0) at ../src/sql/table.cc:6937
      #23 0x000056c025b2e9fd in Field_iterator_view::create_item (this=0x7ef5382bc5a0, thd=0x7ef51c000d58) at ../src/sql/table.cc:6912
      #24 0x000056c02587529a in find_field_in_view (thd=0x7ef51c000d58, table_list=0x7ef51c11c478, name=0x7ef51c119468 "x", length=1, item_name=0x7ef51c119468 "x", ref=0x7ef51c1195b8, register_tree_change=true) at ../src/sql/sql_base.cc:5816
      #25 0x000056c025874b01 in find_field_in_table_ref (thd=0x7ef51c000d58, table_list=0x7ef51c11c478, name=0x7ef51c119468 "x", length=1, item_name=0x7ef51c119468 "x", db_name=0x0, table_name=0x0, ref=0x7ef51c1195b8, check_privileges=true, allow_rowid=true, cached_field_index_ptr=0x7ef51c11956c, register_tree_change=true, actual_table=0x7ef5382bcbc0) at ../src/sql/sql_base.cc:6156
      #26 0x000056c0258761bf in find_field_in_tables (thd=0x7ef51c000d58, item=0x7ef51c119470, first_table=0x7ef51c11c478, last_table=0x0, ref=0x7ef51c1195b8, report_error=IGNORE_EXCEPT_NON_UNIQUE, check_privileges=true, register_tree_change=true) at ../src/sql/sql_base.cc:6392
      #27 0x000056c025655b40 in Item_field::fix_fields (this=0x7ef51c119470, thd=0x7ef51c000d58, reference=0x7ef51c1195b8) at ../src/sql/item.cc:6157
      #28 0x000056c02562e5c1 in Item::fix_fields_if_needed (this=0x7ef51c119470, thd=0x7ef51c000d58, ref=0x7ef51c1195b8) at ../src/sql/item.h:1005
      #29 0x000056c025631ba9 in Item::fix_fields_if_needed_for_scalar (this=0x7ef51c119470, thd=0x7ef51c000d58, ref=0x7ef51c1195b8) at ../src/sql/item.h:1009
      #30 0x000056c0258789fe in setup_fields (thd=0x7ef51c000d58, ref_pointer_array=..., fields=..., column_usage=MARK_COLUMNS_READ, sum_func_list=0x7ef51c014038, pre_fix=0x7ef51c119118, allow_sum_func=true) at ../src/sql/sql_base.cc:7693
      #31 0x000056c025a1f78b in JOIN::prepare (this=0x7ef51c013d00, tables_init=0x7ef51c11c478, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7ef51c118f98, unit_arg=0x7ef51c117350) at ../src/sql/sql_select.cc:1375
      #32 0x000056c025a1b67d in mysql_select (thd=0x7ef51c000d58, tables=0x7ef51c11c478, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2201171004160, result=0x7ef51c11cba8, unit=0x7ef51c117350, select_lex=0x7ef51c118f98) at ../src/sql/sql_select.cc:4897
      #33 0x000056c025a1b073 in handle_select (thd=0x7ef51c000d58, lex=0x7ef51c117288, result=0x7ef51c11cba8, setup_tables_done_option=0) at ../src/sql/sql_select.cc:449
      #34 0x000056c0259c2ed0 in execute_sqlcom_select (thd=0x7ef51c000d58, all_tables=0x7ef51c11c478) at ../src/sql/sql_parse.cc:6452
      #35 0x000056c0259ba144 in mysql_execute_command (thd=0x7ef51c000d58) at ../src/sql/sql_parse.cc:4043
      #36 0x000056c0259ff068 in Prepared_statement::execute (this=0x7ef51c1e23e8, expanded_query=0x7ef5382bf2f0, open_cursor=false) at ../src/sql/sql_prepare.cc:5138
      #37 0x000056c0259fb07c in Prepared_statement::execute_loop (this=0x7ef51c1e23e8, expanded_query=0x7ef5382bf2f0, open_cursor=false, packet=0x0, packet_end=0x0) at ../src/sql/sql_prepare.cc:4560
      #38 0x000056c0259fac86 in mysql_sql_stmt_execute (thd=0x7ef51c000d58) at ../src/sql/sql_prepare.cc:3607
      #39 0x000056c0259ba188 in mysql_execute_command (thd=0x7ef51c000d58) at ../src/sql/sql_parse.cc:4059
      #40 0x000056c0259b3e94 in mysql_parse (thd=0x7ef51c000d58, rawbuf=0x7ef51c013ae0 "execute stmt", length=12, parser_state=0x7ef5382c1438, is_com_multi=false, is_next_command=false) at ../src/sql/sql_parse.cc:8252
      

      Attachments

        1. log.txt
          19 kB
        2. sql.txt
          3 kB

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              RiddlerX2 Andrey Timofeev
              Votes:
              1 Vote for this issue
              Watchers:
              7 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.