Bug #10537 Server crashes while loading data file into table through procedure.
Submitted: 11 May 2005 10:52 Modified: 24 May 2005 20:14
Reporter: Disha Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version: 5.0.5 OS: Windows Server 2003
Assigned to: Bugs System CPU Architecture:Any

[11 May 2005 10:52] Disha
Description:
Server crashes when loading the data into the table using the load file method through the procedure.

How to repeat:
delimiter //
drop table if exists t1 //
create table t1 (
		f1 char(1), 
		f2 char(1) binary, 
		f3 char(1) ascii, 
		f4 tinytext unicode, 
		f5 text, 
		f6 mediumtext, 
		f7 longtext, 
		f8 tinyblob, 
		f9 blob,
		f10 mediumblob 
		) engine = innodb //

drop procedure if exists sp1 //
create procedure sp1 () 
	begin 
		load data local infile 'c:\\tb-data.txt' into table t1; 
		delete from t1;
	end// 

call sp1() //
call sp1() //
[11 May 2005 10:53] Disha
this file contains the data that should be populated through the procedure

Attachment: tb-data.txt (text/plain), 420 bytes.

[12 May 2005 4:18] MySQL Verification Team
Verifie also on Linux:
ERROR 2 (HY000): File '/home/miguel/f/tb-data.txt' not found (Errcode: 2)
mysql> call sp1() //
ERROR 2013 (HY000): Lost connection to MySQL server during query
[12 May 2005 16:04] Omer Barnir
Updating Priority to P2 since this is a crashing bug
[23 May 2005 8:32] Per-Erik Martin
(Oops, should have been documenting, not closed...)

"load" can't work inside stored procedures, so it had to be disallowed.
(It doesn't work in prepared statements either, where it's already disabled.)
[24 May 2005 20:14] Paul DuBois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).