[SERVER-6196] 'can't add two dates together' assertion during constant folding Created: 24/Jun/12 Updated: 08/Mar/13 Resolved: 21/Dec/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Mathias Stearn |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
In general we seem to support concatenation of multiple dates with strings but not addition of multiple dates. Observed behavior: uassert if an attempt is made to add two dates as part of constant folding, even if the folded value would be unused because of a non constant string value. Test:
|
| Comments |
| Comment by Mathias Stearn [ 21/Dec/12 ] |
|
This bug no longer applies as all $expressions that support constant folding are correctly associative and commutative. |
| Comment by Aaron Staple [ 18/Dec/12 ] |
|
redbeard0531 I haven't really looked at the new code, but I'd say just make sure there aren't any cases where changing an expression value from a constant to a field path (or the other way around) changes whether the expression asserts or not, due to constant folding. If there aren't any such cases, I'd just resolve this ticket as gone away or something. |
| Comment by Mathias Stearn [ 17/Dec/12 ] |
|
aaron This command is no longer valid since you can't use $add with strings, nor can you have more than 1 Date in a $add expression. Should this test be converted to the new $concat operator for concatenating strings or do you think it no longer applies? |