Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-82407

setIsSubset semantics differ in Classic and SBE

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      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

      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@mongodb.com Foteini Alvanaki
            Reporter:
            foteini.alvanaki@mongodb.com Foteini Alvanaki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: