Properly validate `sortBy` when parsing $setWindowFields

XMLWordPrintableJSON

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

      See description

      Show
      See description
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Henri Nikku
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: