[SERVER-78672] Expression::optimize() is used incorrectly when trying to convert $group to streaming for time-series Created: 05/Jul/23 Updated: 29/Oct/23 Resolved: 19/Jul/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | Foteini Alvanaki |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Backwards Compatibility: | Fully Compatible |
| Sprint: | QE 2023-08-07 |
| Participants: |
| Description |
|
This line of code incorrectly discards the return value. It's written like so:
But it should be this:
The reason is that the Expression::optimize() function does not optimize the expression in place but rather returns a pointer to the optimized expression. While we're at it, we should consider adding the "[[nodiscard]]" attribute to Expression::optimize() in order to try to prevent this kind of mistake in the future. |
| Comments |
| Comment by Githook User [ 18/Jul/23 ] |
|
Author: {'name': 'Foteini Alvanaki', 'email': 'foteini.alvanaki@mongodb.com', 'username': ''}Message: |