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

EXISTS subquery with CTE does not accept multiple brackets

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.3.10
    • N/A
    • Optimizer - CTE
    • None

    Description

      The following queries are all valid, except the last one, which is unexpected.

      	SELECT ALL
      		*
      	FROM users
      	WHERE
      		EXISTS
      			(
      				WITH RECURSIVE `test` AS (SELECT ALL 1)
      				SELECT ALL 1
      			)
      

      	SELECT ALL
      		*
      	FROM users
      	WHERE
      		EXISTS
      			(
      				(
      					SELECT ALL 1
      				)
      			)
      

      			
      	SELECT ALL
      		*
      	FROM users
      	WHERE
      		1 IN
      			(
      				(
      					WITH RECURSIVE `test` AS (SELECT ALL 1)
      					SELECT ALL 1
      				)
      			)
      

      	SELECT ALL
      		*
      	FROM users
      	WHERE
      		EXISTS
      			(
      				(
      					WITH RECURSIVE `test` AS (SELECT ALL 1)
      					SELECT ALL 1
      				)
      			)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            user2180613 Remy Fox
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.