-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
-
-
QE 2021-11-29, QE 2021-12-13, QE 2021-12-27, QE 2022-01-10, QE 2022-01-24
As can be seen in the attached repro script, when a numeric data set is mixed-typed and the precision is too wide so that int64 can't express any intermediate result, the SBE engine result does not agree with the classic engine result. Results are...
MongoDB Enterprise > db.tt.aggregate([{$group: {_id: null, num : {$sum: {$add: [NumberLong("1000"), "$n"]}}}}]); { "_id" : null, "num" : NumberDecimal("9223372036854777808.0") } MongoDB Enterprise > db.adminCommand({setParameter: 1, internalQueryForceClassicEngine: true}); { "was" : false, "ok" : 1 } MongoDB Enterprise > db.tt.aggregate([{$group: {_id: null, num : {$sum: {$add: [NumberLong("1000"), "$n"]}}}}]); { "_id" : null, "num" : NumberDecimal("9223372036854776809.0") }
- duplicates
-
SERVER-62485 Match the SBE $add behavior to the classic engine's or the other way around
- Closed
- is related to
-
SERVER-58978 Determine narrowest type before computing sum in $add in the classic engine
- Closed