From bandaram@apache.org Tue Oct 5 22:21:35 2004 Return-Path: Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Delivered-To: mailing list derby-commits@db.apache.org Delivered-To: moderator for derby-commits@db.apache.org Received: (qmail 52728 invoked by uid 500); 5 Oct 2004 22:21:35 -0000 Delivered-To: apmail-incubator-derby-cvs@incubator.apache.org Received: (qmail 52725 invoked by uid 99); 5 Oct 2004 22:21:35 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 05 Oct 2004 15:21:35 -0700 Received: (qmail 30174 invoked by uid 65534); 5 Oct 2004 22:21:34 -0000 Date: 5 Oct 2004 22:21:34 -0000 Message-ID: <20041005222134.30172.qmail@minotaur.apache.org> From: bandaram@apache.org To: derby-cvs@incubator.apache.org Subject: svn commit: rev 53829 - incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute X-Virus-Checked: Checked 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) {