Subject awkward procedure behavior
Author Salim Naufal
I found out the hard way how Firebird (I suppose also Interbase) manages
procedure.
Say procedure p2 calls a procedure p1. If you alter the procedure p1, the p2
procedure will continue to use the old version of the p1 procedure until all
the connections to the database are closed. To illustrate this case, simply
create the following procedures:

create procedure p1 returns (a varchar(10))
as begin
a = 'r1';
suspend;
end

create procedure p2 returns (a varchar(10))
as begin
select a from p1 into :a;
suspend;
end

then try: select * from p2
result: 'r1'

then execute the following:

alter procedure p1 returns (a varchar(10))
as begin
a = 'r2';
suspend;
end

then try: select * from p2
result: 'r1' instead of 'r2'


After disconnecting then reconnecting to the database, the 'select * from
p2' returns will return the correct result ('r2').

Is this the normal behavior or a bug?

Salim