db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-3069) Derby does not resolve functions bound to methods with varargs.
Date Wed, 05 Dec 2012 17:47:59 GMT

     [ https://issues.apache.org/jira/browse/DERBY-3069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Rick Hillegas updated DERBY-3069:

    Attachment: derby-3069-03-aa-varargsSyntax.diff

Attaching derby-3069-03-aa-varargsSyntax.diff. This patch adds DDL support for vararg routines.
I am running regression tests now.

This patch adds support for declaring vararg functions and procedures. Syntax like the following
is supported:

  create procedure varargsderbystyle ( a int ... )
  language java parameter style derby no sql external name 'Foo.foo' ;

  create function varargsderbystyle ( a int ... ) returns integer
  language java parameter style derby no sql external name 'Foo.foo' ;

  create function varargstablefunction ( a int ... )
  returns table ( b int )
  language java parameter style derby_jdbc_result_set no sql external name 'Foo.foo' ;

Invocations of these routines aren't bound to actual varargs methods yet. That will happen
in a follow-on patch.

Touches the following files:


M       java/engine/org/apache/derby/catalog/types/RoutineAliasInfo.java

Metadata changes to support vararg routines and the new DERBY parameter style.


M       java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java

Data dictionary changes to declare existing functions/procedures as non-vararg routines.


M       java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
M       java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java

Parse- and bind-time support for declaring vararg routines.


M       java/engine/org/apache/derby/loc/messages.xml
M       java/shared/org/apache/derby/shared/common/reference/SQLState.java

New error messages.


M       java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
A       java/testing/org/apache/derbyTesting/functionTests/tests/lang/VarargsTest.java

Syntax tests for declaring vararg routines.


M       java/testing/org/apache/derbyTesting/functionTests/tests/tools/dblook_makeDB.sql
M       java/testing/org/apache/derbyTesting/functionTests/master/dblook_test.out

Test to verify that dblook turns out the correct DDL for vararg routines.


M       java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_10.java

Upgrade tests.

> Derby does not resolve functions bound to methods with varargs.
> ---------------------------------------------------------------
>                 Key: DERBY-3069
>                 URL: https://issues.apache.org/jira/browse/DERBY-3069
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions:,,,,,,,
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>              Labels: derby_triage10_10
>         Attachments: derby-3069-01-varargs-aa.diff, derby-3069-01-varargs-ab.diff, derby-3069-02-backout.diff,
derby-3069-03-aa-varargsSyntax.diff, Varargs.html, z.java, z.sql
> Varargs were added in Java 5. It would be nice if Derby let you invoke a function bound
to a method with a variable length argument list. The Reference Guide states a small number
of restrictions for methods which can be invoked as Derby functions: They must be public,
static, and not have arguments which are long datatypes. I see no reason that Derby shouldn't
be able to resolve and invoke functions which are bound to methods which don't suffer these
limitations but which have variable argument lists.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message