[
https://issues.apache.org/jira/browse/CALCITE-5708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17724066#comment-17724066
]
Julian Hyde commented on CALCITE-5708:
--------------------------------------
For me it seems to be working already:
{noformat}
> select substring(s, i, l)
> from (values ('abc', 1, 2), (null, 1, 2), ('abc', null, 2),('abc', 1, null))
> as t (s, i, l);
+--------+
| EXPR$0 |
+--------+
| ab |
| |
| |
| |
+--------+
4 rows selected (0.034 seconds)
> select substring(s from i for l)
> from (values ('abc', 1, 2), (null, 1, 2), ('abc', null, 2),('abc', 1, null))
> as t (s, i, l);
+--------+
| EXPR$0 |
+--------+
| ab |
| |
| |
| |
+--------+
4 rows selected (0.054 seconds) {noformat}
> Change SUBSTRING result if either of parameters is NULL
> -------------------------------------------------------
>
> Key: CALCITE-5708
> URL: https://issues.apache.org/jira/browse/CALCITE-5708
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.34.0
> Reporter: Evgeny Stanilovsky
> Assignee: Evgeny Stanilovsky
> Priority: Major
> Labels: patch-available
>
> According to standard:
> {noformat}
> 6.18 <string value function>
> ...
> 3)If <character substring function> is specified, then:
> ...
> c) If either C, S, or L is the null value, then the result of the <character
> substring function> is
> the null value.
> {noformat}
> calcite not follow this rule for now.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)