Andrey Khitrin created IGNITE-21134:
---------------------------------------

             Summary: Sql. UPPER and LOWER functions must support NULL values
                 Key: IGNITE-21134
                 URL: https://issues.apache.org/jira/browse/IGNITE-21134
             Project: Ignite
          Issue Type: Bug
          Components: clients, sql
    Affects Versions: 3.0.0-beta2
            Reporter: Andrey Khitrin


As described in ANSI99 specification, functions UPPER and LOWER must return 
NULL values for NULL argument:

 

??5) If <fold> is specified, then:??

?? .. b) if S is the null value, then the result of the <fold> is the null 
value.??

In the recent AI3 (commit c2ac5850973ae3bfd44b06fc6e3b5880f9f292f1) an error is 
shown instead:
{code:sql}
sql-cli> SELECT UPPER(NULL);
Unknown error
Unsupported Column type NULL

sql-cli> SELECT LOWER(NULL);
Unknown error
Unsupported Column type NULL
{code}
{*}NOTE{*}: Most probably, it may be caused by client module, not sql module 
because a text of error is located in client-common module:
{code:java}
$ grep -r 'Unsupported Column type' modules/*/src/main

modules/client-common/src/main/java/org/apache/ignite/internal/jdbc/JdbcConverterUtils.java:
                throw new IllegalArgumentException("Unsupported Column type " + 
columnType);
{code}
And when I add the following assertion to some test in ItFunctionsTest, it 
passes:
{code:java}
        assertQuery("SELECT LOWER(NULL)").returns(null).check();
{code}
Previous AI3 versions allowed using NULL values in UPPER and LOWER functions, 
hence it's a degradation.



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

Reply via email to