Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 76879 invoked from network); 23 Jun 2006 12:20:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jun 2006 12:20:15 -0000 Received: (qmail 25118 invoked by uid 500); 23 Jun 2006 12:20:14 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 25087 invoked by uid 500); 23 Jun 2006 12:20:14 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 25076 invoked by uid 99); 23 Jun 2006 12:20:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jun 2006 05:20:14 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jun 2006 05:20:13 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 74B1F1A9842; Fri, 23 Jun 2006 05:19:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r416696 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/PreparedStatement.java client/org/apache/derby/client/am/Statement.java testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java Date: Fri, 23 Jun 2006 12:19:52 -0000 To: derby-commits@db.apache.org From: kahatlen@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060623121953.74B1F1A9842@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: kahatlen Date: Fri Jun 23 05:19:51 2006 New Revision: 416696 URL: http://svn.apache.org/viewvc?rev=416696&view=rev Log: DERBY-1314: Differences between client and embedded when invoking stored procedures using Statement.executeUpdate() Make executeUpdate() return 0 on the client when executing a stored procedure. Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java?rev=416696&r1=416695&r2=416696&view=diff ============================================================================== --- db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java (original) +++ db/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java Fri Jun 23 05:19:51 2006 @@ -386,13 +386,9 @@ } } - // also used by Blob - int executeUpdateX() throws SqlException { + private int executeUpdateX() throws SqlException { flowExecute(executeUpdateMethod__); - - if (sqlMode_ == isUpdate__) { - super.checkExecuteUpdatePostConditions("java.sql.PreparedStatement"); - } + checkExecuteUpdatePostConditions("java.sql.PreparedStatement"); return updateCount_; } @@ -1797,6 +1793,12 @@ if (connection_.autoCommit_ && resultSet_ == null && resultSetList_ == null && isAutoCommittableStatement_) { connection_.flowAutoCommit(); } + } + + // The JDBC spec says that executeUpdate() should return 0 + // when no row count is returned. + if (executeType == executeUpdateMethod__ && updateCount_ < 0) { + updateCount_ = 0; } // Throw an exception if holdability returned by the server is different from requested. Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java?rev=416696&r1=416695&r2=416696&view=diff ============================================================================== --- db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java (original) +++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Statement.java Fri Jun 23 05:19:51 2006 @@ -2084,6 +2084,12 @@ connection_.flowAutoCommit(); } } + + // The JDBC spec says that executeUpdate() should return 0 + // when no row count is returned. + if (executeType == executeUpdateMethod__ && updateCount_ < 0) { + updateCount_ = 0; + } } void flowExecuteBatch(int[] updateCounts) throws SqlException, BatchUpdateException { Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java?rev=416696&r1=416695&r2=416696&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java Fri Jun 23 05:19:51 2006 @@ -102,7 +102,7 @@ * Tests that Statement.executeUpdate() succeeds when * no result sets are returned. * - *

Currently, this test fails with the client driver and JCC. + *

Currently, this test fails with JCC. * * @exception SQLException if a database error occurs */ @@ -194,7 +194,7 @@ * Tests that PreparedStatement.executeUpdate() * succeeds when no result sets are returned. * - *

Currently, this test fails with the client driver and JCC. + *

Currently, this test fails with JCC. * * @exception SQLException if a database error occurs */ @@ -213,7 +213,7 @@ * Tests that PreparedStatement.executeUpdate() fails * when a result set is returned from a stored procedure. * - *

Currently, this test fails with the client driver and + *

Currently, this test fails with * JCC. However, the corresponding tests for * Statement and CallableStatement * succeed. Strange... @@ -296,7 +296,7 @@ * Tests that CallableStatement.executeUpdate() * succeeds when no result sets are returned. * - *

Currently, this test fails with the client driver and JCC. + *

Currently, this test fails with JCC. * * @exception SQLException if a database error occurs */ @@ -579,7 +579,7 @@ */ public static Test suite() { TestSuite suite = new TestSuite(ProcedureTest.class); - if (usingEmbedded()) { + if (!usingDerbyNet()) { suite.addTest (new ProcedureTest ("xtestExecuteUpdateWithNoDynamicResultSets")); @@ -592,6 +592,8 @@ suite.addTest (new ProcedureTest ("xtestExecuteUpdateWithNoDynamicResultSets_callable")); + } + if (usingEmbedded()) { suite.addTest (new ProcedureTest ("xtestRollbackStoredProcWhenExecuteQueryReturnsNothing"));