Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
ALL
Description
If group gets a result from a shard that returns a long value, it will set totalType to NumberLong and may fail to include previously read double values when calculating the average.
Test (based on other unit test base classes):
/* Router result for a double and a long. */
|
class DoubleLong : public TwoOperandBase {
|
BSONObj operand1() {
|
return BSON( "d" << BSON( "subTotal" << 5.0 << "count" << 2 ) );
|
}
|
BSONObj operand2() {
|
return BSON( "d" << BSON( "subTotal" << 6LL << "count" << 1 ) );
|
}
|
BSONObj expectedResult() { return BSON( "" << 11.0/3 ); }
|
};
|
Actual result is 2.0 since the 5.0 value is not added to the total.