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

EXISTS subquery with CTE does not accept multiple brackets

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 10.3.10
    • Fix Version/s: N/A
    • Component/s: Optimizer - CTE
    • Labels:
      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            user2180613 Remy Fox
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration