You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2024/06/26 06:10:00 UTC

[jira] [Commented] (IGNITE-22444) Sql. Assign CHARACTER or CHARACTER VARYING to the other type.

    [ https://issues.apache.org/jira/browse/IGNITE-22444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17860072#comment-17860072 ] 

Evgeny Stanilovsky commented on IGNITE-22444:
---------------------------------------------

Seems need to fix it here : IgniteTypeCoercion#doBinaryComparisonCoercion, IgniteTypeCoercion#commonTypeForBinaryComparison and return more wide numeric type.

> Sql. Assign CHARACTER or CHARACTER VARYING to the other type.
> -------------------------------------------------------------
>
>                 Key: IGNITE-22444
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22444
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 3.0.0-beta1
>            Reporter: Evgeny Stanilovsky
>            Priority: Major
>              Labels: ignite-3
>
> According to standard:
> {noformat}
> Values of either the CHARACTER or CHARACTER VARYING data type can be assigned to the other type, subject to truncation conditions
> {noformat}
> Thus i expect such expressions need to be processed correctly, but it fails:
> {noformat}
> create table tiny(v TINYINT);
> insert into tiny values(127);
> SELECT * FROM tiny WHERE v < '300';
> {noformat}
> {noformat}
> Caused by: org.apache.ignite.sql.SqlException: IGN-SQL-5 TraceId:cfce3f69-606e-482b-b267-260f8569df62 Value '300' out of range for type TINYINT
> 	at org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.literalCanFitType(IgniteSqlValidator.java:714)
> 	at org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.checkTypesInteroperability(IgniteSqlValidator.java:680)
> 	at org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.deriveType(IgniteSqlValidator.java:550)
> {noformat}
> Seems such a problem was introduced here [1]
> [1] IGNITE-18662



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