[
https://issues.apache.org/jira/browse/DERBY-2694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Anurag Shekhar updated DERBY-2694:
----------------------------------
Attachment: derby-2694.diff
org.apache.derby.impl.drda.DDMWriter.writeLDString (String s) has a code to
check if the splited utf-8 byte array ends with a multibyte char (while loop
near 1223). In case the last byte is part of the multibyte char it tries to
reduce the length of byte array so that it ends at the last byte of last
character.
This logic has a small mistake. An if block which should have been after while
loop was placed inside it.
junit.All tests run clean with this patch but I am still seeing truncating
issue I have mentioned in my previous comments after this patch it client
receives string of length 10899.
> org.apache.derby.impl.drda.DDMWriter uses wrong algorithm to avoid spliting
> varchar in the middle of a multibyte char.
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2694
> URL: https://issues.apache.org/jira/browse/DERBY-2694
> Project: Derby
> Issue Type: Bug
> Components: Network Server
> Environment: all
> Reporter: Anurag Shekhar
> Assigned To: Anurag Shekhar
> Attachments: derby-2694.diff, TestProc.java, TestProc_TruncateRep.java
>
>
> org.apache.derby.impl.drda.DDMWriter uses wrong algorithm to avoid splitting
> varchar in the middle of a multibyte char.
> When DMWriter finds that it has to split a varchar while sending it to client
> it checks if the last byte is a part of a multibyte char and in case it is it
> tries to find the last byte of previous char and sends only till that byte
> leaving rest of it for the next send.
> The code it uses is having a bug so it fails when the last byte its checking
> for is the third byte of a char of 3 byte length.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.