[SERVER-66379] $or to $in conversion flawed Created: 11/May/22 Updated: 29/Oct/23 Resolved: 31/May/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.10, 6.0.0-rc9, 6.1.0-rc0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Daniel Hegener | Assignee: | Timour Katchaounov |
| 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: |
v6.0, v5.0
|
||||||||||||||||
| Sprint: | QO 2022-05-30, QO 2022-06-13 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 17 | ||||||||||||||||
| Description |
|
We have come across a problem that was introduced with this change: This problem can only be seen on MongoDB v5, earlier versions work properly. Steps to reproduce: Create "some" collection and then run:
Expected output: No failure.
|
| Comments |
| Comment by Githook User [ 02/Jun/22 ] | |||||||||||
|
Author: {'name': 'Timour Katchaounov', 'email': 'timour.katchaounov@mongodb.com', 'username': 'timourk'}Message: (cherry picked from commit 951197b3834d509d7903efa4a66c0e9f79235262) | |||||||||||
| Comment by Githook User [ 02/Jun/22 ] | |||||||||||
|
Author: {'name': 'Timour Katchaounov', 'email': 'timour.katchaounov@mongodb.com', 'username': 'timourk'}Message: (cherry picked from commit 951197b3834d509d7903efa4a66c0e9f79235262) | |||||||||||
| Comment by Githook User [ 31/May/22 ] | |||||||||||
|
Author: {'name': 'Timour Katchaounov', 'email': 'timour.katchaounov@mongodb.com', 'username': 'timourk'}Message: | |||||||||||
| Comment by Timour Katchaounov [ 26/May/22 ] | |||||||||||
|
It turns out the collation is crucial. This is a reproducible test case:
| |||||||||||
| Comment by Timour Katchaounov [ 26/May/22 ] | |||||||||||
|
Update: I read the original thread on Stackoverflow, and tested the complete example in the thread. Ineed, the original much bigger query results in the reported assertion. So there is a bug, but the test case here seems to have been oversimplified. I will simplify it a bit before continuing work on the bug. | |||||||||||
| Comment by Timour Katchaounov [ 26/May/22 ] | |||||||||||
|
Unfortunately I cannot reproduce the problem on neither master, nor v5.0. This is what I tried:
daniel.hegener@gmx.net could you please provide exact instructions how to reproduce - exact version (or commit), how it was built, complete script. | |||||||||||
| Comment by Daniel Hegener [ 11/May/22 ] | |||||||||||
|
https://stackoverflow.com/questions/69098410/mongodb-failed-with-error-failed-to-optimize-expression |