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 604D996EB for ; Wed, 14 Dec 2011 10:50:02 +0000 (UTC) Received: (qmail 46797 invoked by uid 500); 14 Dec 2011 10:50:02 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 46779 invoked by uid 500); 14 Dec 2011 10:50:02 -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 46772 invoked by uid 99); 14 Dec 2011 10:50:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2011 10:50:02 +0000 X-ASF-Spam-Status: No, hits=-2001.5 required=5.0 tests=ALL_TRUSTED,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; Wed, 14 Dec 2011 10:49:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 941D71123F1 for ; Wed, 14 Dec 2011 10:49:30 +0000 (UTC) Date: Wed, 14 Dec 2011 10:49:30 +0000 (UTC) From: "Knut Anders Hatlen (Commented) (JIRA)" To: derby-dev@db.apache.org Message-ID: <429726835.10468.1323859770608.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1360687411.53658.1323359140616.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DERBY-5525) Precision for UPPER function is wrong if the returned value is longer than the literal argument 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-5525?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1316= 9255#comment-13169255 ]=20 Knut Anders Hatlen commented on DERBY-5525: ------------------------------------------- It should be possible to get the proposed behaviour by making SimpleStringO= peratorNode.bindExpression() insert a CastNode on top of the operator and c= ast the result to the correct type. But until we fix DERBY-5537, the cast w= ill only truncate the value and not generate a truncation warning. =20 > Precision for UPPER function is wrong if the returned value is longer tha= n the literal argument > -------------------------------------------------------------------------= ---------------------- > > Key: DERBY-5525 > URL: https://issues.apache.org/jira/browse/DERBY-5525 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.8.2.2 > Reporter: Knut Anders Hatlen > > Seen in ij in a database with territory based collation and German locale= : > =3D=3Dvv=3D COPIED FROM IJ CONSOLE =3Dvv=3D=3D > ij> VALUES UCASE('Stra=C3=9Fenbahn'); > 1 > ----------- > STRASSENBA& > 1 Zeile ausgew=C3=A4hlt > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > And with JDBC calls: > Connection c =3D DriverManager.getConnection( > "jdbc:derby:memory:db;create=3Dtrue;territory=3Dde_DE;" + > "collation=3DTERRITORY_BASED"); > Statement s =3D c.createStatement(); > ResultSet rs =3D s.executeQuery("values upper('Stra=C3=9Fe')"); > System.out.println(rs.getMetaData().getPrecision(1)); > rs.next(); > System.out.println(rs.getString(1)); > This prints > 6 > STRASSE > The precision is wrong, since the returned value is 7 characters long. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira