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

Crash with EXPLAIN + WITH + constant query

    XMLWordPrintable

Details

    Description

      This script

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (1),(2),(3);
      SELECT * FROM (WITH a AS (SELECT * FROM t1) SELECT 1) AS t1;
      EXPLAIN SELECT * FROM (WITH a AS (SELECT * FROM t1) SELECT 1) AS t1;
      

      crashes the served with the following stack trace:

      #0  0x0000555555a419a3 in st_select_lex::update_used_tables (this=0x7ffecf4612e0)
          at /home/bar/maria-git/server.10.2/sql/sql_lex.cc:4218
      #1  0x0000555555a8bda7 in JOIN::optimize_inner (this=0x7ffecf4656f0)
          at /home/bar/maria-git/server.10.2/sql/sql_select.cc:1162
      #2  0x0000555555a8b9b4 in JOIN::optimize (this=0x7ffecf4656f0) at /home/bar/maria-git/server.10.2/sql/sql_select.cc:1070
      #3  0x0000555555a93cbf in mysql_select (thd=0x7ffecf416070, tables=0x7ffecf461ee0, wild_num=0, fields=..., conds=0x0, 
          og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2416184068, result=0x7ffecf4644d0, 
          unit=0x7ffecf461678, select_lex=0x7ffecf4612e0) at /home/bar/maria-git/server.10.2/sql/sql_select.cc:3524
      #4  0x0000555555ac7a2b in mysql_explain_union (thd=0x7ffecf416070, unit=0x7ffecf461678, result=0x7ffecf4644d0)
          at /home/bar/maria-git/server.10.2/sql/sql_select.cc:24511
      #5  0x0000555555ac77c7 in select_describe (join=0x7ffecf464b50, need_tmp_table=false, need_order=false, distinct=false, 
          message=0x0) at /home/bar/maria-git/server.10.2/sql/sql_select.cc:24466
      #6  0x0000555555a935b9 in JOIN::exec_inner (this=0x7ffecf464b50)
          at /home/bar/maria-git/server.10.2/sql/sql_select.cc:3314
      #7  0x0000555555a92c8a in JOIN::exec (this=0x7ffecf464b50) at /home/bar/maria-git/server.10.2/sql/sql_select.cc:3154
      #8  0x0000555555a93d4f in mysql_select (thd=0x7ffecf416070, tables=0x7ffecf463e00, wild_num=1, fields=..., conds=0x0, 
          og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748612, result=0x7ffecf4644d0, 
          unit=0x7ffecf419ac0, select_lex=0x7ffecf41a1e8) at /home/bar/maria-git/server.10.2/sql/sql_select.cc:3538
      #9  0x0000555555ac7a2b in mysql_explain_union (thd=0x7ffecf416070, unit=0x7ffecf419ac0, result=0x7ffecf4644d0)
          at /home/bar/maria-git/server.10.2/sql/sql_select.cc:24511
      

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.