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

`with recursive` as a subquery fails

    XMLWordPrintable

Details

    Description

      The following query is valid ansi-sql, but is rejected by the latest mariadb:

      create table r (
          src int primary key,
          tgt int
      );
       
      insert into r (src, tgt) values
        (2, 1),(3, 1),(4, 2),(5, 2),(6, 3),(7, 3),(8, 4),(9, 5);
       
      (select src, tgt
       from r
      )
      union
      (with recursive
            TransitiveClosure as (select  src, tgt
                                  from r
                                  union
                                  (select
                                         TransitiveClosure.src as src,
                                         r.tgt as tgt
                                  from TransitiveClosure,
                                       r
                                  where r.src = TransitiveClosure.tgt)
                                 )
       select src, tgt from TransitiveClosure
      );
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hanjoosten Han Joosten
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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