db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1370464 - in /db/derby/code/branches/10.9: ./ java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java
Date Tue, 07 Aug 2012 19:35:30 GMT
Author: mamta
Date: Tue Aug  7 19:35:30 2012
New Revision: 1370464

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

Backporting from trunk to 10.9


Modified:
    db/derby/code/branches/10.9/   (props changed)
    db/derby/code/branches/10.9/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java

Propchange: db/derby/code/branches/10.9/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1370446

Modified: db/derby/code/branches/10.9/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java?rev=1370464&r1=1370463&r2=1370464&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java
(original)
+++ db/derby/code/branches/10.9/java/tools/org/apache/derby/impl/tools/dblook/DB_Trigger.java
Tue Aug  7 19:35:30 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