New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow subroutines to call others subroutines and themself recursively [CORE5380] #5653
Comments
Modified by: Zoran Vučenović (zoran.vucenovic)description: Sub-routines cannot use recursion. create or alter function factoriel(n int) begin As this subroutines' limitation is not mentioned in documentation (here: http://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-psql-subroutines.html), I think it is a bug. => Sub-routines cannot use recursion. create or alter function factoriel(n int) begin As this subroutines' limitation is not mentioned in documentation (here: http://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-psql-subroutines.html ), I think it is a bug. |
Modified by: Zoran Vučenović (zoran.vucenovic)Component: Engine [ 10000 ] |
Commented by: @sim1984 This omission in the Release Noes. Subroutines restrictions described in the file Limitations: |
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @asfernandesissuetype: Bug [ 1 ] => Improvement [ 4 ] summary: Subroutine cannot call itself recursively => Allow subroutines to call others subroutines and itself recursively |
Modified by: @asfernandessummary: Allow subroutines to call others subroutines and itself recursively => Allow subroutines to call others subroutines and themself recursively |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 Alpha 1 [ 10731 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done successfully |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Zoran Vučenović (zoran.vucenovic)
Sub-routines cannot use recursion.
For example this will not compile:
create or alter function factoriel(n int)
returns int
as
declare function subfactoriel(n int)
returns int
as
begin
if (n = 0) then
return 1;
else
return n * subfactoriel(n - 1); --this line cannot compile
end
begin
if (n < 0) then
return 0;
else
return subfactoriel(n);
end
As this subroutines' limitation is not mentioned in documentation (here: http://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-psql-subroutines.html ), I think it is a bug.
Commits: 4be766b
The text was updated successfully, but these errors were encountered: