Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C37864561 for ; Tue, 17 May 2011 16:08:30 +0000 (UTC) Received: (qmail 34991 invoked by uid 500); 17 May 2011 16:08:30 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 34960 invoked by uid 500); 17 May 2011 16:08:30 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 34953 invoked by uid 99); 17 May 2011 16:08:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 16:08:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 16:08:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 69AE8CE7BA for ; Tue, 17 May 2011 16:07:47 +0000 (UTC) Date: Tue, 17 May 2011 16:07:47 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: <1813274500.19512.1305648467429.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1801196890.19500.1305647687503.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (DERBY-5236) Client driver silently truncates strings that exceed 32KB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-5236?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-5236: -------------------------------------- Attachment: repro.diff The attached patch adds a regression test case for the bug. The test case i= sn't enabled in any suites yet. Committed revision 1104365. The test case passes with the embedded driver, and fails like this with the= client driver: There was 1 failure: 1) testLongColumn(org.apache.derbyTesting.functionTests.tests.jdbcapi.Derby= 5236Test)junit.framework.AssertionFailedError: Column value mismatch @ colu= mn '1', row 1: Expected: >=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8= =90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90= =E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4= =B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8= =90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90(...)< Found: >=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8= =90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90= =E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4= =B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8= =90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90=E4=B8=90(...)< =09at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:121= 3) =09at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:112= 5) =09at org.apache.derbyTesting.junit.JDBC.assertFullResultSetMinion(JDBC.jav= a:1012) =09at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:935) =09at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:892) =09at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:850) =09at org.apache.derbyTesting.junit.JDBC.assertSingleValueResultSet(JDBC.ja= va:835) =09at org.apache.derbyTesting.functionTests.tests.jdbcapi.Derby5236Test.tes= tLongColumn(Derby5236Test.java:57) =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.= java:39) =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces= sorImpl.java:25) =09at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:= 112) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57= ) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) =09at junit.extensions.TestSetup$1.protect(TestSetup.java:21) =09at junit.extensions.TestSetup.run(TestSetup.java:25) =09at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57= ) > Client driver silently truncates strings that exceed 32KB > --------------------------------------------------------- > > Key: DERBY-5236 > URL: https://issues.apache.org/jira/browse/DERBY-5236 > Project: Derby > Issue Type: Bug > Components: Network Client > Affects Versions: 10.8.1.2 > Reporter: Knut Anders Hatlen > Attachments: repro.diff > > > Can be seen with this JUnit test case that retrieves a VARCHAR value with= 20000 characters. With the client driver, the string is truncated to 10900= characters (32700 bytes when encoded in UTF-8). > public void testLongColumn() throws SQLException { > PreparedStatement ps =3D prepareStatement( > "values cast(? as varchar(20000))"); > char[] chars =3D new char[20000]; > Arrays.fill(chars, '\u4e10'); > String str =3D new String(chars); > ps.setString(1, str); > JDBC.assertSingleValueResultSet(ps.executeQuery(), str); > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira