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

ARRAY_EXCEPT() returns wrong results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.0
    • 7.0.2, 7.1.0
    • query
    • None
    • Untriaged
    • 1
    • Unknown

    Description

      Tim Bradgate  found this

       

      SELECT RAW c FROM 1 AS d UNNEST ARRAY_EXCEPT([1,2,3,4,5],[2,4]) AS c;
      [1,3,5,null,null] vs [1,3,5]
       SELECT ARRAY_EXCEPT([1,2,3,4,5],[2,4]) ;
      returns [1,3,5]
      

      ARRAY_EXCEPT() evaluated twice once during planner 

      and second time during execution. Why planner results replaced first argument?

       

      Same thing can happen non constants.

       

      WITH o AS ([2,4]) 
      SELECT RAW  c 
      FROM [{"a":[1,2,3,4,5]}] AS d 
      UNNEST ARRAY_EXCEPT(d.a,o) AS c;
      

       

       

      Attachments

        For Gerrit Dashboard: MB-50488
        # Subject Branch Project Status CR V

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            Sitaram.Vemulapalli Sitaram Vemulapalli
            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