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

Mamta A. Satoor updated DERBY-4805:
-----------------------------------

    Attachment: DERBY_4805_diff_patch1.txt

It has been a very long time since I have worked on a network server issue. And 
this is my attempt to work in DRDA protocol area so I appreciate any feedback 
from folks familiar with this code.

I am attaching a patch for the issue, named . Basicallt, I am attempting to 
increase the RDBNAM length in bytes from 255 to 32767 (or should it be 32763)? 
I have following questions related to the area I am touching

1)Should the new RDBNAM length in bytes be 32767 or 32763? I think I am 
confused because I have seen 32763 as max size for some other 
length(SECTKN_MAXSIZE) in org.apache.derby.client.net.NetConfiguration but on 
the server side,
in org.apache.derby.impl.drda.CodePoint, I have seen max length for another 
constant as 32767.

2)With my patch, there is one new test failure(I have modified the test in 
/InternationalConnectTest.java to recognize that we accept RDBNAM longer than 
255). 
 
protocol.tests_313_331(org.apache.derbyTesting.functionTests.tests.derbynet.ProtocolTest)junit.framework.AssertionFailedError:
 Wrong synerrcd (0xb != 0x1d) expected:<11> but was:<29>
        at 
org.apache.derbyTesting.functionTests.tests.derbynet.ProtocolTest.checkError(ProtocolTest.java:661)
        at 
org.apache.derbyTesting.functionTests.tests.derbynet.ProtocolTest.processCommand(ProtocolTest.java:389)
        at 
org.apache.derbyTesting.functionTests.tests.derbynet.ProtocolTest.processCommands(ProtocolTest.java:239)
        at 
org.apache.derbyTesting.functionTests.tests.derbynet.ProtocolTest.testProtocolSequence(ProtocolTest.java:148)
        at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at 
org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:118)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at 
org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
I think test failure above requires changes in 
org.apache.derbyTesting.functionTests.tests.derbynet.protocol.tests because 
there is following test for RDBNAM length 256. This length is acceptable now 
with the patch and hence should pass and hence we will not run into "checkError 
SYNTAXRM 8 11 RDBNAM" at the bottom of the following code snippet. Does that 
mean I just remove that check or should I check something else to verify that 
the test runs fine now? Is the failure above related to the following test code 
in protocol.tests?
//
DISPLAY "Test invalid length for RDBNAM"
createDssRequest
startDdm EXCSAT
writeScalarString EXTNAM "test"
endDdm
endDss
createDssRequest
startDdm ACCSEC
writeScalar2Bytes SECMEC 3 //  userid password
writeScalarPaddedBytes RDBNAM "thisNeedsToBeNoMoreThan255CharactersLong" 256
writeScalarString USRID test
writeScalarString PASSWORD test
endDdm
endDss
flush
skipDss         // don't care about the EXCSATRM so just skip
checkError SYNTAXRM 8 11 RDBNAM
endTest
//
3)I think the change in byte length will require some doc changes. 
DERBY-728(Unable to create databases whose name containg Chinese characters 
through the client driver) is related to DERBY-4827 and DERBY-728 had required 
doc changes which went in as part of DERBY-728. DERBY-4827 will most likely 
touch the same part of the doc as DERBY-728. Should I go ahead and create a new 
jira or reopen DERBY-4827? 

Have I missed anything else or does the patch look good otherwise? Thanks for 
reviewing it.


> 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: 10.7.1.1
>            Reporter: Tiago R. Espinha
>            Assignee: Mamta A. Satoor
>              Labels: derby_triage10_9
>         Attachments: 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
(v6.1.4#6159)

Reply via email to