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

Inner join using with clause table has 3 tables per document in results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 6.5.0
    • 6.5.0
    • query
    • None
    • Untriaged
    • No

    Description

      Create default bucket, primary index and put some documents in it like the following:

      {"join_yr":2010, "name": "Bob"} {"join_yr":2011, "name": "Alice"}

      then create index on join_yr and run the following query:

      with with_table as (select * from default d0 where join_yr == 2010 order by meta(d0).id limit 1) select * from default AS table1 inner join with_table as table2 on (table1.join_yr == table2.d0.join_yr)

      in this query we are aliasing the with clause table (with_table) as table2 and default bucket as table1. In the result set, each document has table1 and table2 appended to each other but also has the with clause table (with_table) appended. So each document has 3 tables appended.

      Attachments

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

        Activity

          People

            keshav Keshav Murthy
            korrigan.clark Korrigan Clark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty