[
https://issues.apache.org/jira/browse/DERBY-4145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12696212#action_12696212
]
Rick Hillegas commented on DERBY-4145:
--------------------------------------
The bug occurs when a generation clause includes a forward reference to a
generated column which is declared later on in the table's signature. The bug
occurs because we look for the referenced columns after we bind the generation
clauses. When we bind the earlier generated columns, we trip across references
to columns which haven't been bound yet. This raises an npe. The fix is to bind
the generation clauses after we look for illegal references.
> NullPointerException on CREATE TABLE when generated column depends on another
> generated column
> ----------------------------------------------------------------------------------------------
>
> Key: DERBY-4145
> URL: https://issues.apache.org/jira/browse/DERBY-4145
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.5.1.0
> Reporter: Knut Anders Hatlen
> Assignee: Rick Hillegas
>
> ij> create table t (c1 int, c2 int, c3 generated always as (c1 + c4), c4
> generated always as (-c1));
> 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.