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

Server crashes in st_select_lex::set_explain_type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.2
    • Fix Version/s: 10.2.2
    • Component/s: Optimizer
    • Labels:
      None

      Description

      Stack trace from 10.2 addb38f47

      #3  <signal handler called>
      #4  0x00007fdfc25e501a in st_select_lex::set_explain_type (this=0x7fdfb6d23d90, on_the_fly=true) at /data/src/10.2/sql/sql_lex.cc:4380
      #5  0x00007fdfc266a4ff in JOIN::save_explain_data_intern (this=0x7fdfb6de0518, output=0x7fdfb6de7460, need_tmp_table_arg=false, need_order_arg=false, distinct_arg=false, message=0x7fdfc2f280a0 "no matching row in const table") at /data/src/10.2/sql/sql_select.cc:24428
      #6  0x00007fdfc26355b7 in JOIN::save_explain_data (this=0x7fdfb6de0518, output=0x7fdfb6de7460, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false) at /data/src/10.2/sql/sql_select.cc:3118
      #7  0x00007fdfc262e603 in JOIN::optimize (this=0x7fdfb6de0518) at /data/src/10.2/sql/sql_select.cc:1095
      #8  0x00007fdfc26cb57c in st_select_lex_unit::optimize (this=0x7fdfb6c55ae8) at /data/src/10.2/sql/sql_union.cc:901
      #9  0x00007fdfc26cb77b in st_select_lex_unit::exec (this=0x7fdfb6c55ae8) at /data/src/10.2/sql/sql_union.cc:934
      #10 0x00007fdfc26c8800 in mysql_union (thd=0x7fdfb6c52070, lex=0x7fdfb6c55a20, result=0x7fdfb6d27048, unit=0x7fdfb6c55ae8, setup_tables_done_option=0) at /data/src/10.2/sql/sql_union.cc:41
      #11 0x00007fdfc262bfb3 in handle_select (thd=0x7fdfb6c52070, lex=0x7fdfb6c55a20, result=0x7fdfb6d27048, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:351
      #12 0x00007fdfc25fbc1d in execute_sqlcom_select (thd=0x7fdfb6c52070, all_tables=0x7fdfb6d21388) at /data/src/10.2/sql/sql_parse.cc:6333
      #13 0x00007fdfc25f1a53 in mysql_execute_command (thd=0x7fdfb6c52070) at /data/src/10.2/sql/sql_parse.cc:3364
      #14 0x00007fdfc25ff3d7 in mysql_parse (thd=0x7fdfb6c52070, rawbuf=0x7fdfb6d21088 "SELECT * FROM t1, t2 WHERE a2 = i1 and b2 >= i1 AND i1 IN ( SELECT i3 FROM t3 )\nUNION\nSELECT * FROM t1, t2 WHERE a2 = i1 and b2 >= i1 AND i1 IN ( SELECT i3 FROM t3 )", length=165, parser_state=0x7fdfc3571dd0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7765
      #15 0x00007fdfc25ed7aa in dispatch_command (command=COM_QUERY, thd=0x7fdfb6c52070, packet=0x7fdfb6d15071 "SELECT * FROM t1, t2 WHERE a2 = i1 and b2 >= i1 AND i1 IN ( SELECT i3 FROM t3 )\nUNION\nSELECT * FROM t1, t2 WHERE a2 = i1 and b2 >= i1 AND i1 IN ( SELECT i3 FROM t3 )\n", packet_length=166, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1793
      #16 0x00007fdfc25ec1db in do_command (thd=0x7fdfb6c52070) at /data/src/10.2/sql/sql_parse.cc:1353
      #17 0x00007fdfc2726870 in do_handle_one_connection (connect=0x7fdfbf46d410) at /data/src/10.2/sql/sql_connect.cc:1354
      #18 0x00007fdfc27265fd in handle_one_connection (arg=0x7fdfbf46d410) at /data/src/10.2/sql/sql_connect.cc:1260
      #19 0x00007fdfc2a1b63c in pfs_spawn_thread (arg=0x7fdfbf4519f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #20 0x00007fdfc1cad0a4 in start_thread (arg=0x7fdfc3573300) at pthread_create.c:309
      #21 0x00007fdfbfe6587d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      CREATE TABLE t1 (i1 INT, KEY(i1)) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (4),(8);
                              
      CREATE TABLE t2 (a2 INT, b2 INT, KEY(b2)) ENGINE=MyISAM;
      INSERT INTO t2 VALUES (8,7);
                  
      CREATE TABLE t3 (i3 INT) ENGINE=MyISAM;
      INSERT INTO t3 VALUES (2),(6);
       
      SELECT * FROM t1, t2 WHERE a2 = i1 and b2 >= i1 AND i1 IN ( SELECT i3 FROM t3 )
      UNION
      SELECT * FROM t1, t2 WHERE a2 = i1 and b2 >= i1 AND i1 IN ( SELECT i3 FROM t3 )
      ;
      

      The problem appeared in 10.2 tree with this revision:

      commit a2f245e49f8747f9fd202cae451861a8371e6151
      Author: Sergei Petrunia <psergey@askmonty.org>
      Date:   Mon Aug 8 23:02:52 2016 +0300
       
          MDEV-10372: EXPLAIN fixes for recursive CTEs, including FORMAT=JSON
          
          - Tabular EXPLAIN now prints "RECURSIVE UNION".
          - There is a basic implementation of EXPLAIN FORMAT=JSON.
          - it produces "recursive_union" JSON struct
          - No other details or ANALYZE support, yet.
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psergei Sergei Petrunia
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration