You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2009/11/18 22:18:39 UTC

[jira] Created: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

ArrayIndexOutOfBoundsException when trying to override generated column
-----------------------------------------------------------------------

                 Key: DERBY-4448
                 URL: https://issues.apache.org/jira/browse/DERBY-4448
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.5.3.0, 10.6.0.0
            Reporter: Knut Anders Hatlen


ij> create table t(a int, b generated always as (-a));
0 rows inserted/updated/deleted
ij> insert into t(b) values (default), (2);
ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Lily Wei (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lily Wei reopened DERBY-4448:
-----------------------------


Reopen to 10.5 back port.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.1.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>             Fix For: 10.6.1.0
>
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali resolved DERBY-4448.
-----------------------------------

    Fix Version/s: 10.5.4.0
       Resolution: Fixed

this issue was also fixed by DERBY-4451 which has already been backported to 10.5.  Resolving issue as fixed in 10.5 branch.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.1.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>             Fix For: 10.5.4.0, 10.6.1.0
>
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4448:
--------------------------------------

    Fix Version/s: 10.5.3.1
                       (was: 10.5.4.0)

Changed 10.5 fix version to match the version on the branch.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.1.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>             Fix For: 10.5.3.1, 10.6.1.0
>
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik resolved DERBY-4448.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 10.6.0.0

Resolving this, since the issue is fixed by the committed fix to DERBY-4451.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>             Fix For: 10.6.0.0
>
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-4448.
-------------------------------------


Verified fix on trunk. Closing.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>             Fix For: 10.6.0.0
>
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen reassigned DERBY-4448:
-----------------------------------------

    Assignee: Knut Anders Hatlen

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4448:
--------------------------------------

    Attachment: forbid.diff

I tried a simple fix, removing the call to forbidGenerationOverrides() in InsertNode.bindStatement() and instead making sure InsertNode.enhanceAndCheckForAutoincrement() calls RCL.forbidOverrides() on all types of ResultSetNodes.

This made the problematic statement fail gracefully, but it introduced one failure in GeneratedColumnsTest.test_005_basicInsert(). That was the same failure as was seen with the first partial patch for DERBY-4433.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik reassigned DERBY-4448:
------------------------------------

    Assignee: Dag H. Wanvik

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779871#action_12779871 ] 

Knut Anders Hatlen commented on DERBY-4448:
-------------------------------------------

One doesn't actually need to override the generated column to see this error. Just trying to insert DEFAULT in all rows also fails this way:

ij> create table t(a int generated always as (-b), b int);
0 rows inserted/updated/deleted
ij> insert into t(a) values (default);
1 row inserted/updated/deleted
ij> insert into t(a) values (default), (default);
ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen reassigned DERBY-4448:
-----------------------------------------

    Assignee:     (was: Knut Anders Hatlen)

Unassigning since it's probably better to revisit the issue after DERBY-4433 and DERBY-4442 have been addressed. But anyone should feel free to pick it up even before that if they see how to solve it.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779704#action_12779704 ] 

Knut Anders Hatlen commented on DERBY-4448:
-------------------------------------------

I think the problem is that DMLModStatementNode.forbidGenerationOverrides() only looks at and modifies the RCL of the top-most source result set. Since it removes generated columns from both the target RCL and the source RCL, the child result sets of the UnionNode representing the multi-row VALUES clause are not processed, so all rows except the first row will end up with more columns than the target RCL.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4448) ArrayIndexOutOfBoundsException when trying to override generated column

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781085#action_12781085 ] 

Dag H. Wanvik commented on DERBY-4448:
--------------------------------------

This patch attached to DERBY-4451 also solves this issue.

> ArrayIndexOutOfBoundsException when trying to override generated column
> -----------------------------------------------------------------------
>
>                 Key: DERBY-4448
>                 URL: https://issues.apache.org/jira/browse/DERBY-4448
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Dag H. Wanvik
>         Attachments: forbid.diff
>
>
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b) values (default), (2);
> ERROR XJ001: Java exception: '0 >= 0: java.lang.ArrayIndexOutOfBoundsException'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.