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

Incorrect result with Subquery as right-hand side of ANSI JOIN, and subquery references CTE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • 6.6.2, 7.0.0
    • 6.6.1
    • query
    • Untriaged
    • 1
    • Yes

    Description

      See CBSE-9639.

      WITH a1 AS ([{"EffectiveDate": "2021-01-27"}, {"EffectiveDate": "2021-01-28"}, {"EffectiveDate": "2021-01-29"}])
      SELECT l, r
      FROM a1 AS l
      JOIN (SELECT d.EffectiveDate FROM a1 AS d) AS r
      ON l.EffectiveDate = r.EffectiveDate
      

      The above query should return 3 documents, in 6.6.1 it only returns 1.
      This works in 6.5.1, returns 3 documents.

      Attachments

        Issue Links

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              bingjie.miao Bingjie Miao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty