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

setIsSubset semantics differ in Classic and SBE

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • None
    • 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

    Description

      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.

      Attachments

        Activity

          People

            foteini.alvanaki@mongodb.com Foteini Alvanaki
            foteini.alvanaki@mongodb.com Foteini Alvanaki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: