-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
In cases where buildFle2EncryptPlaceholder is called using an EncryptionPlaceholderContext that is not supported by the field's index, query analysis tries to provide a useful error message containing the field's name, but fails to do so.
This code is found https://github.com/10gen/mongo/blob/5ee2e408f0224a31f812571d67178b11df021d4d/src/mongo/db/modules/enterprise/src/fle/query_analysis/query_analysis.cpp#L1313-L1316
For example:
Error: Client Side Field Level Encryption Error:$encStrStartsWith is not a supported operation on field :
This is because the BSONElement we use to create the placeholder for the constant literal does not contain the field name.
As part of this ticket, investigate and propose a way to provide the field name to this call site.
A proposed place to keep the field name would be in the ResolvedEncryptionInfo, however, on a quick inspection, it looks like we may not always have access to a field name when instantiating/parsing ResolvedEncryptionInfo.
Alternatively, we may be able to find a way to keep the field name associated with a literal value within the ComparedSubtree.
If the effort required to provide the field name is too complex, we should consider simplifying the error message so that we don't need to provide the fieldname.