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

Kathey Marsden updated DERBY-728:
---------------------------------

    Attachment: derby-728_proto_diff.txt

Attaching prototype of changes.  This patch is *not* for commit. The prototype 
implements UNICODEMGR manager level to negotiate DDM parameter encoding.  There 
are some places where performance degredation could occur which need to be 
addressed and some other issues in comments in the code.  The prototype 
implementation adds a UTF8CcsidManager to client and server and switches the 
ccsidmgr in the DDMReader and DDMWriter based on the negotiated encoding.  
Probably that is not the clearest implementation since the new thing is called 
a UNICODEMGR not a CCSIDMANAGER, but this was the quickest way to implement the 
prototype.   I haven't thought of a better way to do it yet but am open to 
suggestions.


The actual implementation will be in subtasks of this issue.  

- Remove required RDBNAM from ACCSEC
- Client should only send RDBNAM on ACCSEC if EBCDIC conversion is possible.
-  Accomidate length delimited DRDA strings where string length does not equal 
byte length.
- Implement UNICODEMGR support.  Perhaps this can be broken up into subtasks 
but hopefully won't be too big ones the other three are done.




> 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
>         Attachments: 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.

Reply via email to