db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1370446 - /db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java
Date Tue, 07 Aug 2012 19:18:00 GMT
Author: mamta
Date: Tue Aug  7 19:18:00 2012
New Revision: 1370446

URL: http://svn.apache.org/viewvc?rev=1370446&view=rev
Log:
DERBY-5839 (dblook run on toursdb fails on triggers with java.lang.StringIndexOutOfBoundsException
in dblook.log)

We document that SYSTRIGGERS.REFERENCEDCOLUMNS is not part of the public API and hence that
allows Derby to change underneath the behavior of the column. Prior to 10.9, this column only
had information about columns referenced by UPDATE trigger. But, with 10.9, we use this column
to also hold information about the trigger columns being used inside trigger action plan.
This enables Derby to read only necessary columns from trigger table. But because of this
change, it is not enough in dblook to check if SYSTRIGGERS.REFERENCEDCOLUMNS.wasNull. We need
to also check if the string representation of that column is "NULL". Making this change fixes
DERBY-5839



Modified:
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java?rev=1370446&r1=1370445&r2=1370446&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java Tue
Aug  7 19:18:00 2012
@@ -125,7 +125,24 @@ public class DB_Trigger {
 						break;
 			case 'U':	sb.append("UPDATE");
 						String updateCols = aTrig.getString(7);
-						if (!aTrig.wasNull()) {
+						//DERBY-5839 dblook run on toursdb fails on triggers
+						//	with java.lang.StringIndexOutOfBoundsException in
+						//	dblook.log
+						//We document that SYSTRIGGERS.REFERENCEDCOLUMNS is not
+						// part of the public API and hence that allows Derby 
+						// to change underneath the behavior of the column.
+						// Prior to 10.9, this column only had information
+						// about columns referenced by UPDATE trigger. But,
+						// with 10.9, we use this column to also hold 
+						// information about the trigger columns being used 
+						// inside trigger action plan. This enables Derby to 
+						// read only necessary columns from trigger table. But
+						// because of this change, it is not enough in dblook
+						// to check if SYSTRIGGERS.REFERENCEDCOLUMNS.wasNull. 
+						// We need to also check if the string representation 
+						// of that column is "NULL". Making this change fixes
+						// DERBY-5839
+						if (!aTrig.wasNull() && !updateCols.equals("NULL")) {
 							sb.append(" OF ");
 							sb.append(dblook.getColumnListFromDescription(
 								aTrig.getString(6), updateCols));



Mime
View raw message