Bug #34871 Loading from pipe failed
Submitted: 27 Feb 2008 3:07 Modified: 18 Mar 2008 19:48
Reporter: Mohammad Rahman Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S1 (Critical)
Version:5.1.14-beta, 5.1.23maria OS:Linux (x64-86)
Assigned to: CPU Architecture:Any

[27 Feb 2008 3:07] Mohammad Rahman
Description:
I was trying to load data from a pipe into a myisam
table. But the pipe gets broken. On the other hand,
while I write into pipe I can read by other app.

How to repeat:
create table mytable (a int).

mkfifo /usr/local/mysql/data/test/x
chmod 666 /usr/local/mysql/data/test/x
cat < mydata > /usr/local/mysql/data/test/x &
mysql -uroot -e "LOAD DATA INFILE 'x' INTO TABLE mytable;" test

..Broken pipe .. After digging more using --debug on
mysqld, it seems its failing on lseek function.

Suggested fix:
It should work smoothly.
[27 Feb 2008 23:32] Sveta Smirnova
Thank you for the report.

But version 5.1.14 is old. Additionally I can not repeat described behavior with current development version. Please try current version 5.1.23 and inform us if problem still exists.
[4 Mar 2008 0:52] Mohammad Rahman
Ok I tried 'load data' on 5.1.23-maria.

It turns out I was successfull load by using full pipe path
LOAD DATA INFILE '/usr/local/mysql_ma/data/test/x' INTO TABLE mytable;

but other command having only the pipe name (suggested in the manual)

LOAD DATA INFILE 'x' INTO TABLE mytable; 

was breaking pipe. Probably you might reproduce the similar error. Please note that the pipe x was always created inside the data/test folder.

thank you for investigating this problem.
[18 Mar 2008 10:58] Susanne Ebrecht
Unfortunately I can't reproduce this.

mysql> create table test(id integer, num integer);
mysql> insert into test values(1,2),(2,3),(3,4);
mysql> select * from test into outfile 'x';
mysql> \q

now there is a file 'x' in MYSQLPATH/var/MYDB/

$ ls -l x
-rw-rw-rw- 1 USER GROUP 12 2008-03-18 11:22 var/MYDB/x

$ mysql -u MYUSER MYDB

mysql> load data infile 'x' into table test;
Query OK, 3 rows affected (0.00 sec)

I tested with 5.1.23-maria and with 5.1.23-rc.
[18 Mar 2008 19:43] Mohammad Rahman
Hi Susanne, A minor mistake I guess. You are exporting to a file but not a pipe. The bug is related to import from a pipe. I followed the manual but got this defect. Thank you.