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

Julian Hyde commented on CALCITE-7145:
--------------------------------------

Let’s stipulate  that 1 / 0 should throw. (There are probably already feature 
flags that allow you to get calcite to perform in a mode compatible with MySQL, 
and someone should link to those cases.)

To solve this properly we would need to add to the type system the idea that an 
expression may not terminate. It’s valid to say “is null (1 / 0)” reduces to 
false if it terminates. In fact it’s trivially true, because it never 
terminates. 

This has likely come up several times before in JIRA cases. Key words are 
strictness and effects. 

> RexSimplify produces an incorrect result for IS NULL(10/0)
> ----------------------------------------------------------
>
>                 Key: CALCITE-7145
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7145
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Thomas Rebele
>            Priority: Major
>
> 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