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

SHOW EXPLAIN: Server crashes in JOIN::print_explain with FROM subquery and GROUP BY

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 10.0.0
    • None
    • None

    Description

      #2  0x000000000088a866 in handle_fatal_signal (sig=11) at signal_handler.cc:272
      #3  <signal handler called>
      #4  0x00000000007a8914 in JOIN::print_explain (this=0x7fcc440158f8, result=0x22ccba8, 
          on_the_fly=true, need_tmp_table=false, need_order=false, distinct=false, message=0x0)
          at sql_select.cc:21294
      #5  0x00000000005d5fdf in st_select_lex::print_explain (this=0x7fcc4d46ce08, 
          output=0x22ccba8) at sql_lex.cc:3758
      #6  0x00000000005d613e in st_select_lex_unit::print_explain (this=0x7fcc4d46c900, 
          output=0x22ccba8) at sql_lex.cc:3807
      #7  0x00000000006cca6c in Show_explain_request::get_explain_data (arg=0x7fcc351bcba0)
          at sql_class.cc:3042
      #8  0x000000000095b035 in Apc_target::process_apc_requests (this=0x7fcc4d46c670)
          at my_apc.cc:255
      #9  0x00000000006c88dc in THD::check_killed (this=0x7fcc4d46a358) at sql_class.cc:1904
      #10 0x0000000000868fdd in find_all_keys (param=0x7fcc352042f0, select=0x0, 
          sort_keys=0x7fcc4403d288, sort_keys_buf=0x7fcc4403d2f0 "", 
          buffpek_pointers=0x7fcc35203fd0, tempfile=0x7fcc35204160, indexfile=0x0)
          at filesort.cc:591
      #11 0x0000000000867e7d in filesort (thd=0x7fcc4d46a358, table=0x7fcc4403ad50, 
          sortorder=0x7fcc4401a3a8, s_length=1, select=0x0, max_rows=18446744073709551615, 
          sort_positions=false, examined_rows=0x7fcc352044e8) at filesort.cc:244
      #12 0x00000000007a2008 in create_sort_index (thd=0x7fcc4d46a358, join=0x7fcc440158f8, 
          order=0x21fa168, filesort_limit=18446744073709551615, 
          select_limit=18446744073709551615, is_order_by=false) at sql_select.cc:18731
      #13 0x000000000077a558 in JOIN::exec_inner (this=0x7fcc440158f8) at sql_select.cc:2751
      #14 0x0000000000777cd3 in JOIN::exec (this=0x7fcc440158f8) at sql_select.cc:2125
      #15 0x000000000077b125 in mysql_select (thd=0x7fcc4d46a358, 
          rref_pointer_array=0x7fcc4d46d060, tables=0x21f8568, wild_num=0, fields=..., conds=
          0x0, og_num=1, order=0x0, group=0x21fa168, having=0x0, proc_param=0x0, 
          select_options=2147764736, result=0x21fa248, unit=0x7fcc4d46c900, 
          select_lex=0x7fcc4d46ce08) at sql_select.cc:3023
      #16 0x0000000000771c0a in handle_select (thd=0x7fcc4d46a358, lex=0x7fcc4d46c860, 
          result=0x21fa248, setup_tables_done_option=0) at sql_select.cc:332
      #17 0x0000000000700181 in execute_sqlcom_select (thd=0x7fcc4d46a358, 
          all_tables=0x21f8568) at sql_parse.cc:5178
      #18 0x00000000006f70c7 in mysql_execute_command (thd=0x7fcc4d46a358) at sql_parse.cc:2285
      #19 0x0000000000702b5c in mysql_parse (thd=0x7fcc4d46a358, 
      ---Type <return> to continue, or q <return> to quit---
          rawbuf=0x21f8310 "SELECT alias.a FROM A, ( SELECT * FROM A ) AS alias GROUP BY alias.a", length=68, found_semicolon=0x7fcc35205c98) at sql_parse.cc:6179
      #20 0x00000000006f4876 in dispatch_command (command=COM_QUERY, thd=0x7fcc4d46a358, 
          packet=0x7fcc4d472559 "SELECT alias.a FROM A, ( SELECT * FROM A ) AS alias GROUP BY alias.a", packet_length=68) at sql_parse.cc:1229
      #21 0x00000000006f3baa in do_command (thd=0x7fcc4d46a358) at sql_parse.cc:924
      #22 0x00000000006f09ee in handle_one_connection (arg=0x7fcc4d46a358)
          at sql_connect.cc:1218

      Query (0x21f8310): SELECT alias.a FROM A, ( SELECT * FROM A ) AS alias GROUP BY alias.a
      Connection ID (thread ID): 5
      Status: NOT_KILLED

      optimizer_switch (default):

      index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on

      bzr version-info

      revision-id: psergey@askmonty.org-20120426031831-0iujnre01v3tlwkf
      date: 2012-04-26 08:48:31 +0530
      build-date: 2012-05-01 04:17:19 +0300
      revno: 3504

      Grammar to reproduce:

      thread1_init:
        CREATE TABLE A ( a INT ) ENGINE=MyISAM; INSERT INTO A VALUES (1),(2),(1),(4),(2);
       
      thread2_init:
        SET @con_id = CONNECTION_ID()-1;
       
      query:
        SELECT alias.a FROM A, ( SELECT * FROM A ) AS alias GROUP BY alias.a ;
       
      thread2:
        SHOW EXPLAIN FOR @con_id;

      Run as:

      perl ./runall.pl \
      --queries=100M \
      --threads=2 \
      --duration=600 \
      --grammar=1.yy \
      --skip-gendata \
      --basedir=<basedir> \ 
      --vardir=<vardir>

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.