Bug #25207 Calling to UDF function from stored procedure/function can crash server
Submitted: 20 Dec 2006 10:16 Modified: 29 Oct 2009 16:55
Reporter: Zigmund Bulinsh Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.0.27 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[20 Dec 2006 10:16] Zigmund Bulinsh
Description:
I have a function defined thgrough UDF DLL.
it is named as RaiseError (RaiseError_init alwais returns 1 and error message always equals to first parameter).

How to repeat:
select RaiseError('Some error'); raises MySQL error: 'Some error'

Now I define procedure which call this function (more comfortable way to use it)

CREATE PROCEDURE `Error`(p_text char(255))
begin
  declare x int;
  set x = RaiseError(p_text);
end

After calling this procedure from anywhere - MySQL crashes...

But this version works fine:

CREATE PROCEDURE `Error`(p_text VARchar(255))
begin
  declare x int;
  set x = RaiseError(p_text);
end
[20 Dec 2006 10:17] Zigmund Bulinsh
LibError.dll contains this function

Attachment: LibError.dll (application/octet-stream, text), 43.00 KiB.

[20 Dec 2006 13:41] Hartmut Holzgraefe
Hi, 

can you provide the source of the UDF, too?
[21 Jan 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[29 Oct 2009 16:55] Zigmund Bulinsh
It works with 5.1.38 - 5.1.40. Closing issue.