[SERVER-40546] Min/Max with collation can return incorrect results Created: 09/Apr/19 Updated: 29/Oct/23 Resolved: 07/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 3.6.12, 4.0.8, 4.1.9 |
| Fix Version/s: | 4.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ian Boros | Assignee: | Mikhail Ivkov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Backport Requested: |
v4.2, v4.0
|
||||
| Sprint: | Query 2019-06-17 | ||||
| Participants: | |||||
| Description |
|
In QueryPlanner::plan() we decide whether an index is compatible with min/max by only looking at the value provided to min() or the value provided to max() (but not both). If a non-empty value is provided for min(), and the value provided to max() is collatable, the index chosen may lead to wrong results. To reproduce, run this: min_max_collation.js
Note that while I am changing min/max in
This is also an issue on 4.0 and 3.6 (and probably 3.4). To reproduce on older versions, you may have to omit a hint. |
| Comments |
| Comment by Githook User [ 29/Oct/19 ] |
|
Author: {'name': 'Ian Boros', 'username': 'puppyofkosh', 'email': 'ian.boros@mongodb.com'}Message: |
| Comment by Githook User [ 07/Jun/19 ] |
|
Author: {'name': 'Misha Ivkov', 'email': 'misha.ivkov@10gen.com'}Message: |