[
https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489574
]
A B commented on DERBY-2557:
----------------------------
The following code appears twice in the patch:
+ //If we are dealing with territory based collation and
+ //the object is of type StringDataValue, then we need to
+ //create a StringDataValue with territory based collation.
+ if (returnObject instanceof StringDataValue)
+
((StringDataValue)returnObject).getValue(getCharacterCollator(collationType));
+ return returnObject;
The call to "getValue(...)" on returnObject creates a new StringDataValue with
territory-based collation. But then the code appears to ignore the result of
"getValue(...)" and simply returns returnObject, which (I think?) has default
collation. Is that intentional? The comments do not explicitly say that we're
supposed to *return* the new StringDataValue, just that we're supposed to
*create* one--so I guess the code matches the comments. But that seems a tad
odd to me...
I took a look at SQLChar.getValue(RuleBasedCollator) and there do not appear to
be any side effects of that method on the SQLChar, so I don't understand what
we get from calling "getValue(...)" in the above code? If we are not going to
store the result or return it, then why do we need to call getValue(...) in the
first place? (sorry if I'm missing something obvious).
> Provide a new interface on DataValueFactory(DVF) called
> getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api
> will replace similar code in Monitor.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2557
> URL: https://issues.apache.org/jira/browse/DERBY-2557
> Project: Derby
> Issue Type: New Feature
> Components: SQL
> Affects Versions: 10.3.0.0
> Reporter: Mamta A. Satoor
> Assigned To: Mamta A. Satoor
> Attachments:
> DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt,
> DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called
> getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF.
> Store will call this interface to create empty DVD objects and then load
> these DVD objects using readExternal. For performance efficiency, when Store
> needs more of the same base DVD, then on subsequent needs, it will call
> DVD.getNewNull rather than calling
> DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for
> DERBY-2537.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.