InterBase seems to have a bug in checking dependencies when you alter the arguments to a procedure which is referenced by a trigger. It’s easy to work around, though.
Yesterday, and InterBase user reported on the IB newsgroups that he had tried the following steps:
- Alter a procedure to change the number of arguments it takes.
- Alter a trigger which calls that procedure, so that the trigger source passes the new member of the procedure arguments.
Now, if the dependency checking had been working, step 1 would have been impossible, due to the reference to the procedure within the trigger body. The correct way of doing this process is to first ALTER the trigger source so that it does not reference the procedure, then change the procedure, then change the trigger source to reference the new procedure signature. But step 1 did work for this user, and when he tried to step 2, he then received the dependency error. The reason he received the error in step 2 is that InterBase was checking the dependencies of the old (compiled) version of the trigger before it compiled the new version. That doesn’t seem right; if we’re replacing the source code of a trigger, why do we care if the old version is legitimate? So there seemed to be at least two bugs here.
If you find yourself in this situation, probably the easiest way to work around the problem is to ALTER the procedure back to its original form, and then update the trigger and procedure in the correct order.
Post a Comment