[SERVER-57321] $mod match expression incorrectly handles NaN, Infinity and large values Created: 01/Jun/21 Updated: 29/Oct/23 Resolved: 25/Aug/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 5.0.0-rc7, 5.1 Required |
| Fix Version/s: | 4.4.10, 5.0.4, 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mindaugas Malinauskas | Assignee: | Mihai Andrei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sbe-diff, sbe-rollout | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v5.0, v4.4, v4.2, v4.0
|
||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
Result: |
||||||||||||||||||||||||||||||||||||
| Sprint: | Query Execution 2021-07-12, Query Execution 2021-07-26, QE 2021-09-06 | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 163 | ||||||||||||||||||||||||||||||||||||
| Description |
|
In classic variant of query execution $mod match expression (ModMatchExpression) interprets dividend value NaN (double) as -9223372036854775808 64-bit integer. In SBE, on the other hand, NaN to 64-bit integer transformation results in Nothing. Furthermore, NumberDecimal("9.999999999999999999999999999999999E+6144") gets interpreted as NumberLong("-9223372036854775808") (classic and SBE). Those two factors, when combined, give unexpected results. Please see "Steps to Reproduce".
|
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] |
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! |
| Comment by Githook User [ 27/Sep/21 ] |
|
Author: {'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}Message: (cherry picked from commit 23e56121a014719f0dd29d27a60a72a0e11dac10) Co-authored-by: Mihai Andrei <mihai.andrei@mongodb.com> |
| Comment by Githook User [ 20/Sep/21 ] |
|
Author: {'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}Message: (cherry picked from commit 23e56121a014719f0dd29d27a60a72a0e11dac10) Co-authored-by: Mihai Andrei <mihai.andrei@mongodb.com> |
| Comment by Githook User [ 25/Aug/21 ] |
|
Author: {'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}Message: |
| Comment by Kyle Suarez [ 20/Aug/21 ] |
|
Sending this to Mihai to get it over the line next sprint while Mindaugas is on holiday. |
| Comment by Githook User [ 20/Jul/21 ] |
|
Author: {'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}Message: |
| Comment by Kyle Suarez [ 25/Jun/21 ] |
|
Right, they are a checklist, not alternatives. I agree, an attempt to cast an unrepresentable value to uint64 should be an error. |
| Comment by Mindaugas Malinauskas [ 25/Jun/21 ] |
|
kyle.suarez, shouldn't we address the problem #2 in the comment? |
| Comment by Kyle Suarez [ 25/Jun/21 ] |
|
mindaugas.malinauskas, if going with option 1 would make the classic engine match SBE, then I think that's the most sensible thing to do. It does seem like a bug in the classic engine to me. |
| Comment by Mindaugas Malinauskas [ 01/Jun/21 ] |
|
This is a root cause of BF-21240. |