[SERVER-76102] handleRIDRangeScan() sets hasCompatibleCollation wrong in recursive cases Created: 13/Apr/23 Updated: 29/Oct/23 Resolved: 24/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 6.0.0-rc0, 6.0.6 |
| Fix Version/s: | 7.1.0-rc0, 7.0.0-rc1, 6.3.2, 6.0.7 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Cherkauer | Assignee: | Hana Pearlman |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query Optimization
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v7.0, v6.3, v6.0
|
||||||||||||
| Sprint: | QO 2023-05-01 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
Found by code inspection. planner_access.h handleRIDRangeScan() calls itself recursively on the branches of AndMatchExpressions, but in setting the output value of collScan->hasCompatibleCollation it neglects to consider the recursions, so the value from whichever recursion happened last is the final value. The recursions should each have a chance to conjunctively falsify it, i.e. updates should be something like
but instead the first occurrence of this updates it incorrectly (introduced in 7.0.0-rc0 by
and toward the bottom of the function (which is not always reached) there is another incorrect update (introduced in 6.0.0-rc0 by
The fix might be to change the first existing update to use && as I suggested above and delete the second existing update, but this suggestion needs validation from a QO expert. I confirmed with hana.pearlman@mongodb.com that the current code is incorrect. |
| Comments |
| Comment by Githook User [ 28/Apr/23 ] |
|
Author: {'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}Message: |
| Comment by Githook User [ 28/Apr/23 ] |
|
Author: {'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}Message: |
| Comment by Githook User [ 28/Apr/23 ] |
|
Author: {'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}Message: |
| Comment by Githook User [ 24/Apr/23 ] |
|
Author: {'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}Message: |
| Comment by Ana Meza [ 18/Apr/23 ] |
|
nicholas.zolnierz@mongodb.com can someone on your team work on this? |