[ https://issues.apache.org/jira/browse/IGNITE-18175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrey Khitrin resolved IGNITE-18175. ------------------------------------- Resolution: Fixed > SQL: value out of type bounds is converted into 0 during implicit casting > ------------------------------------------------------------------------- > > Key: IGNITE-18175 > URL: https://issues.apache.org/jira/browse/IGNITE-18175 > Project: Ignite > Issue Type: Bug > Components: sql > Affects Versions: 3.0.0-beta1 > Reporter: Andrey Khitrin > Priority: Major > Labels: calcite2-required, calcite3-required, ignite-3 > > A simple scenario: > {code:sql} > create table test_e011_INTEGER_from (key_field INT PRIMARY KEY, field1 > INTEGER); > insert into test_e011_INTEGER_from (key_field, field1) values (1, > -2147483648); > create table test_e011_SMALLINT (key_field INT PRIMARY KEY, field1_SMALLINT > SMALLINT); > insert into test_e011_SMALLINT (key_field, field1_SMALLINT) values (1, > (select field1 from test_e011_INTEGER_from where key_field=1)); > select * from test_e011_SMALLINT; > {code} > I expect it either to return '1, null' (like in postrgres or sqlite3) or to > raise an error on insert (like in GG8) as value of -2147483648 is out of > bounds for SMALLINT data type. > Instead, '1, 0' is stored within test_e011_SMALLINT table and returned from > select. In other words, -2147483648 was converted into 0. Such behavior seems > as incorrect. -- This message was sent by Atlassian Jira (v8.20.10#820010)