[ 
https://issues.apache.org/jira/browse/IGNITE-22932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavel Pereslegin updated IGNITE-22932:
--------------------------------------
    Description: 
The following test
{code:java}
BigDecimal val = new BigDecimal(Long.MAX_VALUE).add(BigDecimal.ONE);
String query = format( "SELECT {}::TINYINT", val);
checkSqlError(Sql.RUNTIME_ERR, "TINYINT out of range", igniteSql(), query);
{code}

Fails with the following
{noformat}
Expected to include: "TINYINT out of range" actual: "BIGINT out of range"
{noformat}

If the value fits into BIGINT, this test passes.

p.s. fix TODO in codebase.

  was:
The following test
{code:java}
  BigDecimal val = new BigDecimal(Long.MAX_VALUE).add(BigDecimal.ONE);
  String query = format( "SELECT {}::TINYINT", val);
  checkSqlError(Sql.RUNTIME_ERR, "TINYINT out of range", igniteSql(), query);
{code}

Fails with the following
{noformat}
Expected to include: "TINYINT out of range" actual: "BIGINT out of range"
{noformat}

If the value fits into BIGINT, this test passes.

p.s. fix TODO in codebase.


> Sql. Confusing error message when casting numeric literal larger than BIGINT
> ----------------------------------------------------------------------------
>
>                 Key: IGNITE-22932
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22932
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>
> The following test
> {code:java}
> BigDecimal val = new BigDecimal(Long.MAX_VALUE).add(BigDecimal.ONE);
> String query = format( "SELECT {}::TINYINT", val);
> checkSqlError(Sql.RUNTIME_ERR, "TINYINT out of range", igniteSql(), query);
> {code}
> Fails with the following
> {noformat}
> Expected to include: "TINYINT out of range" actual: "BIGINT out of range"
> {noformat}
> If the value fits into BIGINT, this test passes.
> p.s. fix TODO in codebase.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to