Andrey Khitrin created IGNITE-18167:
---------------------------------------

             Summary: SQL: incorrect NULLIF behavior
                 Key: IGNITE-18167
                 URL: https://issues.apache.org/jira/browse/IGNITE-18167
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 3.0.0-beta1
            Reporter: Andrey Khitrin


A SQL spec says the following:

??NULLIF (V1 , V2) is equivalent to the following <case specification>: CASE 
WHEN V1 = V2 THEN NULL ELSE V1 END??

When I try to run it, the rule above is true only for the simplest cases.

{code:sql}
select NULLIF(25, 25);          --> null                (OK)
select NULLIF(24, 25);          --> 24                  (OK)
select NULLIF('test', 'abc');   --> 'test'              (OK)
select NULLIF('test', 'test');  --> ''                  (should be null!)
select NULLIF(24 + 1, 26 - 1);  --> error IGN-SQL-27    (should be null!)
{code}

Probably, there are two defects: one is for wrong return value in case of 
textual data, and another one is for error when expression within NULLIF is 
used.



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

Reply via email to