You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL it self lacks a proper definition of ROUND. Other DBMSes also seem not to
agree on the definition. Our current implementation seems to follow the sqlserver one, ie we round (positive numbers right from the dot, negative numbers left from the dot), but leave the type alone (ie stays as the input value).
Date: 2017-10-16 11:03:18 +0200
From: Gatis Ozolins <<g.ozolins>>
To: SQL devs <>
Version: 11.27.9 (Jul2017-SP2)
CC: @njnes
Last updated: 2017-12-14 14:46:06 +0100
Comment 25741
Date: 2017-10-16 11:03:18 +0200
From: Gatis Ozolins <<g.ozolins>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
Build Identifier:
SELECT ROUND(123.563, 2) AS val
produces DECIMAL(2,3) data type, but it should be DECIMAL(5,2)
Reproducible: Always
Steps to Reproduce:
create table zz_round_bug as
select ROUND(123.563, 2) as val;
select c.type_digits, c.type_scale
from sys.tables t
join sys.columns c
on t.id = c.table_id
where t.name = 'zz_round_bug'
and c.name = 'val';
Actual Results:
2 3
Expected Results:
5 2
Any filtering on created table produces error:
select * from zz_round_bug where val = 1
SQL Error [22003]: value (123560) exceeds limits of type bte
java.sql.SQLException: value (123560) exceeds limits of type bte
Comment 25939
Date: 2017-12-03 23:13:34 +0100
From: @njnes
SQL it self lacks a proper definition of ROUND. Other DBMSes also seem not to
agree on the definition. Our current implementation seems to follow the sqlserver one, ie we round (positive numbers right from the dot, negative numbers left from the dot), but leave the type alone (ie stays as the input value).
Comment 25940
Date: 2017-12-04 09:01:47 +0100
From: Gatis Ozolins <<g.ozolins>>
But still it should not be possible to create situation where selecting data from table results in error
Comment 25941
Date: 2017-12-04 09:50:17 +0100
From: @sjoerdmullender
This bug was fixed with changeset 6bfbf16160a6
The text was updated successfully, but these errors were encountered: