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 2007/10/09 19:15:50 UTC

[jira] Created: (DERBY-3119) Derby does not resolve to functions with Integer return type.

Derby does not resolve to functions with Integer return type.
-------------------------------------------------------------

                 Key: DERBY-3119
                 URL: https://issues.apache.org/jira/browse/DERBY-3119
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.3.1.4, 10.2.2.0, 10.2.1.6, 10.1.3.1, 10.1.2.1, 10.1.1.0
            Reporter: Rick Hillegas


Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:

public class zz
{
    public  static  int returnsInt()
    {
        return 1;
    }
    
    public  static  Integer returnsInteger()
    {
        return new Integer( 2 );
    }
    
}

The following ij script shows that the int-returning method is resolved but not the Integer-returning method:

ij version 10.4
ij> connect 'jdbc:derby:derby10.4;create=true';
WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
ij> drop function returnsInt;
0 rows inserted/updated/deleted
ij> drop function returnsInteger;
0 rows inserted/updated/deleted
ij> create function returnsInt()
returns int
language java
parameter style java
no sql
external name 'zz.returnsInt'
;
0 rows inserted/updated/deleted
ij> create function returnsInteger()
returns int
language java
parameter style java
no sql
external name 'zz.returnsInteger'
;
0 rows inserted/updated/deleted
ij> values ( returnsInt() );
1          
-----------
1          

1 row selected
ij> values ( returnsInteger() );
ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.


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


[jira] Commented: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534897 ] 

Kathey Marsden commented on DERBY-3119:
---------------------------------------

Should this be marked as improvement or is it a bug?


> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Updated: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

Dag H. Wanvik updated DERBY-3119:
---------------------------------

    Attachment: DERBY-3119-10_3.diff

10.3 version of this patch. Committed as svn 598069.


> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>             Fix For: 10.3.1.5, 10.4.0.0
>
>         Attachments: DERBY-3119-10_3.diff, derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Closed: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

Rick Hillegas closed DERBY-3119.
--------------------------------


> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>             Fix For: 10.3.2.1, 10.4.1.3
>
>         Attachments: DERBY-3119-10_3.diff, derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Updated: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

James F. Adams updated DERBY-3119:
----------------------------------

    Fix Version/s: 10.4.0.0

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>             Fix For: 10.4.0.0
>
>         Attachments: derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Commented: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

Posted by "Alan Burlison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533651 ] 

Alan Burlison commented on DERBY-3119:
--------------------------------------

Note that one important consequence of this bug is that functions that return primitive types (int, float, double etc) have no way of returning a database NULL.

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Assigned: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

James F. Adams reassigned DERBY-3119:
-------------------------------------

    Assignee: James F. Adams

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Updated: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

James F. Adams updated DERBY-3119:
----------------------------------

    Derby Info: [Patch Available]

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>         Attachments: derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


Re: [jira] Commented: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
"James F. Adams (JIRA)" <ji...@apache.org> writes:

>     [ https://issues.apache.org/jira/browse/DERBY-3119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544868 ] 
>
> James F. Adams commented on DERBY-3119:
> ---------------------------------------
>
> Would it be possible for someone to merge this to the 10.3 branch?

I just did (svn 598069). If you can validate it, it would be good; I
had to rework the patch a bit due to reliance on other trunk changes
not present in the 10.3 branch.

Thanks,
Dag

[jira] Commented: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

Posted by "James F. Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544868 ] 

James F. Adams commented on DERBY-3119:
---------------------------------------

Would it be possible for someone to merge this to the 10.3 branch?

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>             Fix For: 10.4.0.0
>
>         Attachments: derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Commented: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

Rick Hillegas commented on DERBY-3119:
--------------------------------------

Thanks for the patch, James. It looks good to me. It fixes the problem case and the test you supplied verifies that the patch fixes the general problem. The tests ran cleanly for me as well. Committed at subversion revision 589766.

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>         Attachments: derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Updated: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

Dag H. Wanvik updated DERBY-3119:
---------------------------------

    Fix Version/s: 10.3.1.5

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>             Fix For: 10.3.1.5, 10.4.0.0
>
>         Attachments: DERBY-3119-10_3.diff, derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Updated: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

Rick Hillegas updated DERBY-3119:
---------------------------------

    Summary: Derby does not resolve functions to methods with Integer return type.  (was: Derby does not resolve to functions with Integer return type.)

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Updated: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

James F. Adams updated DERBY-3119:
----------------------------------

    Attachment: derby-3119-1_diff.txt

Attached is a patch proposal that I believe corrects the problem.

The resolveMethodCall  method of MethodCallNode has been modified to properly validate return types SMALLINT, INTEGER, BIGINT, REAL, and DOUBLE.  These types are object mappable to Integer, Integer, Long, Float, and Double as well as simply mappable to short, int, long, float, and double.

In addition I added tests to RoutineTest.

Ran Derbyall and suites.All with no new errors.

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>         Attachments: derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Commented: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

Posted by "Alan Burlison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534941 ] 

Alan Burlison commented on DERBY-3119:
--------------------------------------

See also http://blog.tremend.ro/2006/10/03/about-the-maturity-of-apache-derby/:

"It is important to know that Derby has a limited number of built-in functions, so one needs to frequently resort to custom stored functions. The problem with this is that, besides the lack of proper documentation, this support is quite limited. Stored functions can be defined only in Java. That would be mostly fine if it would work well. But for instance, if you want a stored function that returns an INTEGER value, you must specify the return type of the associated Java method as int. This means that basically you cannot return NULL integers from your function!"

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Commented: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

Posted by "Alan Burlison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534940 ] 

Alan Burlison commented on DERBY-3119:
--------------------------------------

Because of this there is no way for a database function to return a NULL.  That is clearly a bug.

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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


[jira] Resolved: (DERBY-3119) Derby does not resolve functions to methods with Integer return type.

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

James F. Adams resolved DERBY-3119.
-----------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

> Derby does not resolve functions to methods with Integer return type.
> ---------------------------------------------------------------------
>
>                 Key: DERBY-3119
>                 URL: https://issues.apache.org/jira/browse/DERBY-3119
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
>            Reporter: Rick Hillegas
>            Assignee: James F. Adams
>         Attachments: derby-3119-1_diff.txt
>
>
> Derby can bind a function invocation to a method which returns int but not to a method which returns Integer. I think that both of these resolutions should succeed given the rules in the SQL Standard, part 13, section 8.6, syntax rule 5, case a, item ii. Here is some code which shows this problem. First a class to declare the methods:
> public class zz
> {
>     public  static  int returnsInt()
>     {
>         return 1;
>     }
>     
>     public  static  Integer returnsInteger()
>     {
>         return new Integer( 2 );
>     }
>     
> }
> The following ij script shows that the int-returning method is resolved but not the Integer-returning method:
> ij version 10.4
> ij> connect 'jdbc:derby:derby10.4;create=true';
> WARNING 01J01: Database 'derby10.4' not created, connection made to existing database instead.
> ij> drop function returnsInt;
> 0 rows inserted/updated/deleted
> ij> drop function returnsInteger;
> 0 rows inserted/updated/deleted
> ij> create function returnsInt()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInt'
> ;
> 0 rows inserted/updated/deleted
> ij> create function returnsInteger()
> returns int
> language java
> parameter style java
> no sql
> external name 'zz.returnsInteger'
> ;
> 0 rows inserted/updated/deleted
> ij> values ( returnsInt() );
> 1          
> -----------
> 1          
> 1 row selected
> ij> values ( returnsInteger() );
> ERROR 42X50: No method was found that matched the method call int zz.returnsInteger(), tried all combinations of object and primitive types and any possible type conversion for any  parameters the method call may have. The method might exist but it is not public and/or static, or the parameter types are not method invocation convertible.

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