Issue Details (XML | Word | Printable)

Key: DERBY-4146
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Rick Hillegas
Reporter: Knut Anders Hatlen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Cannot insert row when a generated column references an identity column

Created: 05/Apr/09 08:45 PM   Updated: 04/May/09 06:24 PM
Component/s: SQL
Affects Version/s: None
Fix Version/s: 10.5.1.1, 10.6.0.0

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-4146-01-aa-addColumnDescriptor.diff 2009-04-07 07:37 PM Rick Hillegas 5 kB

Resolution Date: 08/Apr/09 01:12 PM


 Description  « Hide
ij> create table t (c1 int generated always as identity, c2 generated always as (c1));
0 rows inserted/updated/deleted
ij> insert into t values (default, default);
ERROR 23502: Column 'C2' cannot accept a NULL value.

Preferably, this should work. Alternatively, if it is not supposed to work, it should fail when the table is created and the error message should state that a generated column is not allowed to reference an identity column.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #763230 Wed Apr 08 13:00:38 UTC 2009 rhillegas DERBY-4146: Bind a column descriptor to a generated result column for INSERTs without target lists.
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java

Repository Revision Date User Message
ASF #763235 Wed Apr 08 13:11:53 UTC 2009 rhillegas DERBY-4146: Ported 763230 from trunk to 10.5 branch.
Files Changed
MODIFY /db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
MODIFY /db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java