You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vyacheslav Koptilin (Jira)" <ji...@apache.org> on 2022/11/01 12:24:00 UTC

[jira] [Updated] (IGNITE-17996) Strange behavior of SQL CASE expression

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

Vyacheslav Koptilin updated IGNITE-17996:
-----------------------------------------
    Labels: ignite-3  (was: )

> Strange behavior of SQL CASE expression
> ---------------------------------------
>
>                 Key: IGNITE-17996
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17996
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 3.0.0-beta1
>            Reporter: Andrey Khitrin
>            Priority: Major
>              Labels: ignite-3
>
> I observe strange behavior in the next scenario:
>  
> {code:java}
> sql-cli> create table xx (f1 int primary key);
> Updated 0 rows.
> sql-cli> insert into xx values (1);
> Updated 1 rows.
> sql-cli> insert into xx values (2);
> Updated 1 rows.
> sql-cli> select f1, case when f1 < 2 then 'foo' else 'barbar' end as s, length(case when f1 < 2 then 'foo' else 'barbar' end) as ls from xx;
> ╔════╤════════╤════╗
> ║ F1 │ S      │ LS ║
> ╠════╪════════╪════╣
> ║ 2  │ barbar │ 6  ║
> ╟────┼────────┼────╢
> ║ 1  │ foo    │ 6  ║
> ╚════╧════════╧════╝
>  {code}
> I expect `CASE` to return 'foo' value, but de-facto it returns 'foo   ' ('foo' with 3 whitespaces at the end).  Seems like this should be fixed.
>  



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