[SERVER-11429] Not trapping mismatch between data value and data type Created: 28/Oct/13 Updated: 10/Dec/14 Resolved: 29/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.4.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alvin Richards (Inactive) | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | 26qa, nqf | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
{ |
||
| Issue Links: |
|
||||
| Operating System: | ALL | ||||
| Participants: | |||||
| Description |
|
2.5.x is not throwing an error when there is a comparison between the data vale and datatype of the same attribute. For example data value of ISODate("2013-09-29T10:40Z") (type 9) and compared against data type 17 (Timestamp). Reproduce:
2.4.5
2.5.4-Pre |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 29/Oct/13 ] | ||||
|
{ a : { $gt : 5 , $lt : 4 }} is not an error, so neither should this | ||||
| Comment by Alvin Richards (Inactive) [ 29/Oct/13 ] | ||||
|
The way I read this query is an "and", but causes a condition that cannot be true, i.e. data value of type Date and type of Timestamp. Throwing an error is at least backward compatible. New behaviour seems to provide a consistent behaviour. Its subjective (in IMHO) what is the correct behaviour, so Im OK to go with eliot opinion. Does this have an unexpected side-effects? | ||||
| Comment by Eliot Horowitz (Inactive) [ 29/Oct/13 ] | ||||
|
The query language always lets you do a query comparing types, and you just don't get matches. | ||||
| Comment by Daniel Pasette (Inactive) [ 29/Oct/13 ] | ||||
|
The 2.4 behavior is more informative in that you have incompatible types in the query. | ||||
| Comment by Scott Hernandez (Inactive) [ 28/Oct/13 ] | ||||
|
Alvin, you think the current behavior is a bug (and preferred behavior), not just a behavior change? | ||||
| Comment by Alvin Richards (Inactive) [ 28/Oct/13 ] | ||||
|
Another example
2.4.5
2.5.4-Pre |