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

array indexing should not allow the WHEN clause in the index expression

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Critical
    • 4.5.0
    • 4.5.0
    • query
    • None
    • build 1953
    • Untriaged
    • Unknown

    Description

      We should disallow the WHEN clause on the array index, index expression section; It is misleading to allow the WHEN clause as it is ignored when indexing items. Only conditions in the where clause are honored.

      the following should return an error saying "'when' clause is not allowed in index expression"

      create index arr2 on default(array i.content.x1 for i in a4 when i.content.x1 = "21877d27-cf5c-448e-a94f-32c97ae6b5b8" end);

      instead we should require customer to write the statement as;

      create index arr3 on default(array i.content.x1 for i in a4 end)
      where any j in a4 satisfies j.content.x1 = "21877d27-cf5c-448e-a94f-32c97ae6b5b8" end;

      thanks
      -cihan

      Attachments

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

        Activity

          People

            keshav Keshav Murthy
            cihan Cihan Biyikoglu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty