You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <ji...@apache.org> on 2009/12/31 20:17:29 UTC

[jira] Created: (DERBY-4499) Compiler error when preparing a procedure call with an output parameter of user defined type.

Compiler error when preparing a procedure call with an output parameter of user defined type.
---------------------------------------------------------------------------------------------

                 Key: DERBY-4499
                 URL: https://issues.apache.org/jira/browse/DERBY-4499
             Project: Derby
          Issue Type: Bug
          Components: SQL
            Reporter: Rick Hillegas


The byte-code compiler complains about a missing setValue() overload. When this is fixed, it would be good to make sure that output parameters of UDT type work for the network client too.

When compiling the following CALL statement

    call changeCurrencyCode( ?, ? )

given the following procedure declaration

   create procedure changeCurrencyCode
   ( in newCurrencyCode char( 3 ), inout oldPrice Price )
   language java parameter style java no sql
   external name 'org.apache.derbyTesting.functionTests.tests.lang.UDTTest.changeCurrencyCode'

I see this stack trace:

java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
	at java.lang.Class.getDeclaredMethod(Class.java:1909)
	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:132)
	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
	at MyDerbyClient.execute(MyDerbyClient.java:161)
	at MyDerbyClient.main(MyDerbyClient.java:90)
Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price): org.apache.derby.shared.common.sanity.AssertFailure'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:147)
	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
	at MyDerbyClient.execute(MyDerbyClient.java:161)
	at MyDerbyClient.main(MyDerbyClient.java:90)
Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:191)
	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
	... 9 more


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-4499) Compiler error when preparing a procedure call with an output parameter of user defined type.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas reassigned DERBY-4499:
------------------------------------

    Assignee: Rick Hillegas

> Compiler error when preparing a procedure call with an output parameter of user defined type.
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4499
>                 URL: https://issues.apache.org/jira/browse/DERBY-4499
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>
> The byte-code compiler complains about a missing setValue() overload. When this is fixed, it would be good to make sure that output parameters of UDT type work for the network client too.
> When compiling the following CALL statement
>     call changeCurrencyCode( ?, ? )
> given the following procedure declaration
>    create procedure changeCurrencyCode
>    ( in newCurrencyCode char( 3 ), inout oldPrice Price )
>    language java parameter style java no sql
>    external name 'org.apache.derbyTesting.functionTests.tests.lang.UDTTest.changeCurrencyCode'
> I see this stack trace:
> java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at java.lang.Class.getDeclaredMethod(Class.java:1909)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:132)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price): org.apache.derby.shared.common.sanity.AssertFailure'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:147)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:191)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	... 9 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4499) Compiler error when preparing a procedure call with an output parameter of user defined type.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-4499:
---------------------------------

    Issue & fix info: [Patch Available]

> Compiler error when preparing a procedure call with an output parameter of user defined type.
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4499
>                 URL: https://issues.apache.org/jira/browse/DERBY-4499
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4499-01-aa-outputParameters.diff
>
>
> The byte-code compiler complains about a missing setValue() overload. When this is fixed, it would be good to make sure that output parameters of UDT type work for the network client too.
> When compiling the following CALL statement
>     call changeCurrencyCode( ?, ? )
> given the following procedure declaration
>    create procedure changeCurrencyCode
>    ( in newCurrencyCode char( 3 ), inout oldPrice Price )
>    language java parameter style java no sql
>    external name 'org.apache.derbyTesting.functionTests.tests.lang.UDTTest.changeCurrencyCode'
> I see this stack trace:
> java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at java.lang.Class.getDeclaredMethod(Class.java:1909)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:132)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price): org.apache.derby.shared.common.sanity.AssertFailure'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:147)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:191)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	... 9 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4499) Compiler error when preparing a procedure call with an output parameter of user defined type.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-4499:
---------------------------------

    Attachment: derby-4499-01-aa-outputParameters.diff

Attaching derby-4499-01-aa-outputParameters.diff. This fixes a bug which prevented us from using UDTs as out parameters in database procedures.

Touches the following files:


-----------

M      java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java
M      java/engine/org/apache/derby/iapi/types/DataType.java

Adds a new setValue( Object ) method to the DataValueDescriptor interface. The method was already implemented in the implementation which handles user defined types. Regression tests are running now.

-----------

M      java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java

Code-generates an extra cast for UDT output args in order to locate the method just added to the DVD interface.

-----------

M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsHelper.java
M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/UDTTest.java

Regression test.


> Compiler error when preparing a procedure call with an output parameter of user defined type.
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4499
>                 URL: https://issues.apache.org/jira/browse/DERBY-4499
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4499-01-aa-outputParameters.diff
>
>
> The byte-code compiler complains about a missing setValue() overload. When this is fixed, it would be good to make sure that output parameters of UDT type work for the network client too.
> When compiling the following CALL statement
>     call changeCurrencyCode( ?, ? )
> given the following procedure declaration
>    create procedure changeCurrencyCode
>    ( in newCurrencyCode char( 3 ), inout oldPrice Price )
>    language java parameter style java no sql
>    external name 'org.apache.derbyTesting.functionTests.tests.lang.UDTTest.changeCurrencyCode'
> I see this stack trace:
> java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at java.lang.Class.getDeclaredMethod(Class.java:1909)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:132)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price): org.apache.derby.shared.common.sanity.AssertFailure'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:147)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:191)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	... 9 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4499) Compiler error when preparing a procedure call with an output parameter of user defined type.

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832940#action_12832940 ] 

Kristian Waagan commented on DERBY-4499:
----------------------------------------

Except for nits like the mix of tabs and spaces on a few individual lines and a few long lines, patch 01-aa looks good to me.
I applied the patch and ran the test.

> Compiler error when preparing a procedure call with an output parameter of user defined type.
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4499
>                 URL: https://issues.apache.org/jira/browse/DERBY-4499
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4499-01-aa-outputParameters.diff
>
>
> The byte-code compiler complains about a missing setValue() overload. When this is fixed, it would be good to make sure that output parameters of UDT type work for the network client too.
> When compiling the following CALL statement
>     call changeCurrencyCode( ?, ? )
> given the following procedure declaration
>    create procedure changeCurrencyCode
>    ( in newCurrencyCode char( 3 ), inout oldPrice Price )
>    language java parameter style java no sql
>    external name 'org.apache.derbyTesting.functionTests.tests.lang.UDTTest.changeCurrencyCode'
> I see this stack trace:
> java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at java.lang.Class.getDeclaredMethod(Class.java:1909)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:132)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price): org.apache.derby.shared.common.sanity.AssertFailure'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:147)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:191)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	... 9 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-4499) Compiler error when preparing a procedure call with an output parameter of user defined type.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas resolved DERBY-4499.
----------------------------------

    Resolution: Fixed

Thanks for the quick review, Kristian. Tests ran cleanly for me. Committed derby-4499-01-aa-outputParameters.diff at subversion revision 909415.

> Compiler error when preparing a procedure call with an output parameter of user defined type.
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4499
>                 URL: https://issues.apache.org/jira/browse/DERBY-4499
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4499-01-aa-outputParameters.diff
>
>
> The byte-code compiler complains about a missing setValue() overload. When this is fixed, it would be good to make sure that output parameters of UDT type work for the network client too.
> When compiling the following CALL statement
>     call changeCurrencyCode( ?, ? )
> given the following procedure declaration
>    create procedure changeCurrencyCode
>    ( in newCurrencyCode char( 3 ), inout oldPrice Price )
>    language java parameter style java no sql
>    external name 'org.apache.derbyTesting.functionTests.tests.lang.UDTTest.changeCurrencyCode'
> I see this stack trace:
> java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at java.lang.Class.getDeclaredMethod(Class.java:1909)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:132)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price): org.apache.derby.shared.common.sanity.AssertFailure'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:147)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:191)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	... 9 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-4499) Compiler error when preparing a procedure call with an output parameter of user defined type.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas closed DERBY-4499.
--------------------------------


> Compiler error when preparing a procedure call with an output parameter of user defined type.
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4499
>                 URL: https://issues.apache.org/jira/browse/DERBY-4499
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4499-01-aa-outputParameters.diff
>
>
> The byte-code compiler complains about a missing setValue() overload. When this is fixed, it would be good to make sure that output parameters of UDT type work for the network client too.
> When compiling the following CALL statement
>     call changeCurrencyCode( ?, ? )
> given the following procedure declaration
>    create procedure changeCurrencyCode
>    ( in newCurrencyCode char( 3 ), inout oldPrice Price )
>    language java parameter style java no sql
>    external name 'org.apache.derbyTesting.functionTests.tests.lang.UDTTest.changeCurrencyCode'
> I see this stack trace:
> java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at java.lang.Class.getDeclaredMethod(Class.java:1909)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:132)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price): org.apache.derby.shared.common.sanity.AssertFailure'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2269)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:147)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement.<init>(EmbedCallableStatement.java:69)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement20.<init>(EmbedCallableStatement20.java:85)
> 	at org.apache.derby.impl.jdbc.EmbedCallableStatement30.<init>(EmbedCallableStatement30.java:61)
> 	at org.apache.derby.jdbc.Driver30.newEmbedCallableStatement(Driver30.java:122)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1699)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareCall(EmbedConnection.java:1648)
> 	at MyDerbyClient.prepareCall(MyDerbyClient.java:940)
> 	at MyDerbyClient.execute(MyDerbyClient.java:161)
> 	at MyDerbyClient.main(MyDerbyClient.java:90)
> Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Invalid method org.apache.derby.iapi.types.DataValueDescriptor >> void setValue(org.apache.derbyTesting.functionTests.tests.lang.Price) because java.lang.NoSuchMethodException: org.apache.derby.iapi.types.DataValueDescriptor.setValue(org.apache.derbyTesting.functionTests.tests.lang.Price)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
> 	at org.apache.derby.impl.services.bytecode.d_BCValidate.checkMethod(d_BCValidate.java:191)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.callMethod(BCMethod.java:745)
> 	at org.apache.derby.impl.sql.compile.StaticMethodCallNode.generateExpression(StaticMethodCallNode.java:1197)
> 	at org.apache.derby.impl.sql.compile.JavaValueNode.generate(JavaValueNode.java:253)
> 	at org.apache.derby.impl.sql.compile.CallStatementNode.generate(CallStatementNode.java:225)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:469)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:90)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:828)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:129)
> 	... 9 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.