From: Claudio V. C. <cv...@us...> - 2003-03-09 22:25:09
|
fo...@gm... wrote: > tbudf2.zip [0/2] > > The following stored procedures will cause FB1.5 B3 (under both > RedHat 8 and Windows XP) to hit 100% and effectively hang. Run the > stored procedure 'Test' (which then calls the other 3). First, it's not considered good behavior to send large letters to this list. You sent 100KB of the compressed UDF as two attachments, for example. Some people use very slow dialup lines. And you should ask where to send those binaries first, please. Probably some devs will request private copies. Second, for what I see, you are using EXECUTE PROCEDURE to call procedures that contain the SUSPEND instruction. Why? You put SUSPEND when you expect the stored proc to be called from a SELECT statement, for example. You have CREATE PROCEDURE TEST RETURNS ( OTHETA FLOAT) AS begin execute procedure gp_lib_theta ('C',1650,1700,60,.04,.04,.2) returning_values (:otheta); suspend; end However, gp_lib_theta ends with "suspend;". This wrong mixture is calling for problems. This procedure in turn does: execute procedure gp_lib_nd(ld1) returning_values ld1_nd; execute procedure gp_lib_cnd(ld1) returning_values ld1_cnd; execute procedure gp_lib_cnd(ld2) returning_values ld2_cnd; The "nd" proc doesn't have suspend. This is okay, since it's being called by means of EXECUTE PROCEDURE. However, again the "cnd" proc ends in "suspend". Once you have fixed these incompatibilities, you can test and see if the errors happen exactly as before. Third, you suggested that the engine hangs when you call a UDF expecting DOUBLE PRECISION with FLOAT arguments. At this time, I only can theorize that the engine didn't "upgrade" the floats to doubles before passing them to the UDF, hence the UDF did weird things. How do you know the engine interpret the values as floats, is it your real example the code you posted with float vars inside a proc are assigned literal numeric constants? I'm not sure the internal code in a function CVT_get_double() defined to return double will see any difference between the actual code: case dtype_real: return *((float *) desc->dsc_address); and the more explicit case dtype_real: return (double) *((float *) desc->dsc_address); to convert a float to double. Any takers? This is the fuction called when the engine discovers that your UDF declared "double" input but is being passed a float instead. C. |