db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4425) NullPointerException with INSERT INTO ... from UNION and columns generated from expressions
Date Thu, 29 Oct 2009 02:28:59 GMT

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

Bryan Pendleton updated DERBY-4425:
-----------------------------------

    Attachment: checkIsGenerated.diff

Attached is a patch proposal. This patch is quite similar to the idea in DERBY-4419, but
this patch uses resultColumn.isGeneratedForUnmatchedColumnInInsert() rather than
the isAutoincrementGenerated() method.

The patch includes a regression test, but I haven't run the entire suite, just the GeneratedColumnsTest.

It appears that the use of isGeneratedForUnmanagedColumnInsert not only fixes
this problem, but also fixes DERBY-4419, so I'm going to return to that issue and
see if I can get a single code patch (although with different regression tests) that fixes
both problems.


> NullPointerException with INSERT INTO ... from UNION and columns generated from expressions
> -------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4425
>                 URL: https://issues.apache.org/jira/browse/DERBY-4425
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1, 10.5.3.0, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Bryan Pendleton
>         Attachments: checkIsGenerated.diff
>
>
> This bug is similar to DERBY-4419, only that it uses columns that are auto-generated
from expressions and not identity columns. The proposed fix for DERBY-4419 only addresses
the case with an identity column.
> ij> create table t1(x int);
> 0 rows inserted/updated/deleted
> ij> create table t2(x int);
> 0 rows inserted/updated/deleted
> ij> create table t3(x int, y generated always as (2*x));
> 0 rows inserted/updated/deleted
> ij> insert into t3(x) select * from t1 union select * from t2;
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.

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