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

              Assignee:
              igor Igor Babaev
              Reporter:
              igor Igor Babaev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration