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 2E8016622 for ; Sat, 2 Jul 2011 14:15:51 +0000 (UTC) Received: (qmail 47195 invoked by uid 500); 2 Jul 2011 14:15:51 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 47146 invoked by uid 500); 2 Jul 2011 14:15:50 -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 47139 invoked by uid 99); 2 Jul 2011 14:15:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 14:15:49 +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; Sat, 02 Jul 2011 14:15:48 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A2832441F10 for ; Sat, 2 Jul 2011 14:15:28 +0000 (UTC) Date: Sat, 2 Jul 2011 14:15:28 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: <1670048005.10665.1309616128661.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1801196890.19500.1305647687503.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DERBY-5236) Client driver silently truncates strings that exceed 32KB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-5236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059027#comment-13059027 ] Knut Anders Hatlen commented on DERBY-5236: ------------------------------------------- Right, I only did a quick search for how length was represented various places, and I haven't yet done any research into what's the relevant definition for the length field in this particular method. One example I found was in V4, vol 2, p 48: Field Length format: signed binary integer units: characters for DBCS; else bytes value: 0 - 32767 for SBCS and mixed SBCS/DBCS 0 - 16383 for DBCS I believe SBCS is single-byte character set and DBCS is double-byte character set. Now, UTF-8 is a variable-width encoding and therefore neither SBCS nor DBCS, strictly speaking. > 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 > Assignee: Knut Anders Hatlen > Attachments: repro.diff, write-full-string.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 = prepareStatement( > "values cast(? as varchar(20000))"); > char[] chars = new char[20000]; > Arrays.fill(chars, '\u4e10'); > String str = 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