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

Bison rules for $const don't match handwritten parser

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • ALL

      The syntax of $const is different from many other operators: it does not interpret an array as a list of arguments. {$const: [123]} evaluates to a 1-element array, while {$const: 123} evaluates to a number.

      The rule for $const in grammar.yy currently expects START_ARRAY and END_ARRAY, so it rejects {$const: 123}.

      Also, $const should accept arbitrary BSON, as in {$const: {$x: 1}}. The rule for valueFieldname has no case for $x. Actually, this might be a lexer error; I'm not sure.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: