Details
-
Bug
-
Resolution: Fixed
-
Minor - P4
-
None
-
None
-
Service Arch
-
Fully Compatible
-
ALL
-
Service Arch 2023-11-13, Service Arch 2023-11-27
Description
When a variant IDL type contains an array, it will generate code like this (from query_settings_gen.cpp, the indexHints field)
const BSONType variantType = element.type();
|
switch (variantType) {
|
case Array:
|
if (element.Obj().isEmpty()) {
|
std::uint32_t expectedFieldNumber{0};
|
const IDLParserContext arrayCtxt(kIndexHintsFieldName, &ctxt, ctxt.getTenantId(), getSerializationContext());
|
std::vector<mongo::query_settings::IndexHintSpec> values;
|
|
|
const BSONObj arrayObject = element.Obj();
|
for (const auto& arrayElement : arrayObject) {
|
[...elided...]
|
++expectedFieldNumber;
|
}
|
_indexHints = std::move(values);
|
|
The arrayObject is empty, so the "for" loop, all the code in it, the expectedFieldNumber, and 'values' are not useful. _indexHints will be set to an empty array every time.