SBE set operations do not throw on non-array inputs

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: 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
    • 200
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 (Inactive)
              Reporter:
              Hana Pearlman
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: