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

Properly validate `sortBy` when parsing $setWindowFields

    • Query Optimization
    • Fully Compatible
    • ALL
    • v8.0, v7.3, v7.0, v6.0, v5.0
    • Hide

      See description

      Show
      See description

      We don't sufficiently validate `sortBy` during parsing with all window functions. Example queries that hit tassert:

      Expression in `sortBy` (location 5429410):

      $setWindowFields: {
        sortBy: {a: {$meta: "randVal"}},
        output: {b: {$max: 5, window: {range: [+3, 'unbounded']}}}
      } 

      Descending sort (location 5429404):

      $setWindowFields: {
        sortBy: {a: -1},
        output: {b: {$max: 5, window: {range: [+3, 'unbounded']}}}
      } 

            Assignee:
            henri.nikku@mongodb.com Henri Nikku
            Reporter:
            henri.nikku@mongodb.com Henri Nikku
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: