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

Streaming $group does not handle nullish values correctly.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • ALL
    • Query 12 (04/04/16), Query 13 (04/22/16)

      SERVER-4507 was implemented and pushed, but has a known issue:

      Because of how the index sorts null, missing, and undefined values, a user executing a $group on documents with null/missing/undefined values may get the incorrect number of groups.

      To fix this, $group should not stream for the period that input has nullish _id values.

      Once this change has gone into master, DocumentSourceGroup::findRelevantInputSort should be changed to not immediately return boost::none, and the associated tests in document_source_test.cpp should be reenabled by removing the #if surrounding the lines that add the tests to the suite.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            benjamin.murphy Benjamin Murphy
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: