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 "Daniel John Debrunner (JIRA)" <de...@db.apache.org> on 2006/09/02 18:29:22 UTC

[jira] Commented: (DERBY-1808) [PATCH] Inbuilt functions SIGN, SQRT, RAND, RANDOM, COSH, SINH and TANH

    [ http://issues.apache.org/jira/browse/DERBY-1808?page=comments#action_12432293 ] 
            
Daniel John Debrunner commented on DERBY-1808:
----------------------------------------------

Thanks Richard, I'll review the patch, but as a quick note Derby already supports SQRTand ABS (also added in your patch).
I think all the others are new to Derby.

> [PATCH] Inbuilt functions SIGN, SQRT, RAND, RANDOM, COSH, SINH and TANH
> -----------------------------------------------------------------------
>
>                 Key: DERBY-1808
>                 URL: http://issues.apache.org/jira/browse/DERBY-1808
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Richard Wheeldon
>            Priority: Minor
>         Attachments: rsw_functions1.patch
>
>
> Adds the following functions:
> SIGN - 0, 1 or -1 for zero, positive or negative arguments
> SQRT - Square root
> RAND - Random number
> RANDOM - as above
> COSH - Hyperbolic Cosine
> SINH - Hyperbolic Sine
> TANH - Hyperbolic Tangent.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: Bugs in inbuilt functions (was Re: [jira] Commented: (DERBY-1808) [PATCH] Inbuilt functions SIGN, SQRT, RAND, RANDOM, COSH, SINH and TANH)

Posted by Daniel John Debrunner <dj...@apache.org>.
richard@rswheeldon.com wrote:

> Daniel John Debrunner (JIRA) writes:
>  > Thanks Richard, I'll review the patch, but as a quick note Derby
>  > already supports SQRTand ABS (also added in your patch).
>  > I think all the others are new to Derby.
> 
> Yes, these are implemented in a different section to the others
> which is why I didn't realise until after I'd submitted the patch.
> More importantly, these are the only ones which actually seem to
> work properly, as can be seen from the following transcript:
> 
> ij version 10.3
> ij> connect 'jdbc:derby:test;create=true';
> ij> create table simple_tab (
> 	x integer
> );
> 
> 0 rows inserted/updated/deleted
> ij> insert into simple_tab values (1);
> 1 row inserted/updated/deleted
> ij> select acos(x) y from simple_tab;
> Y                     
> ----------------------
> 0.0                   
> 
> 1 row selected
> ij> create view simple_acos_view as (
> 	select acos(x) y from simple_tab
> );
> 
> ERROR 42X94: OBJECT '2fb0c07e-010d-6f90-2909-00000012ff18' does not exist.
> ij> 
> quit;
> 
> The attached sql files show that this works across all functions,
> against the current svn head. It's not the changes I've made, because
> I've just rebuilt from the originals. If you can point me in the right
> direction, I'll take a look and try to submit a patch. Otherwise, I'll
> file the appropriate bug report. The current stable version appears to
> be unaffected,

Thas looks like a bug in the new builtin function setup, not sure where
to look, my guess is some code is assuming that these descriptors are
perisistent when they are just in-memory descriptors. Can you add a bug
for this.

Richard, FYI, you may want to keep an eye on DERBY-1802, Susan has
contributed a JUnit test for these new builting functions, it needs some
cleanup before I can commit it, but once it's in the codeline, you may
consider adding additional cases for the functions you have added.

Thanks,
Dan.




Bugs in inbuilt functions (was Re: [jira] Commented: (DERBY-1808) [PATCH] Inbuilt functions SIGN, SQRT, RAND, RANDOM, COSH, SINH and TANH)

Posted by ri...@rswheeldon.com.
Daniel John Debrunner (JIRA) writes:
 > Thanks Richard, I'll review the patch, but as a quick note Derby
 > already supports SQRTand ABS (also added in your patch).
 > I think all the others are new to Derby.

Yes, these are implemented in a different section to the others
which is why I didn't realise until after I'd submitted the patch.
More importantly, these are the only ones which actually seem to
work properly, as can be seen from the following transcript:

ij version 10.3
ij> connect 'jdbc:derby:test;create=true';
ij> create table simple_tab (
	x integer
);

0 rows inserted/updated/deleted
ij> insert into simple_tab values (1);
1 row inserted/updated/deleted
ij> select acos(x) y from simple_tab;
Y                     
----------------------
0.0                   

1 row selected
ij> create view simple_acos_view as (
	select acos(x) y from simple_tab
);

ERROR 42X94: OBJECT '2fb0c07e-010d-6f90-2909-00000012ff18' does not exist.
ij> 
quit;

The attached sql files show that this works across all functions,
against the current svn head. It's not the changes I've made, because
I've just rebuilt from the originals. If you can point me in the right
direction, I'll take a look and try to submit a patch. Otherwise, I'll
file the appropriate bug report. The current stable version appears to
be unaffected,

Regards,

Richard