setIsSubset semantics differ in Classic and SBE

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Hide

      Create the collection

      db.testCol.insertOne({_id:1})

       

      Query the collection in SBE and in Classic

      db.testCol.aggregate([ { $project: { "isSubset":
      { $setIsSubset: [ "$array",[]] }
      } }])
      

       

      SBE returns

      [ { _id: 1, isSubset: null } ]

      while classic returns

      MongoServerError: PlanExecutor error during aggregation :: caused by :: both operands of $setIsSubset must be arrays. First argument is of type: missing
      Show
      Create the collection db.testCol.insertOne({_id:1})   Query the collection in SBE and in Classic db.testCol.aggregate([ { $project: { "isSubset" : { $setIsSubset: [ "$array" ,[]] } } }])   SBE returns [ { _id: 1, isSubset: null } ] while classic returns MongoServerError: PlanExecutor error during aggregation :: caused by :: both operands of $setIsSubset must be arrays. First argument is of type: missing
    • QE 2023-10-30
    • 125
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      setIsSubset expects two arrays as inputs. Classic throws an error if one of the arrays is missing. SBE checks the types before calling setIsSubset and returns null if one of them is missing. This different is causing a failure in fuzzer tests.

            Assignee:
            Foteini Alvanaki
            Reporter:
            Foteini Alvanaki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: