[SERVER-67506] [CQF] Dotted path equality to null incorrectly matches non-object array elements Created: 24/Jun/22  Updated: 12/Sep/23

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: bonsai-semantic-difference
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-66606 Full statistics pipeline Closed
Duplicate
is duplicated by SERVER-69782 In CQF we erroneously match documents Closed
is duplicated by SERVER-70929 cover_null_queries.js returns unexpec... Closed
Related
related to SERVER-36681 Change {$ne: null} semantics to be mo... Backlog
is related to SERVER-69782 In CQF we erroneously match documents Closed
is related to SERVER-80976 [CQF] Fall back to classic on dotted ... Closed
is related to SERVER-75067 [CQF] Support simplifications related... Open
Assigned Teams:
Query Optimization
Participants:

 Description   

The following query incorrectly returns the one document when run through CQF:

coll.insert({a: [5]});
assert.eq(0, coll.find({'a.b': null}).itcount());

The semantics are that if the leading path resolves to an object, then the `b` field of that object must be null/missing. But in this case, the leading path `a` does not find an object even with implicit array traversal so the command should return 0 documents.

The existing test that exercises this is here.



 Comments   
Comment by Hana Pearlman [ 12/Sep/23 ]

After a discussion yesterday, we decided to defer changing behavior here. We think there is room for improvement in both the classic and CQF behavior, but are not prepared to commit to a change now. For now, we will fall back to classic on dotted path equality to null queries but otherwise leave the CQF behavior unchanged.

I'm moving this ticket out of the correctness project and leaving it open so we can pick the discussion back up when we're ready. SERVER-80976 will handle changing the fallback mechanism for these queries.

Comment by Svilen Mihaylov (Inactive) [ 13/Jul/22 ]

Possibly related to https://jira.mongodb.org/browse/SERVER-36635?

Generated at Thu Feb 08 06:08:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.