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: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL

      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:
            Unassigned Unassigned
            Reporter:
            hana.pearlman@mongodb.com Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: