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

Syntax error when WITH clause is used in CREATE SELECT.

    XMLWordPrintable

Details

    Description

      When a WITH clause is attached to the unit from CREATE ... SELECT and the unit with this clause are parenthesis then the parser returns a syntax error:

      MariaDB [test]> create table my_ancestors ( with recursive ancestor_ids (id) as (   select father from folks where name = 'Me'   union   select mother from folks where name = 'Me'   union   select father from folks, ancestor_ids a  where folks.id = a.id   union   select mother from folks, ancestor_ids a  where folks.id = a.id ) select p.* from folks as p, ancestor_ids as a where p.id = a.id );
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'recursive ancestor_ids (id) as (   select father from folks where name = 'Me'   ' at line 1
      

      Attachments

        Activity

          People

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