-
Type: Task
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
Fully Compatible
-
QO 2022-07-25, QO 2022-08-08, QO 2022-08-22, QO 2022-09-05, QO 2022-09-19, QO 2022-10-03, QE 2022-10-17, QE 2022-11-14, QE 2022-11-28, QE 2022-12-12, QE 2022-12-26, QE 2023-01-09
A NamespaceStringOrUUID object should only ever hold either a NamespaceString object or a DatabaseName + UUID. Previously, this was enforced because the constructors would only take one or the other, and there were no setters. However, a method NamespaceStringOrUUID::setNss() was added in order to override the namespace for find commands, making it possible to set both the nss and uuid/db name fields. This looks to be used in two places in the find command path - one of these places sets the nss field when the uuid field is already set. There are a number of places that the server relies on the fact that only one of the uuid or nss is set on a NamespaceStringOrUUID object.
I think we should either:
- Remove NamespaceStringOrUUID::setNss() and reconstruct a NamespaceStringOrUUID object instead
- Change NamespaceStringOrUUID::setNss() to also unset the uuid/db name