db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4451) ArrayIndexOutOfBoundsException or ASSERT FAILED when inserting generated columns out of order
Date Tue, 24 Nov 2009 01:50:39 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dag H. Wanvik updated DERBY-4451:
---------------------------------

    Attachment: derby-4451c.stat
                derby-4451c.diff

Uploading derby-4451c, which fixes the case seen by Knut. It also now handles INTERSECT/EXCEPT
and any nested use of DEFAULT, i.e. use of DEFAULT is only allowed in a top level table constructor.
Note that this does not solve DERBY-4426, which does not have an explicit target column list,
and so is not checked by forbidGenerationOverrides#forbidGenerationOverrides. We do need to
add this logic here, though, for otherwise we would lose the information that the user provided
a default in a nested table constructor (it would be pruned away). The alternative would be
to just throw LANG_CANT_OVERRIDE_GENERATION_CLAUSE, but that could be confusing for the following
query:

        insert into t(a,b) values (3,default) union all values (3,default)

Added more test cases, rerunning regressions.



> ArrayIndexOutOfBoundsException or ASSERT FAILED when inserting generated columns out
of order
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4451
>                 URL: https://issues.apache.org/jira/browse/DERBY-4451
>             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: derby-4451.diff, derby-4451.stat, derby-4451b.diff, derby-4451b.stat,
derby-4451c.diff, derby-4451c.stat
>
>
> I see this error when I specify the columns in a different order than in the table definition.
It only fails if a multi-row table constructor is used.
> ij> create table t(a int, b generated always as (-a));
> 0 rows inserted/updated/deleted
> ij> insert into t(b,a) values (default,1);
> 1 row inserted/updated/deleted
> ij> insert into t(b,a) values (default,1), (default, 2);
> ERROR XJ001: Java exception: '1 >= 1: java.lang.ArrayIndexOutOfBoundsException'.
> And in a sane build:
> ij> insert into t(b,a) values (default,1),(default,2);
> ERROR XJ001: Java exception: 'ASSERT FAILED More columns in result column list than in
base table: org.apache.derby.shared.common.sanity.AssertFailure'.
> This bug may be similar to DERBY-4448, but the stack trace is different, and DERBY-4448
does not raise an ASSERT FAILED in sane builds.

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


Mime
View raw message