Andrey Khitrin created IGNITE-17996:
---------------------------------------

             Summary: 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


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)

Reply via email to