Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 60924 invoked from network); 13 Sep 2010 20:54:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 20:54:33 -0000 Received: (qmail 95184 invoked by uid 500); 13 Sep 2010 20:54:33 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 95153 invoked by uid 500); 13 Sep 2010 20:54:33 -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 95146 invoked by uid 99); 13 Sep 2010 20:54:33 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 20:54:33 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [148.87.113.121] (HELO rcsinet10.oracle.com) (148.87.113.121) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 20:54:10 +0000 Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8DKrjBb019525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Sep 2010 20:53:47 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8DGd8Z4010145 for ; Mon, 13 Sep 2010 20:53:45 GMT Received: from abhmt001.oracle.com by acsmt355.oracle.com with ESMTP id 591025381284411137; Mon, 13 Sep 2010 13:52:17 -0700 Received: from richard-hillegas-computer.local (/76.93.231.55) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Sep 2010 13:52:17 -0700 Message-ID: <4C8E8F00.3030603@oracle.com> Date: Mon, 13 Sep 2010 13:52:16 -0700 From: Rick Hillegas User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: Database name length References: <866536.18935.qm@web29109.mail.ird.yahoo.com> <215495.51344.qm@web29101.mail.ird.yahoo.com> <156385.56364.qm@web29107.mail.ird.yahoo.com> In-Reply-To: <156385.56364.qm@web29107.mail.ird.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Tiago Espinha wrote: > Aha, we do indeed Knut, but I just found a bug that is present at least on > 10.5.3.0. If you try to create a database using the client driver with 243 > [excluding ;create=true] Latin characters (e.g. '�'), the server will throw the > following exception: > > --------------8<---------------- > 2010-09-13 20:26:11.052 GMT : fromIndex(518) > toIndex(275) > java.lang.IllegalArgumentException: fromIndex(518) > toIndex(275) > at java.util.Arrays.rangeCheck(Arrays.java:1306) > at java.util.Arrays.fill(Arrays.java:2567) > at org.apache.derby.impl.drda.DDMWriter.padBytes(Unknown Source) > at org.apache.derby.impl.drda.DDMWriter.writeScalarPaddedBytes(Unknown > Source) > at org.apache.derby.impl.drda.DRDAConnThread.writeRDBNAM(Unknown Source) > ------------8<----------------------- > > This causes havoc as probably '�' is indeed requiring more than one byte to be > encoded. I'm actually surprised this works at all but it's probably some obscure > addition of EBCDIC on top of just regular US-ASCII. When I try to get the bytes > for '�' in plain US-ASCII, I get 63 which is ASCII for the question mark. > > This means that as it is, on the client driver, the limit will be shorter than > 255 characters if these special characters are used. The only matter for concern > is that in previous releases this limit isn't properly handled and we just let > the server crash with a serious unhandled exception. > > I'm all for raising this limit if the community agrees that this does not > violate the DRDA protocol. At this point, our driver contains several Derby-specific extensions to DRDA. This sounds like another reasonable extension to me. +1 Regards, -Rick > I think Kathey also expressed some concern about the > limit on JIRA, so it would be interesting to hear her thoughts on this. > > Tiago > > ----- Original Message ---- > From: Knut Anders Hatlen > To: derby-dev@db.apache.org > Sent: Mon, 13 September, 2010 12:53:11 > Subject: Re: Database name length > > Tiago Espinha writes: > > >> Thank you Knut, for your reply. >> >> Your point #1 is correct. As for point #2 and #3 just a small correction. It is >> >> all characters falling outside the *US-ASCII* encoding that will get a length >> lower than 255 characters as anything other than ASCII requires more than just >> 1 >> >> byte to encode. I'm fairly sure that at this point we do not support ISO-8859-1 >> >> through the client driver as these characters (the extended ones like ��� etc) >> > > >> fall outside US-ASCII. So hopefully this won't break anything as we didn't >> support these characters previously. >> > > I think we do support this. At least, this code ran fine on my machine > with Derby 10.6.1.0 and created a database named ���: > > Connection c = DriverManager.getConnection( > "jdbc:derby://localhost/\u00E1\u00E9\u00F3;create=true"); > > >> As for your suggestion of increasing the length of the field, I'm not sure >> that's an option. This length limitation is imposed by the DRDA specification >> and the ACR unfortunately didn't change this. On the ACR it reads "As of DDM >> Level 7, the RDBNAM can accommodate an RDB name of up to 255 bytes in length, >> and its format will vary depending on the length of the RDB name". So >> essentially, we could easily support a much larger RDB name on Derby but the >> specification forbids it. >> > > DRDA does allow product-unique extensions. I have a hard time seeing any > downside with extending the protocol here. Sending a longer string than > what a strict reading of the spec permits sounds like a lesser evil to > me than disallowing network access to the database. > >