[ 
https://issues.apache.org/jira/browse/DERBY-3907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661963#action_12661963
 ] 

Kristian Waagan commented on DERBY-3907:
----------------------------------------

Patch 3b does change the behavior with regards to truncation of CHAR in one 
scenario, only possible through JDBC 4.0:
Inserting a stream that is too long (longer than the specified maximum width of 
the CHAR column) with a lengthless override. With a lengthless override, I mean 
a JDBC method taking a stream, but where the length of the stream is not 
specified.
Before the change the user would get SQLState 22001, after the change the 
SQLState would be XJ001. A follow-up patch should revert this change of 
behavior (Jira not yet logged, is dependent on DERBY-4005).

Further, I added CHAR to the list of allowed data types in 
ReaderToUTF8Stream.canTruncate, but the code using ReaderToUTF8Stream sets the 
number of characters to truncate to zero for all string data types except CLOB.
The code changing the behavior described above is what I pulled out from patch 
3a (see some related info in DERBY-4005).
Since the functionality is already in place, I think it makes sense to allow 
for truncation in the stream instead of materializing the data value and try to 
truncate it later.
That said, the number of applicable use cases are limited so it wouldn't be a 
disaster to leave it as it is.

Regarding the error reporting issue, it is still valid also if we drop the 
"extended truncation support".

> Save useful length information for Clobs in store
> -------------------------------------------------
>
>                 Key: DERBY-3907
>                 URL: https://issues.apache.org/jira/browse/DERBY-3907
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC, Store
>    Affects Versions: 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>         Attachments: derby-3907-1a-alternative_approach.diff, 
> derby-3907-2b-header_write_preparation.diff, 
> derby-3907-2b-header_write_preparation.stat, 
> derby-3907-3a-readertoutf8stream_cleanup.diff, 
> derby-3907-3a-readertoutf8stream_cleanup.diff, 
> derby-3907-3a-readertoutf8stream_cleanup.stat, 
> derby-3907-3b-readertoutf8stream_cleanup.diff
>
>
> The store should save useful length information for Clobs. This allows the 
> length to be found without decoding the whole data stream.
> The following thread raised the issue on what information to store, and also 
> contains some background information: 
> http://www.nabble.com/Storing-length-information-for-CLOB-on-disk-tp19197535p19197535.html
> The information to store, and the exact format of it, is still to be 
> discussed/determined.
> Currently two bytes are set aside for length information, which is inadequate.

-- 
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