/[Apache-SVN]
ViewVC logotype

Revision 432165


Jump to revision: Previous Next
Author: kmarsden
Date: Thu Aug 17 06:32:27 2006 UTC (3 years, 3 months ago)
Changed paths: 4
Log Message:
DERBY-1652 - Update trigger updating the same rows as the original update does not throw an exception ERROR 54038: "Maximum depth of nested triggers was exceeded" as it should


Contributed by Yip Ng


The cause of the problem is that the trigger descriptor is created after the stored prepared statement(SPS) has been compiled, so the compiled form of the SPS is not aware of that its trigger action can fire on the trigger table itself. Hence, the constant action was not generated correctly.

During upgrade, the SPSs are invalidated at database boot time. The SPS will be recompile when it is being invoked and the recompilation at this point will of course detect the relevent trigger and generate the correct constant action for the SPS and produce the expected behavior when the SPS is executed - throwing an error when it exceeds the trigger's maximum depth in the above case.

The simplest solution without introducing another revalidation of the SPS is to create the trigger descriptor first before compiling the SPS. I ran derbyall and had to go over the testcases which have the wrong master outputs and I have corrected them on this patch.



Changed paths:

Path Details
Directorydb/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTriggerConstantAction.java modified , text changed
Directorydb/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/triggerGeneral.out modified , text changed
Directorydb/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerGeneral.sql modified , text changed
Directorydb/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/updatableResultSet.java modified , text changed

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2