You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2013/04/26 16:50:52 UTC

svn commit: r1476235 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/dictionary/TriggerDescriptor.java impl/sql/execute/AlterTableConstantAction.java

Author: rhillegas
Date: Fri Apr 26 14:50:50 2013
New Revision: 1476235

URL: http://svn.apache.org/r1476235
Log:
DERBY-6202: Fix bug involving upgrade, triggers, and dropped columns.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java?rev=1476235&r1=1476234&r2=1476235&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java Fri Apr 26 14:50:50 2013
@@ -465,6 +465,12 @@ public class TriggerDescriptor extends T
 		return ArrayUtil.copy( referencedCols );
 	}
 
+    /** Update the array of referenced columns */
+    public  void    setReferencedCols( int[] newCols )
+    {
+        referencedCols = ArrayUtil.copy( newCols );
+    }
+
 	/**
 	 * Get the referenced column array for the trigger action columns.
 	 *

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java?rev=1476235&r1=1476234&r2=1476235&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java Fri Apr 26 14:50:50 2013
@@ -1484,6 +1484,7 @@ class AlterTableConstantAction extends D
 						if (referencedCols[j] > droppedColumnPosition)
 							referencedCols[j]--;
 					}
+                    trd.setReferencedCols( referencedCols );
 					dd.addDescriptor(trd, sd,
 									 DataDictionary.SYSTRIGGERS_CATALOG_NUM,
 									 false, tc);