[SERVER-61430] Raise an error when $mod remainder is not a number Created: 12/Nov/21 Updated: 20/Dec/21 Resolved: 17/Dec/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.2.17 |
| Fix Version/s: | 4.2.18 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Milena Ivanova | Assignee: | Romans Kasperovics |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | QE 2021-12-13, QE 2021-12-27 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
Current implementation of $mod in v4.2 doesn't raise an error when the remainder is not a number: The problem stems from https://github.com/mongodb/mongo/blob/f6690d2a4803b3a316bf8f5ba859af35bd433b9b/src/mongo/db/matcher/expression_parser.cpp#L449 which should be if (!r.isNumber()) |
| Comments |
| Comment by Milena Ivanova [ 16/Dec/21 ] |
|
I came across the bug in v4.2 when backporting another patch, it looked like the issue was fixed in the newer versions as a part of other code extension, so I was not aware that there was a special ticket for this that could be backported. ana.meza, can you help with the ticket registration?
|
| Comment by Romans Kasperovics [ 16/Dec/21 ] |
|
I guess we should still be able to "move" this ticket to backports and rename my pull request to milena.ivanova, sebastien.mendez : Can we do that? Are there some extra steps for backporting tickets? |
| Comment by David Storch [ 15/Dec/21 ] |
|
Didn't we already fix this in |