db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-4805) Increase the length of the RDBNAM field in the DRDA implementation
Date Thu, 23 Jan 2014 15:28:43 GMT

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

Mamta A. Satoor updated DERBY-4805:

    Attachment: DERBY4805_patch3_stat.txt

I am attaching patch DERBY4805_patch3_diff.txt which has RDBNAM length limit of 1024 bytes.
This length used to be 255 bytes.
I have run derbyall with this patch and there were no failures. junit suite ran fine too except
InternationalConnectTest.java. InternationalConnectTest has a fixture named testBoundaries
which has positive test to try 1024 bytes long RDBNAM and then a negative test to go over
the limit for RDBMAM. 

The positive test in testBoundaries fails with the patch both on Windows and Linux machines.
It appears that atleast on Windows, the individual components of a filename (i.e. each subdirectory
along the path, and the final filename) can not be greater than 255 characters. The positive
test is testing the final filename as 1024 characters long and thus causing the fixture to

The length limit for RDBNAM includes the entire filename(not just the final filename) along
with any parameters in the url(for eg ;create=true etc)and so I hand tested following with
and without my patch
java org.apache.derby.drda.NetworkServerControl -noSecurityManager start &
java  -Dij.exceptionTrace=true org.apache.derby.tools.ij
connect 'jdbc:derby://localhost:1527/c:/del/del22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222/dellater11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111/db1;create=true';
Notice that individual component of filename are shorter than 255 characters but the total
length of the string after jdbc:derby://localhost:1527/ in the jdbc url is 435 characters
ie greater than 255 characters. The above connection attempt through ij works with my patch
but fails without it which demonstrates that with the patch, we do accept RDBNAM longer than
255 characters. 

For now, I am not running the boundary test with Windows OS. Probably I need to put the same
rule for other oses with similar restriction of individual component length. Ideally, I should
change positive and negaive test cases to to use individual filename component shorter than
255 characters but the total url length withouthout "jdbc:derby://localhost:1527/" to be exactly
1024(for positive test case) or greater than 1024(for negative test case) to test the boundaries.
Has anyone ever had to write a junit test where you don't create the test db in the default
location and not use the default 'wombat' name for the db? My test probably would need to
do that so that full filename in url will add upto be 1024 characters.

Appreicate any feedback. Thanks

> Increase the length of the RDBNAM field in the DRDA implementation
> ------------------------------------------------------------------
>                 Key: DERBY-4805
>                 URL: https://issues.apache.org/jira/browse/DERBY-4805
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client, Network Server
>    Affects Versions:
>            Reporter: Tiago R. Espinha
>            Assignee: Mamta A. Satoor
>              Labels: derby_triage10_9
>         Attachments: DERBY4805_patch2_diff.txt, DERBY4805_patch2_stat.txt, DERBY4805_patch3_diff.txt,
DERBY4805_patch3_stat.txt, DERBY_4805_diff_patch1.txt
> Currently, whenever the client driver is used, there is a limit of 255 bytes for the
database name. This is defined by the DRDA spec and there has been a discussion on the list
[1]/[2] as to whether this limit should be raised due to the introduction of the new ACR that
allows for UTF-8 characters.
> UTF-8 characters can take up to four bytes and this reduces the limit in characters dramatically.
> This should be an easy change as there is a codepoint that defines this limit.
> [1] did not work but [2] did
> [1] - http://old.nabble.com/Database-name-length-tt29691419.html
> [2]http://apache-database.10148.n7.nabble.com/Database-name-length-td33182.html

This message was sent by Atlassian JIRA

View raw message