Bug #280 Crash when a stored procedure with argument is called without argument
Submitted: 12 Apr 2003 8:31 Modified: 17 Apr 2003 4:56
Reporter: jocelyn fournier (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0 OS:Any (all)
Assigned to: Bugs System CPU Architecture:Any

[12 Apr 2003 8:31] jocelyn fournier
Description:
Hi,

This is probably a known bug, but I report in just in case.

How to repeat:
delimiter |;

create procedure u(y int)
 begin
   declare z1 int;
   set z1 = y;
   insert into taist.procs values(z1);
 end|

call u()|

Stack trace :

0x80aeab7 handle_segfault + 487
0x82b49d8 pthread_sighandler + 176
0x815f8cd eval_func_item(THD*, Item*, enum_field_types) + 29
0x815f764 sp_instr_set::execute(THD*, unsigned*) + 52
0x815ed3d sp_head::execute(THD*) + 157
0x815ef6b sp_head::execute_procedure(THD*, List<Item>*) + 75
0x80c1439 mysql_execute_command(THD*) + 18585
0x80c23f4 mysql_parse(THD*, char*, unsigned) + 260
0x80bb8f9 dispatch_command(enum_server_command, THD*, char*, unsigned) + 953
0x80bb4e7 do_command(THD*) + 135
0x80babf3 handle_one_connection + 515
0x82b23fa pthread_start_thread + 218
0x82e694a thread_start + 4
[12 Apr 2003 8:48] jocelyn fournier
Call with subselect crashed too :

call u((SELECT 1))|

Stack trace :

0x80aeab7 handle_segfault + 487
0x82b49d8 pthread_sighandler + 176
0x808d9f3 Item_subselect::fix_fields(THD*, st_table_list*, Item**) + 35
0x815f8ee eval_func_item(THD*, Item*, enum_field_types) + 62
0x815f0d2 sp_head::execute_procedure(THD*, List<Item>*) + 434
0x80c1439 mysql_execute_command(THD*) + 18585
0x80c23f4 mysql_parse(THD*, char*, unsigned) + 260
0x80bb8f9 dispatch_command(enum_server_command, THD*, char*, unsigned) + 953
0x80bb4e7 do_command(THD*) + 135
0x80babf3 handle_one_connection + 515
0x82b23fa pthread_start_thread + 218
0x82e694a thread_start + 4
[17 Apr 2003 4:56] Per-Erik Martin
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html

Yes, this (the first part about the number of arguments)
was a known bug, but trivial to fix (which was why I hadn't
gotten around to fix it before, sort of ;-).

However, the second part about subselect as argument is
unrelated, and much harder to fix, so it's been reported
separately as bug #302.