[
https://issues.apache.org/jira/browse/DERBY-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rick Hillegas updated DERBY-6511:
---------------------------------
Attachment: derby-6511-01-aa-fixPrimitiveToWrapper.diff
Attaching derby-6511-01-aa-fixPrimitiveToWrapper.diff. This patch adds a little
conversion logic when passing a primitive to a method which takes a wrapper
type. I am running tests now.
As Knut noted, the fix is to generate a call to $WrapperObject.valueOf(
$primitiveType ) when generating the code to evaluate routine parameters. An
extra cast is needed if the primitive type is "short". That is because JDBC
specifies that the wrapper type for SMALLINT is java.lang.Integer even though
the primitive type for SMALLINT is short.
Touches the following files:
-------------
M java/engine/org/apache/derby/iapi/types/JSQLType.java
Make some methods public, for use by MethodCallNode.
-------------
M java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
Add a little conversion logic to generateAndCastOneParameter(). The conversion
is performed if the argument type is a primitive and the parameter type is its
corresponding wrapper form.
-------------
M
java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsHelper.java
M
java/testing/org/apache/derbyTesting/functionTests/tests/lang/RoutineTest.java
M java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
Add tests for conversions of all primitive types (except for the unsupported
byte type) to their corresponding wrapper types.
> java.lang.NoSuchMethodError chaining a function and procedure
> -------------------------------------------------------------
>
> Key: DERBY-6511
> URL: https://issues.apache.org/jira/browse/DERBY-6511
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.11.0.0
> Reporter: Rick Hillegas
> Assignee: Rick Hillegas
> Attachments: derby-6511-01-aa-fixPrimitiveToWrapper.diff,
> derby-6511.sql, derby-6511.sql
>
>
> java.lang.NoSuchMethodError is raised when calling a procedure which takes an
> Integer argument and passing it the result of a function which returns an
> int. The error is raised in generated code.
--
This message was sent by Atlassian JIRA
(v6.2#6252)