From derby-commits-return-17159-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Fri May 31 21:13:48 2013 Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B1DCF43A for ; Fri, 31 May 2013 21:13:48 +0000 (UTC) Received: (qmail 5148 invoked by uid 500); 31 May 2013 21:13:48 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 5122 invoked by uid 500); 31 May 2013 21:13:48 -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 5114 invoked by uid 99); 31 May 2013 21:13:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 May 2013 21:13:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 May 2013 21:13:46 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4696F2388906; Fri, 31 May 2013 21:13:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1488402 - /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java Date: Fri, 31 May 2013 21:13:27 -0000 To: derby-commits@db.apache.org From: mamta@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130531211327.4696F2388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mamta Date: Fri May 31 21:13:26 2013 New Revision: 1488402 URL: http://svn.apache.org/r1488402 Log: DERBY-6237(PreparedStatement.execute() fails starting 10.2 when multiple rows are updated and PreparedStatement.setCharacterStream(int, Reader, int) is used) The test will verify the updated data in the CLOB column Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java?rev=1488402&r1=1488401&r2=1488402&view=diff ============================================================================== --- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java (original) +++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java Fri May 31 21:13:26 2013 @@ -28,6 +28,7 @@ import org.apache.derbyTesting.functionT import java.sql.*; +import java.util.Arrays; import java.math.*; import java.io.*; @@ -2979,6 +2980,7 @@ public class parameterMapping { { CharAlphabet a1 = CharAlphabet.singleChar('a'); + //Following will update one or 2 rows depending on the 1st param PreparedStatement ps = conn.prepareStatement( "UPDATE TestUpdateCharStream SET c3 = ?, " + "c2 = c2 + 1 WHERE c1 IN (?, ?)"); @@ -3008,13 +3010,64 @@ public class parameterMapping { //Second value in IN clause is also getting set to 'EEEEE', which // means prepared statement will update two rows ps.setObject(3, "EEEEE", Types.VARCHAR); - } - + } ps.execute(); + + //verify updated data + ResultSet rs; + ps = conn.prepareStatement( + "select c3 from TestUpdateCharStream " + + "WHERE c1 IN (?, ?)"); + ps.setCharacterStream(1, new CharArrayReader("AAAAA".toCharArray()), 5); + if (numberOfRowsToUpdate == 1 ) { + ps.setObject(2, "AAAAA", Types.VARCHAR); + } else { + ps.setObject(2, "EEEEE", Types.VARCHAR); + } + rs = ps.executeQuery(); + char[] c; + if (testVariation == 1){ + //we are here to test short data + c = new char[50]; + Arrays.fill(c, 'a'); + } else { + //we are here to test large data + c = new char[50000]; + Arrays.fill(c, 'a'); + } + for (int i=0;i