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

N1QL "except" does not work properly when the second set is empty.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 4.1.0
    • 4.1.0, 4.5.0
    • query
    • Security Level: Public
    • None
    • Untriaged
    • Unknown

    Description

      I have some buckets with indexes, and some without.

      I wrote a query to list buckets that have no indexes:

      (select id keyspace_id from system:keyspaces) except (select indexes.keyspace_id from system:indexes);

      This query worked correctly when some buckets have indexes. When I ran the query on a new machine with no indexes, however, it returns an empty set. I can replicate that incorrect result with the following query:

      (select id keyspace_id from system:keyspaces) except (select indexes.keyspace_id from system:indexes where 1=0);

      This returns empty results. It is subtracting an empty set from a non-empty set, so it should return the non-empty set.

      Attachments

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

        Activity

          People

            Prerna.Manaktala Prerna Manaktala (Inactive)
            eben Eben Haber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty