FB3: duplicate function arguments should not be allowed

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FB3: duplicate function arguments should not be allowed

Robbert-Jan
Hi,
testing FB 3 (Windows, WI-T3.0.0.30566 Firebird 3.0 Alpha 1), I see that currently stored functions may have input arguments with the same name, like:
 
CREATE FUNCTION Test (X INTEGER, X INTEGER) /* argument X appears twice */
RETURNS INTEGER
AS
BEGIN
  RETURN X + 1;
END
 
I think this should not be allowed, like it is also not allowed for parameters of stored procedures.
I suggest to define a unique key on rdb$function_arguments for (rdb$function_name, rdb$argument_name); note rdb$argument_name is NULL for the return argument, but afaik this is okay for unique keys.
 
Kind regards, Robert

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Firebird-test mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-test
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FB3: duplicate function arguments should not be allowed

Mark Rotteveel-2
On 23-11-2013 15:51, Robbert-Jan wrote:

> Hi,
> testing FB 3 (Windows, WI-T3.0.0.30566 Firebird 3.0 Alpha 1), I see that
> currently stored functions may have input arguments with the same name,
> like:
> CREATE FUNCTION Test (X INTEGER, X INTEGER) /* argument X appears twice */
> RETURNS INTEGER
> AS
> BEGIN
>    RETURN X + 1;
> END
> I think this should not be allowed, like it is also not allowed for
> parameters of stored procedures.
> I suggest to define a unique key on rdb$function_arguments for
> (rdb$function_name, rdb$argument_name); note rdb$argument_name is NULL
> for the return argument, but afaik this is okay for unique keys.
> Kind regards, Robert

This sounds like a bug to me, I suggest that you report in the tracker.

Mark
--
Mark Rotteveel

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Firebird-test mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-test
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FB3: duplicate function arguments should not be allowed

Robbert-Jan
Done, CORE-4280 has been created for this issue.

On 23-11-2013 15:51, Robert wrote:

> Hi,
> testing FB 3 (Windows, WI-T3.0.0.30566 Firebird 3.0 Alpha 1), I see that
> currently stored functions may have input arguments with the same name,
> like:
> CREATE FUNCTION Test (X INTEGER, X INTEGER) /* argument X appears twice */
> RETURNS INTEGER
> AS
> BEGIN
>    RETURN X + 1;
> END
> I think this should not be allowed, like it is also not allowed for
> parameters of stored procedures.
> I suggest to define a unique key on rdb$function_arguments for
> (rdb$function_name, rdb$argument_name); note rdb$argument_name is NULL
> for the return argument, but afaik this is okay for unique keys.
> Kind regards, Robert

This sounds like a bug to me, I suggest that you report in the tracker.

Mark
--
Mark Rotteveel


------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Firebird-test mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/firebird-test
Loading...