Bug #6022 Stored procedure shutdown problem with self-calling function
Submitted: 11 Oct 2004 14:15 Modified: 23 Oct 2004 16:37
Reporter: Peter Gulutzan
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:5.0.2-alpha-debug OS:Linux (SuSE 8.2)
Assigned to: Bugs System Target Version:

[11 Oct 2004 14:15] Peter Gulutzan
Description:
If I make a function that calls itself, an invocation of the function causes an infinite
loop. 
Eventually the server stops with 'Segmentation fault'. But there is still a mysqld
process 
running. I can't get rid of it with mysqladmin shutdown. I have to use kill -9. 
 

How to repeat:
mysql> create function fr2 () returns int return fr2(); 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> select fr2(); 
 
... Wait till the server says "Segmentation fault". Try to start server again, which
should 
fail. With Linux root, say "ps -A" to observe that there is still a mysqld job running,
"kill -9" 
should stop it.
[11 Oct 2004 14:43] Victoria Reznichenko
Verified with 5.0.2-alpha-debug-log
[23 Oct 2004 13:36] Per-Erik Martin
It now gives the expected stack overrun error when recursing too deep.
(The error was in the function cache, so it never got as far as executing the function.)
[23 Oct 2004 16:37] Per-Erik Martin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html