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

[SBE] Fix $unwind to support cases where 'includeArrayIndex' conflicts with 'path'

    • Query Execution
    • Fully Compatible
    • ALL
    • v8.0
    • QE 2024-08-05, QE 2024-08-19
    • 0

      Note this bug is in functionality that is and always has been behind a feature flag which is NOT enabled in production, so it does NOT affect the v8.0 or any other production release. (The bug was first introduced in v8.0.0-rc0.)

      If an $unwind uses "path" and "includeArrayIndex" options that both point to the same output field, and this is followed by a $project, and both of these stages are executed in SBE, the query fails due to triggering tassert 7580701:

      Expected 'paths' to not contain any conflicting paths 

      Example repro (does not require the "test" collection even to exist, as the failure occurs in the stage builder, which is before execution is started):

      db.test.aggregate([ 
         {$unwind: {path: "$a", includeArrayIndex: "a"}},
         {$project: {b: true}} ]); 

       

            Assignee:
            andrew.paroski@mongodb.com Drew Paroski
            Reporter:
            kevin.cherkauer@mongodb.com Kevin Cherkauer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: