[SERVER-34714] An $or query with children which are all trivially false incorrectly optimizes Created: 27/Apr/18  Updated: 29/Oct/23  Resolved: 01/May/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.7.7
Fix Version/s: 3.6.5, 4.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-34759 Improve the planner to detect {$alway... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Sprint: Query 2018-05-07
Participants:
Linked BF Score: 45

 Description   

A query such as the following will never match any documents:

// {a: {$all: []}} will never match.
db.foo.find({$or: [{a: {$all: []}}]});

The server will incorrectly optimize that query which can lead to an bug in planning.



 Comments   
Comment by Githook User [ 11/May/18 ]

Author:

{'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com', 'username': 'cswanson310'}

Message: SERVER-34714 Test an $or with all children always false.
Branch: v3.6
https://github.com/mongodb/mongo/commit/5550703f7ff9f0dc12f508f87cfb98c3bfa2c222

Comment by Githook User [ 01/May/18 ]

Author:

{'email': 'charlie.swanson@mongodb.com', 'name': 'Charlie Swanson', 'username': 'cswanson310'}

Message: SERVER-34714 Optimize $or with all always-false children to $alwaysFalse
Branch: master
https://github.com/mongodb/mongo/commit/bd0e35897b8a43d4590e23db849a1106abe9c44b

Generated at Thu Feb 08 04:37:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.