[
https://issues.apache.org/jira/browse/IGNITE-15080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yury Gerzhedovich updated IGNITE-15080:
---------------------------------------
Description:
I discovered the strange behavior of functions with several string parameters,
which then returns one of these parameters. In this case, the returned
parameter string is expanded with trailing spaces to the length of the longest
string.
{code:java}
query T
SELECT COALESCE(COALESCE(null, 'world'), 'blabla')
----
world - result is 'world ' - so we have extra trailing spaces from max length
string parameter'blabla'{code}
{code:java}
query I
SELECT DECODE(102, 101, 'IBM', 102, 'GRIDGAIN', 103, 'Hewlett Packard','BALL')
----
GRIDGAIN - result is 'GRIDGAIN ' - so we have extra traiing spaces from
max length string parameter 'Hewlett Packard'{code}
see src/test/sql/function/generic/test_decode.test_ignore
see src/test/sql/function/generic/test_coalesce.test_ignore
was:
simple query
{code:java}
SELECT COALESCE(null, null, 'first', 'second', null){code}
returns 'first ' string instead of 'first'
see src/test/sql/function/generic/test_coalesce.test_ignore
> Calcite. Functions extends string parameters by trailing spaces
> ---------------------------------------------------------------
>
> Key: IGNITE-15080
> URL: https://issues.apache.org/jira/browse/IGNITE-15080
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Reporter: Yury Gerzhedovich
> Priority: Major
>
> I discovered the strange behavior of functions with several string
> parameters, which then returns one of these parameters. In this case, the
> returned parameter string is expanded with trailing spaces to the length of
> the longest string.
> {code:java}
> query T
> SELECT COALESCE(COALESCE(null, 'world'), 'blabla')
> ----
> world - result is 'world ' - so we have extra trailing spaces from max
> length string parameter'blabla'{code}
> {code:java}
> query I
> SELECT DECODE(102, 101, 'IBM', 102, 'GRIDGAIN', 103, 'Hewlett Packard','BALL')
> ----
> GRIDGAIN - result is 'GRIDGAIN ' - so we have extra traiing spaces
> from max length string parameter 'Hewlett Packard'{code}
> see src/test/sql/function/generic/test_decode.test_ignore
> see src/test/sql/function/generic/test_coalesce.test_ignore
--
This message was sent by Atlassian Jira
(v8.3.4#803005)