Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-728

Unable to create databases whose name containg Chinese characters through the client driver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.2.1
    • 10.7.1.1
    • Network Client
    • Debian unstable, LInux 2.6.14.2, libc 2.3.5-6
    • Normal
    • High Value Fix, Repro attached
    • Embedded/Client difference

    Description

      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");
      }
      ----%<----

      Attachments

        1. derby-728-startingpoint.diff
          186 kB
          Dyre Tjeldvoll
        2. derby-728_proto_diff.txt
          34 kB
          Katherine Marsden
        3. ACR7007.pdf
          863 kB
          Katherine Marsden
        4. BigTableName.java
          4 kB
          Richard N. Hillegas
        5. DERBY-728_p1.diff
          12 kB
          Tiago R. Espinha
        6. DERBY-728_p2.diff
          13 kB
          Tiago R. Espinha
        7. DERBY-728_p2.diff
          14 kB
          Tiago R. Espinha
        8. DERBY-728_p2-test.diff
          6 kB
          Tiago R. Espinha
        9. DERBY-728_p2.diff
          16 kB
          Tiago R. Espinha
        10. DERBY-728_p2-test.diff
          6 kB
          Tiago R. Espinha
        11. DERBY-728_p2.diff
          18 kB
          Tiago R. Espinha
        12. DERBY-728_p2-test.diff
          5 kB
          Tiago R. Espinha
        13. DERBY-728_p2-test.diff
          1 kB
          Tiago R. Espinha
        14. DERBY_728_p2_sanity.diff
          2 kB
          Tiago R. Espinha
        15. DERBY_728_p3.diff
          4 kB
          Tiago R. Espinha

        Issue Links

          There are no Sub-Tasks for this issue.

          Activity

            People

              espinha Tiago R. Espinha
              andrei.badea Andrei Badea
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: