[SERVER-6804] ExpressionCompare::optimize should optimize two constants to an ExpressionConstant Created: 20/Aug/12 Updated: 27/Jan/16 Resolved: 27/Jan/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mathias Stearn | Assignee: | Benjamin Murphy |
| Resolution: | Done | Votes: | 0 |
| Labels: | grab-bag, optimization | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Sprint: | Query F (02/01/16) |
| Participants: |
| Comments |
| Comment by Mathias Stearn [ 27/Jan/16 ] |
|
charlie.swanson sounds good to me. |
| Comment by Charlie Swanson [ 27/Jan/16 ] |
|
redbeard0531, This ticket is very old, but it appears most of your last comment still applies. I'm not sure what you meant by "in the nested if where it detects two constants". I'm guessing that ExpressionCompare used to have an implementation of optimize(). It doesn't anymore, and I'm fairly confident this just works (we have this test). Would you be okay with just closing this ticket? Alternatively, we could just add more test cases like the one referenced, one for each operator represented by ExpressionCompare. |
| Comment by Mathias Stearn [ 20/Aug/12 ] |
|
I looked it to it more while reviewing your change and I'm not sure any more. I don't see any cases where ExpressionNary wouldn't optimize it away. Either way, ExpressionCompare::optimize() should either massert or return an ExpressionConstant in the nested if where it detects two constants. |
| Comment by Aaron Staple [ 20/Aug/12 ] |
|
Is there a case where this isn't handled by ExpressionNary::optimize()? |