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

Crash with query referencing twice CTE that uses embedded recursive CTE

    XMLWordPrintable

Details

    Description

      Processing of a query containing at least two references to the same CTE that uses an embedded recursive CTE causes a crash of the server in 10.4+.
      Here's a simple test case that demonstrates this problem.

      create table t1 (a int); 
      insert into t1 values (5), (7);
      with cte_e as (
        with recursive cte_r as (
          select a from t1 union select a+1 as a from cte_r r where a < 10
        ) select * from cte_r
      ) select * from cte_e s1, cte_e s2 where s1.a=s2.a;
      

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev (Inactive)
              igor Igor Babaev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1d 4h 20m
                  1d 4h 20m

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.