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

Vladimir Sitnikov edited comment on CALCITE-525 at 10/13/18 3:58 PM:
---------------------------------------------------------------------

That does not catch 0/0 kind of errors.

[https://docs.oracle.com/cd/B28359_01/server.111/b28310/tables004.htm#sthref1787]
{quote}Oracle Database logs the following errors during DML operations:
 Column values that are too large
 Constraint violations (NOT NULL, unique, referential, and check constraints)
 Errors raised during trigger execution
 Errors resulting from type conversion between a column in a subquery and the 
corresponding column of the table
 Partition mapping errors
 Certain MERGE operation errors (ORA-30926: Unable to get a stable set of rows 
for MERGE operation.)
{quote}
Here you go:
{code:sql}
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing 
options

SQL> create table julian_error_logging(x number);

Table created.

SQL> exec DBMS_ERRLOG.CREATE_ERROR_LOG('julian_error_logging', 'julian_err');

PL/SQL procedure successfully completed.

SQL> insert into julian_error_logging(x) select 0/0 from dual log errors into 
julian_err;
insert into julian_error_logging(x) select 0/0 from dual log errors into 
julian_err
                                            *
ERROR at line 1:
ORA-01476: divisor is equal to zero{code}
Just in case:
{code:sql}
SQL> insert into julian_error_logging(x) select 1 from dual union all select 
0/0 from dual log errors into julian_err;
insert into julian_error_logging(x) select 1 from dual union all select 0/0 
from dual log errors into julian_err
                                                                         *
ERROR at line 1:
ORA-01476: divisor is equal to zero


SQL> select * from julian_error_logging;

no rows selected{code}


was (Author: vladimirsitnikov):
That does not catch 0/0 kind of errors.

https://docs.oracle.com/cd/B28359_01/server.111/b28310/tables004.htm#sthref1787

{quote}Oracle Database logs the following errors during DML operations:
Column values that are too large
Constraint violations (NOT NULL, unique, referential, and check constraints)
Errors raised during trigger execution
Errors resulting from type conversion between a column in a subquery and the 
corresponding column of the table
Partition mapping errors
Certain MERGE operation errors (ORA-30926: Unable to get a stable set of rows 
for MERGE operation.){quote}

{{log errors into}} does NOT catch 0/0 errors.

Here you go:

{code:sql}Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing 
options

SQL> create table julian_error_logging(x number);

Table created.

SQL> exec DBMS_ERRLOG.CREATE_ERROR_LOG('julian_error_logging', 'julian_err');

PL/SQL procedure successfully completed.

SQL> insert into julian_error_logging(x) select 0/0 from dual log errors into 
julian_err;
insert into julian_error_logging(x) select 0/0 from dual log errors into 
julian_err
                                            *
ERROR at line 1:
ORA-01476: divisor is equal to zero{code}

Just in case:
{code:sql}SQL> insert into julian_error_logging(x) select 1 from dual union all 
select 0/0 from dual log errors into julian_err;
insert into julian_error_logging(x) select 1 from dual union all select 0/0 
from dual log errors into julian_err
                                                                         *
ERROR at line 1:
ORA-01476: divisor is equal to zero


SQL> select * from julian_error_logging;

no rows selected{code}

> Exception-handling in built-in functions
> ----------------------------------------
>
>                 Key: CALCITE-525
>                 URL: https://issues.apache.org/jira/browse/CALCITE-525
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Hongze Zhang
>            Priority: Major
>
> The standard calls for certain built-in functions to throw exceptions.
> Examples:
> * 1 / 0
> * MOD(1, 0)
> * OVERLAY('foo' PLACING 'x' FROM -1)
> * 'x' NOT LIKE 'x' ESCAPE 'x'
> First, these exceptions should occur at run time. They should cause the 
> current value to become null, or the row to be omitted, but should not abort 
> the query. (Actual behavior TBD.)
> Second, EnumerableCalc does constant reduction and generates code like 
> 'static final int X = 0 / 0'. This code blows up when the class is loaded. It 
> should not. The code should give errors for each row, as described above.
> While fixing this bug, see SqlOperatorBaseTest.testArgumentBounds and remove 
> restrictions related to /, MOD and OVERLAY, LIKE.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to