[
https://issues.apache.org/jira/browse/CALCITE-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035682#comment-18035682
]
Julian Hyde edited comment on CALCITE-7145 at 11/5/25 10:44 PM:
----------------------------------------------------------------
Another thing to bear in mind when deducing effects (what we've been calling
safety) is {*}strictness{*}. A function is said to be *strict* if it always
evaluates all of its arguments. This is important for safety because if any of
the arguments throws, so will the call to the function.
SQL's *case* operator is non-strict (aka lazy). The following expression does
not throw even if x is zero:
{code:java}
case when y > 0 then x / y else 5 end{code}
When I chose the word *strong* to describe how functions propagate nulls, it
was an allusion to strictness, because the propagation of nulls and propagation
of errors tend to run parallel to each other.
was (Author: julianhyde):
Another thing to bear in mind when deducing effects (what we've been calling
safety) is {*}strictness{*}. A function is said to be *strict* if it always
evaluates all of its arguments. This is important for safety because if any of
the arguments throws, so will the call to the function.
SQL's *case* operator is non-strict (aka lazy). The following expression does
not throw even if x is zero:
{code:java}
case when x > 0 then x / y else 5 end{code}
When I chose the word *strong* to describe how functions propagate nulls, it
was an allusion to strictness, because the propagation of nulls and propagation
of errors tend to run parallel to each other.
> RexSimplify should not simplify IS NULL(10/0)
> ---------------------------------------------
>
> Key: CALCITE-7145
> URL: https://issues.apache.org/jira/browse/CALCITE-7145
> Project: Calcite
> Issue Type: Bug
> Reporter: Thomas Rebele
> Assignee: Thomas Rebele
> Priority: Major
> Labels: pull-request-available
>
> RexSimplify incorrectly simplifies {{IS NULL(10/0)}} to false and {{IS NOT
> NULL(10,0)}} to true
> In other DBMS it's either the inverse (sqlite, MySQL, MariaDB), or they throw
> an exception in both cases (Oracle, Postgres). The behavior was also
> mentioned in a comment on CALCITE-3368.
> Is it right that throwing an exception during query execution is the expected
> behavior according to the SQL standard?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)