[SERVER-57854] Changed behavior in SBE when filter is {"":null} Created: 20/Jun/21 Updated: 29/Oct/23 Resolved: 09/Sep/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Query Execution |
| Affects Version/s: | None |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Tomer Yakir | Assignee: | Andrii Dobroshynski (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sbe-diff, sbe-post-v1, sbe-rollout | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Backport Requested: |
v5.0
|
||||||||||||||||||||||||
| Sprint: | Query Execution 2021-07-26, QE 2021-08-09, QE 2021-08-23, QE 2021-09-06, QE 2021-09-20 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
On the legacy query engine (4.4, 5.0 with internalQueryForceClassicEngine), passing on a filter object with the form {"": null} evaluates as true and returns all docs. This was observed by a test case with the Go Driver passing bson.D{{}} as the filter. |
| 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 David Storch [ 21/Sep/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
kyle.suarezjennifer.peshansky, nice! Can we make this an explicit goal of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kyle Suarez [ 21/Sep/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
david.storch, this might actually get fixed by jennifer.peshansky as part of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 07/Sep/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Andrii Dobroshynski', 'email': 'andrii.dobroshynski@mongodb.com', 'username': 'dobroshynski'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ethan Zhang (Inactive) [ 22/Jun/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We will put this in the future sprint and investigate what is the right behavior. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ethan Zhang (Inactive) [ 22/Jun/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I actually found any non-existent fields with null value will be true, so I am not 100% convinced that this is just incidental behavior, it makes a bit of sense semantically, although still very strange.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Storch [ 21/Jun/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The server currently doesn't fully support queries over data with empty key names. You can't create an index over a path with an empty key name:
And you can't specify an empty key name in a field path expression in aggregation:
Interestingly, we do seem to support empty key names in the match expression language. I would guess that this behavior is incidental as opposed to being explicitly designed and implemented this way. Examples:
Whether or not a predicate such as {"": 1} is even supposed to be meaningful is an open question. But it does seem to be broken when SBE is enabled, for a reason that has not yet been investigated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kyle Suarez [ 21/Jun/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Note that we are disabling SBE by default for v5.0 in |