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

SBE set operations do not throw on non-array inputs

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • ALL
    • v8.0
    • QE 2024-10-14, QE 2024-10-28
    • 0

      SBE-eligible queries containing set operations like $setEquals can pass when the same queries run on classic fail:

       db.foo.insert({a: 1})
      
      // Uses classic
      > db.foo.aggregate([{$project: {p: {$setEquals: ["$a", "$b"]}}}])
      PlanExecutor error during aggregation :: caused by :: All operands of $setEquals must be arrays. 1-th argument is of type: double
      
      > db.foo.aggregate([{$project: {p: {$setEquals: ["$missing", "$b"]}}}])
      PlanExecutor error during aggregation :: caused by :: All operands of $setEquals must be arrays. 1-th argument is of type: missing
      
      // Uses SBE
      > db.foo.aggregate([{$project: {p: {$setEquals: ["$a", "$b"]}}}, {$group: {_id: null}}])
      { "_id" : null }
      
      > db.foo.aggregate([{$project: {p: {$setEquals: ["$missing", "$b"]}}}, {$group: {_id: null}}])
      { "_id" : null }

      Looks like there are tests for this, but the queries do not use SBE, so the issue was not exposed.

            Assignee:
            adi.agrawal@mongodb.com Adi Agrawal
            Reporter:
            hana.pearlman@mongodb.com Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: