[
https://issues.apache.org/jira/browse/DERBY-3341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574566#action_12574566
]
Rick Hillegas commented on DERBY-3341:
--------------------------------------
The same behavior plagues the diagnostic VTIs. You can demonstrate this by
hacking AccessFactoryGlobals.USER_TRANS_NAME to be a long string and then
running the following update:
create table t2( col1 varchar(35 ) );
insert into t2( col1 )
SELECT type FROM SYSCS_DIAG.TRANSACTION_TABLE;
The declared type of TRANSACTION_TABLE.TYPE is varchar( 30 ) but there is no
truncating cast in the bind-time plan to cut the hacked value back to 30
characters.
> TABLE FUNCTION returning CHAR values does not return a correct value if the
> Java ResultSet class returns a value less than the length of the defined CHAR.
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3341
> URL: https://issues.apache.org/jira/browse/DERBY-3341
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Reporter: Daniel John Debrunner
> Fix For: 10.4.0.0
>
> Attachments: derby_3341_test.txt
>
>
> Defining a column in the returned type as CHAR(10) requires that the returned
> value be of length 10 characters.
> Defining a table function with a return type of:
> returns TABLE column0 char( 10 ), column1 char( 10 ))
> seems to just return whatever the Java ResultSet implementation handed it.
> My guess this is true for all variable length types, no casting of the value
> occurs when it is returned to the SQL domain.
> Java single value functions and procedure out parameters do perform any
> required casting to ensure the value is of the declared type.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.