[ 
https://issues.apache.org/jira/browse/CALCITE-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035388#comment-18035388
 ] 

Mihai Budiu commented on CALCITE-7145:
--------------------------------------

[~zabetak] I really think the problem becomes much simpler if you have two 
operators: DIVIDE and SAFE_DIVIDE. They have different semantics, and different 
SQL dialects really use one or the other.

If you accept that there are two distinct operators, there is no question about 
their properties and behavior with respect to NULLs and you don't have to write 
each optimization by considering what either of them may be doing.

This is really a separate issue from the discussion here, but it will make 
everything much simpler.

I will file a separate JIRA for this.

> 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)

Reply via email to