Tomasz Tyrakowski
unread,Sep 24, 2024, 6:13:27 AMSep 24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to firebird-support
Hello
AFAIU, when a stored procedure B calls another procedure A, and A gets
later altered, but without altering B, B still uses/calls the old
version of A. That's how it's always been, ever since Interbase days.
However, is there a more technical documentation available about how
exactly calling SPs by other SPs works and is implemented in Firebird?
I've got a pretty good understanding of it from the user's perspective,
i.e. I know what has to be done for it to work correctly, but I'd like
to understand how the actuall calls are done (I know FB is open source
and I can look into the code, but human life is finite).
Going back to the example with procedures A and B: if I forget to alter
B (to itself) after altering A, calling B results in execution of the
old version of A's BLR (that's easy to verify empirically, which I did
before posting, just in case ;) ).
Where are those versions kept in the database? Looking at
RDB$PROCEDURES, I can't figure it out.
Is it possible to detect, which version of A's BLR is actually used by
B, then check the current (most recent) version of A's BLR and detect if
there's a difference? I can't find any information about BLR versions in
the system tables, but then I might be looking in wrong places.
On the other hand, if A's BLR was inlined in the caller (in B's BLR),
indirect recurrence would be impossible (A calling B, B calling A),
which is not the case (I've got several indirectly recurrent SPs and
they work just fine).
So, if anyone knows about any sources, which would be helpful to
understand this stuff better, and could point them out, I'd really
appreciate it.
regards
Tomasz