Details
-
Improvement
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
None
-
Query
Description
Currently, if a user accidentally issues a query with an expression stage that can never be true, we complete a COLLSCAN that produces no results.
> db.foo.find({$expr:{$eq:["a","b"]}}).explain()
|
{
|
"queryPlanner" : {
|
"plannerVersion" : 1,
|
"namespace" : "test.foo",
|
"indexFilterSet" : false,
|
"parsedQuery" : {
|
"$expr" : {
|
"$const" : false
|
}
|
},
|
"winningPlan" : {
|
"stage" : "COLLSCAN",
|
"filter" : {
|
"$expr" : {
|
"$const" : false
|
}
|
},
|
"direction" : "forward"
|
},
|
"rejectedPlans" : [ ]
|
},
|
"serverInfo" : {
|
"host" : "grey.local",
|
"port" : 27017,
|
"version" : "3.6.3",
|
"gitVersion" : "9586e557d54ef70f9ca4b43c26892cd55257e1a5"
|
},
|
"ok" : 1
|
}
|
It would be preferable to error to alert the user that the query was malformed.
Attachments
Issue Links
- is related to
-
SERVER-33506 COLLSCAN when using lookup with partial index match
-
- Closed
-
- related to
-
SERVER-33925 Queries that are known to return no results at plan time should optimize to EOF plan
-
- Backlog
-