|
Dag H. Wanvik made changes - 25/Nov/08 05:21 PM
Dag H. Wanvik made changes - 25/Nov/08 05:23 PM
Dag H. Wanvik made changes - 25/Nov/08 05:23 PM
Rick Hillegas made changes - 02/Dec/08 06:52 PM
Rick Hillegas made changes - 02/Dec/08 06:53 PM
Rick Hillegas made changes - 02/Dec/08 06:54 PM
Tests passed cleanly for me on derby-3964-01-aa-onDeleteSetNull.diff except for the heisenbug in the stress multi tests. Committed at subversion revision 722623.
Rick Hillegas made changes - 02/Dec/08 09:45 PM
Rick Hillegas made changes - 03/Dec/08 10:52 PM
I cannot tell from this report which versions it occurs in nor which it is fixed in.
I also need to know whether it could be the same as the error I am incurring in both v10.3.3.0 and v10.4.2.0 (but not v10.3.2.1). It is an error in which I incur a NullPointerException trying to delete a row from a table with ON DELETE referential actions (though not a SET NULL action). The error is exemplified by the following sequence in IJ: ij> delete from app."LineItem" where "Id" = 60275; ERROR XJ001: Java exception: ': java.lang.NullPointerException'. ij> select * from app."LineItem" where "Id" = 60275; ERROR 08003: No current connection. The LineItem table has the following constraints: ALTER TABLE "APP"."LineItem" ADD CONSTRAINT "LineItem_FK_OrderId" FOREIGN KEY ("OrderId") REFERENCES "APP"."Order" ("Id") ON DELETE CASCADE ON UPDATE NO ACTION; ALTER TABLE "APP"."LineItem" ADD CONSTRAINT "LineItem_FK_ProductId" FOREIGN KEY ("ProductId") REFERENCES "APP"."Product" ("Id") ON DELETE RESTRICT ON UPDATE NO ACTION; (Setting affects-version and fix-version to 10.5.0.0.)
Chip, As I understand this bug, it only affects a new feature in 10.5 (generated columns), so I think you must be seeing something else. Just a guess, but it looks similar to
Knut Anders Hatlen made changes - 31/Jan/09 10:54 AM
Myrna van Lunteren made changes - 04/May/09 06:23 PM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Here's what was going on:
o The cascaded change translated into an UPDATE on the foreign key table.
o During the cascaded change, generation clauses were being evaluated on the pre-images of columns as well as on the after images in the UPDATE row.
o The pre-image referred to a ResultSet whose row was not available at execution time.
o That triggered the NPE.
The fix was to eliminate the useless evaluation of the generation clause on the pre-image of the column.
Touches the following files:
M java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
The code-generation of generation clauses is changed to only build code for after images. This involves adding an argument to generateGenerationClauses(), flagging whether the statement is an UPDATE.
M java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
M java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
Adds the extra argument to the callers of generateGenerationClauses.
M java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
Adds a test case.