Fix arithmetic overflow in sqlserver input (#5261)

This commit is contained in:
Phil Schwartz 2019-01-08 16:13:14 -06:00 committed by Daniel Nelson
parent 741a4d9c97
commit 1c3acafc8f
1 changed files with 3 additions and 3 deletions

View File

@ -2097,10 +2097,10 @@ SELECT
-- value -- value
, value = CAST(CASE cc.cntr_type , value = CAST(CASE cc.cntr_type
When 65792 Then cc.cntr_value -- Count When 65792 Then cc.cntr_value -- Count
When 537003264 Then IsNull(Cast(cc.cntr_value as Money) / NullIf(cbc.cntr_value, 0), 0) -- Ratio When 537003264 Then IsNull(Cast(cc.cntr_value as decimal(19,4)) / NullIf(cbc.cntr_value, 0), 0) -- Ratio
When 272696576 Then cc.cntr_value - pc.cntr_value -- Per Second When 272696576 Then cc.cntr_value - pc.cntr_value -- Per Second
When 1073874176 Then IsNull(Cast(cc.cntr_value - pc.cntr_value as Money) / NullIf(cbc.cntr_value - pbc.cntr_value, 0), 0) -- Avg When 1073874176 Then IsNull(Cast(cc.cntr_value - pc.cntr_value as decimal(19,4)) / NullIf(cbc.cntr_value - pbc.cntr_value, 0), 0) -- Avg
When 272696320 Then IsNull(Cast(cc.cntr_value - pc.cntr_value as Money) / NullIf(cbc.cntr_value - pbc.cntr_value, 0), 0) -- Avg/sec When 272696320 Then IsNull(Cast(cc.cntr_value - pc.cntr_value as decimal(19,4)) / NullIf(cbc.cntr_value - pbc.cntr_value, 0), 0) -- Avg/sec
When 1073939712 Then cc.cntr_value - pc.cntr_value -- Base When 1073939712 Then cc.cntr_value - pc.cntr_value -- Base
Else cc.cntr_value End as bigint) Else cc.cntr_value End as bigint)
--, currentvalue= CAST(cc.cntr_value as bigint) --, currentvalue= CAST(cc.cntr_value as bigint)