-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
ALL
-
-
0
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In the optimization fuzzer, if a query is suspected to fail due to the order of metafields, it will be retried with tryRetryQueryWithSortedMetafields(). Down the line, findMetafield() will iterate through the stages and fields to find references to metafields in order to sort them.
However, it seems that if it tries iterating through a null value, such as in these examples
{"$or":[]}
{"k":"phew nor","v":["$measurement0",null]}
trying to get Object.keys(null) will throw a conversion error which gets caught as an AggError. We should add a check that prevents this attempted conversion in order to avoid BFs from false-negatives.
Since the error gets caught as an AggError, the stack doesn't reflect the actual cause of the problem. This is the relevant error stack:
findMetafield findMetafieldHelper findMetafield findOrderDependentAccumulator sortMetafieldsPipeline tryRetryQueryWithSortedMetafields