-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.0.0-rc7
-
Component/s: Querying
-
Fully Compatible
-
ALL
-
Quint Iteration 3.1.1
The internal representation for the sort order of a plan cache key as defined in canonical_query.cpp:269-276 is ambiguous because it does not use any separators for multiple keys.
These two queries produce the same cache key and could therefore incorrectly use a wrong cached plan:
db.coll.find( {a: {$gt: 1}, b:1} ).sort( {a:1, b:1} ) db.coll.find( {a: {$gt: 1}, b:1} ).sort( {aab:1} )
Both produce the internal key: an[eqb,gta]~aaab.
This could be avoided with a separator between multiple sort keys, e.g.
an[eqb,gta]~aaab an[eqb,gta]~aa,ab
- is related to
-
SERVER-13007 Query plan cache key not unique to query shape
- Closed
- links to