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

$group with $and expression fails

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide

      Classic engine:

      > db.t.insert({a: 1})
      WriteResult({ "nInserted" : 1 })
      > db.t.aggregate([{$group: {_id: {$and: ["$a", true]}, s: {$sum: "$b"}}}])
      { "_id" : true, "s" : 0 }
      

      SBE and featureFlagGroupPushdown on,

      > db.t.aggregate([{$group: {_id: {$and: ["$a", true]}, s: {$sum: "$b"}}}])
      

      Hits MONGO_UNREACHABLE in:

      {"t":{"$date":"2021-09-27T14:28:38.628+00:00"},"s":"F",  "c":"ASSERT",   "id":23079,   "ctx":"conn1","msg":"Invariant failure","attr":{"expr":"Hit a MONGO_UNREACHABLE!","file":"src/mongo/db/query/sbe_stage_builder_expression.cpp","line":957}}
      
      Show
      Classic engine: > db.t.insert({a: 1}) WriteResult({ "nInserted" : 1 }) > db.t.aggregate([{$group: {_id: {$and: ["$a", true]}, s: {$sum: "$b"}}}]) { "_id" : true, "s" : 0 } SBE and featureFlagGroupPushdown on, > db.t.aggregate([{$group: {_id: {$and: ["$a", true]}, s: {$sum: "$b"}}}]) Hits MONGO_UNREACHABLE in: {"t":{"$date":"2021-09-27T14:28:38.628+00:00"},"s":"F", "c":"ASSERT", "id":23079, "ctx":"conn1","msg":"Invariant failure","attr":{"expr":"Hit a MONGO_UNREACHABLE!","file":"src/mongo/db/query/sbe_stage_builder_expression.cpp","line":957}}
    • QE 2021-10-04

          Assignee:
          yoonsoo.kim@mongodb.com Yoon Soo Kim
          Reporter:
          eric.cox@mongodb.com Eric Cox (Inactive)
          Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

            Created:
            Updated:
            Resolved: