db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: rev 53829 - incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute
Date Tue, 05 Oct 2004 22:21:34 GMT
Author: bandaram
Date: Tue Oct  5 15:21:33 2004
New Revision: 53829

Modified:
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
Log:
Apply Trigger fix from Jack to enable use of functions in triggers

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
Tue Oct  5 15:21:33 2004
@@ -157,7 +157,18 @@
 			*/
 			try
 			{
-				ps.execute(spsActivation, false, false, false);
+				ResultSet rs = ps.execute(spsActivation, false, false, false);
+                if( rs.returnsRows())
+                {
+                    // Fetch all the data to ensure that functions in the select list or
values statement will
+                    // be evaluated and side effects will happen. Why else would the trigger
action return
+                    // rows, but for side effects?
+                    // The result set was opened in ps.execute()
+                    while( rs.getNextRow() != null)
+                    {
+                    }
+                }
+                rs.close();
 			} 
 			catch (StandardException e)
 			{

Mime
View raw message