[SERVER-51205] Bison rules for $const don't match handwritten parser Created: 28/Sep/20 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Percy | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | PM-1749-find-milestone, qopt-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Operating System: | ALL |
| Participants: |
| Description |
|
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. |