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

Server crashes in first_linear_tab / st_select_lex::set_explain_type upon UNION with aggregate function

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (i INT) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (1),(2);
      SELECT i AS fld FROM t1 UNION SELECT COUNT(*) AS fld FROM t1;
      

      10.2 2a1035b004dfabcf3a7113be632b0030721a44d6

      #3  <signal handler called>
      #4  0x00007f08af0aa166 in first_linear_tab (join=0x7f088c014450, include_bush_roots=WITHOUT_BUSH_ROOTS, const_tbls=WITH_CONST_TABLES) at /data/src/10.2/sql/sql_select.cc:8659
      #5  0x00007f08af045419 in st_select_lex::set_explain_type (this=0x7f088c012be8, on_the_fly=true) at /data/src/10.2/sql/sql_lex.cc:4399
      #6  0x00007f08af0d2312 in JOIN::save_explain_data_intern (this=0x7f088c014450, output=0x7f088c016100, need_tmp_table_arg=false, need_order_arg=false, distinct_arg=false, message=0x7f08afac5e19 "Select tables optimized away") at /data/src/10.2/sql/sql_select.cc:24674
      #7  0x00007f08af09b7df in JOIN::save_explain_data (this=0x7f088c014450, output=0x7f088c016100, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false) at /data/src/10.2/sql/sql_select.cc:3240
      #8  0x00007f08af093cd0 in JOIN::optimize (this=0x7f088c014450) at /data/src/10.2/sql/sql_select.cc:1093
      #9  0x00007f08af1389a4 in st_select_lex_unit::optimize (this=0x7f088c0045e8) at /data/src/10.2/sql/sql_union.cc:906
      #10 0x00007f08af138bdb in st_select_lex_unit::exec (this=0x7f088c0045e8) at /data/src/10.2/sql/sql_union.cc:940
      #11 0x00007f08af135afc in mysql_union (thd=0x7f088c000b00, lex=0x7f088c004520, result=0x7f088c013cc0, unit=0x7f088c0045e8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:41
      #12 0x00007f08af091452 in handle_select (thd=0x7f088c000b00, lex=0x7f088c004520, result=0x7f088c013cc0, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #13 0x00007f08af05d3ea in execute_sqlcom_select (thd=0x7f088c000b00, all_tables=0x7f088c0125c0) at /data/src/10.2/sql/sql_parse.cc:6443
      #14 0x00007f08af053429 in mysql_execute_command (thd=0x7f088c000b00) at /data/src/10.2/sql/sql_parse.cc:3458
      #15 0x00007f08af060daa in mysql_parse (thd=0x7f088c000b00, rawbuf=0x7f088c012378 "SELECT i AS fld FROM t1 UNION SELECT COUNT(*) AS fld FROM t1", length=60, parser_state=0x7f08a2c31200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #16 0x00007f08af04ee56 in dispatch_command (command=COM_QUERY, thd=0x7f088c000b00, packet=0x7f088c163431 "SELECT i AS fld FROM t1 UNION SELECT COUNT(*) AS fld FROM t1", packet_length=60, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #17 0x00007f08af04d797 in do_command (thd=0x7f088c000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #18 0x00007f08af199529 in do_handle_one_connection (connect=0x7f08b11f89f0) at /data/src/10.2/sql/sql_connect.cc:1354
      #19 0x00007f08af1992b6 in handle_one_connection (arg=0x7f08b11f89f0) at /data/src/10.2/sql/sql_connect.cc:1260
      #20 0x00007f08af4e0964 in pfs_spawn_thread (arg=0x7f08b12930a0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #21 0x00007f08ae670064 in start_thread (arg=0x7f08a2c32700) at pthread_create.c:309
      #22 0x00007f08ac85562d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      {code}
       
      The crash was introduced in 10.2 tree with this commit:
      

      commit 2a1035b004dfabcf3a7113be632b0030721a44d6
      Author: Sergei Petrunia <psergey@askmonty.org>
      Date: Fri Jul 21 20:09:19 2017 +0300

      MDEV-13351: Server crashes in st_select_lex::set_explain_type upon UNION with window function

       

      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.