[SERVER-6194] Nested $add operators may be improperly reordered by constant folding implementation Created: 24/Jun/12 Updated: 11/Jul/16 Resolved: 27/Jul/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 2.2.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Matt Dannenberg |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
Observed behavior: When a nested $add is used for string concatenation, the arguments may be concatenated in the wrong order. There is some code to detect string $add operands and avoid an improper constant folding, but this is not applied for nested $add expressions:
Test:
|
| Comments |
| Comment by auto [ 18/Dec/12 ] |
|
Author: {u'date': u'2012-07-24T21:29:40Z', u'name': u'Matt Dannenberg', u'email': u'dannenberg.matt@gmail.com'}Message: this also eliminates the problems seen in Note: modified by Mathias on 2012/12/17 to use new Doc/Val API |
| Comment by Mathias Stearn [ 24/Jul/12 ] |
|
Not a problem due to |
| Comment by Aaron Staple [ 03/Jul/12 ] |
|
Sounds fine to me. As a reminder, if we comment out optimize() call(s) we should verify there isn't any code that functionally depends on them. |
| Comment by Mathias Stearn [ 03/Jul/12 ] |
|
I just looked through all of the optimize() calls and none of them seem to cover real-world scenarios that are likely to occur. I think if we can't get all of the bugs worked out it would be reasonable to just comment out the call to optimize() for 2.2. |