[ https://issues.apache.org/jira/browse/IGNITE-20190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Evgeny Stanilovsky updated IGNITE-20190: ---------------------------------------- Description: Check: ItDataTypesTest {noformat} arguments(CaseStatus.SKIP, decimalType(5, 2), new BigDecimal("100.16"), decimalType(4, 1), bigDecimalVal("100.2")), {noformat} SELECT CAST(100.16::DECIMAL(5, 2) AS DECIMAL(4, 1)) returns 100.2 when called with dynamic parameters and truncated = 100.1 when called as literal check, pg mysql and ora are rounding, not truncated i.e: SELECT CAST (0.16 as decimal(1, 1) returns 0.2 but according to standard: If least significant digits are lost, implementation-defined rounding or truncating occurs was: Check: ItDataTypesTest {noformat} arguments(CaseStatus.SKIP, decimalType(5, 2), new BigDecimal("100.16"), decimalType(4, 1), bigDecimalVal("100.2")), {noformat} SELECT CAST(100.16::DECIMAL(5, 2) AS DECIMAL(4, 1)) returns 100.2 when called with dynamic parameters and truncated = 100.1 when called as literal > Sql. Casting literals into numeric types have different rounding mode from > dynamic params > ----------------------------------------------------------------------------------------- > > Key: IGNITE-20190 > URL: https://issues.apache.org/jira/browse/IGNITE-20190 > Project: Ignite > Issue Type: Bug > Components: sql > Affects Versions: 3.0.0-beta1 > Reporter: Evgeny Stanilovsky > Priority: Major > Labels: ignite-3 > > Check: > ItDataTypesTest > {noformat} > arguments(CaseStatus.SKIP, decimalType(5, 2), new BigDecimal("100.16"), > decimalType(4, 1), bigDecimalVal("100.2")), > {noformat} > SELECT CAST(100.16::DECIMAL(5, 2) AS DECIMAL(4, 1)) returns 100.2 when called > with dynamic parameters and truncated = 100.1 when called as literal > check, pg mysql and ora are rounding, not truncated i.e: > SELECT CAST (0.16 as decimal(1, 1) returns 0.2 > but according to standard: > If least significant digits are lost, implementation-defined rounding or > truncating occurs -- This message was sent by Atlassian Jira (v8.20.10#820010)