db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-728) Unable to create databases whose name containg Chinese characters through the client driver
Date Fri, 17 Apr 2009 18:54:14 GMT

     [ https://issues.apache.org/jira/browse/DERBY-728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rick Hillegas updated DERBY-728:
--------------------------------

    Attachment: BigTableName.java

Hi Kathey,

Thanks for attaching the proposed change to Volume 1 of the DRDA spec. It got me thinking
about SQL identifiers. It seems from the changes to chapters 6 and 7 on page 5 that DRDA still
thinks that sql identifiers are limited to 255 bytes. I don't know where this limitation actually
surfaces. It doesn't surface in the simple test I have attached (BigTableName) which pokes
and peeks a table whose schema name and table name are each 128 unicode characters long, represented
in utf-8 as 384 bytes apiece.

But it may prevent us from extending our DRDA or SQL support in the future. The maximum length
of a SQL identifier is 128 unicode characters, according to part 2 of the 2008 SQL Standard,
section 5.2 (<token> and <separator>), syntax rule (13). Derby supports this maximum
length. At two bytes per Java character, this works out to 256 bytes, not 255. Since each
unicode character can potentially expand to 4 bytes in UTF-8 encoding, the maximum length
of a UTF-8 encoded identifier is 512 bytes. I believe that DRDA's sql identifiers should be
at least 256 bytes long and probably 512 bytes.

Thanks.

> Unable to create databases whose name containg Chinese characters through the client
driver
> -------------------------------------------------------------------------------------------
>
>                 Key: DERBY-728
>                 URL: https://issues.apache.org/jira/browse/DERBY-728
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.1.2.1
>         Environment: Debian unstable, LInux 2.6.14.2, libc 2.3.5-6
>            Reporter: Andrei Badea
>            Assignee: Kathey Marsden
>         Attachments: ACR7007.pdf, BigTableName.java, derby-728-startingpoint.diff, derby-728_proto_diff.txt
>
>
> Trying to create a database with the following URL (note the Chinese character in the
database name):
> jdbc:derby://localhost:1527/\u4e10;create=true
> throws the following exception:
> -----%<-----
> Exception in thread "main" org.apache.derby.client.am.SqlException: Unicode string can't
convert to Ebcdic string
>         at org.apache.derby.client.net.EbcdicCcsidManager.convertFromUCS2(Unknown Source)
>         at org.apache.derby.client.net.Request.writeScalarPaddedString(Unknown Source)
>         at org.apache.derby.client.net.NetConnectionRequest.buildRDBNAM(Unknown Source)
>         at org.apache.derby.client.net.NetConnectionRequest.buildACCSEC(Unknown Source)
>         at org.apache.derby.client.net.NetConnectionRequest.writeAccessSecurity(Unknown
Source)
>         at org.apache.derby.client.net.NetConnection.writeServerAttributesAndKeyExchange(Unknown
Source)
>         at org.apache.derby.client.net.NetConnection.flowServerAttributesAndKeyExchange(Unknown
Source)
>         at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(Unknown Source)
>         at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source)
>         at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
>         at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
>         at java.sql.DriverManager.getConnection(DriverManager.java:525)
>         at java.sql.DriverManager.getConnection(DriverManager.java:193)
>         at jdbctest.Main.main(Main.java:33)
> -----%<-----
> It's possible, however, to create databases using the embedded driver, using an URL like:
> jdbc:derby:\u4e10;create=true
> Tested with both 10.1.1.0 and 10.1.2.1 with the same result.
> Complete code to reproduce the bug:
> -----%<-----
> public static void main(String[] args) throws Exception {
>     Class.forName("org.apache.derby.jdbc.ClientDriver");
>     Connection conn = DriverManager.getConnection("jdbc:derby://localhost:1527/\u4e10;create=true");
> }
> -----%<-----

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message