Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-59170

subquery cannot use nested CTE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.2.4
    • 7.2.4, 7.1.7
    • query
    • Untriaged
    • 0
    • Yes

    Description

      Seen on 7.1.5-3887-enterprise.

      This query:

      WITH cte2 AS (
          WITH cte1 AS (
              SELECT 1
              FROM [] t1
          )    
       
          SELECT 1
          FROM (
              SELECT 1
              FROM cte1 AS c1
          ) AS t2
      )
       
      SELECT 1 FROM cte2

      gives this error:

      {
        "code": 3082,
        "msg": "Formalizer internal error: correlation reference cte1 is not in allowed",
        "query": "WITH cte2 AS (\n    WITH cte1 AS (\n        SELECT\n            1\n        FROM [] t1\n    )\n\n    SELECT 1\n    FROM (\n        SELECT\n            1\n        FROM cte1 AS c1\n    ) AS t2\n)\n\nSELECT 1 FROM cte2"
      }

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              hitesh.walia Hitesh Walia
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty