Bug #72500 LOAD DATA LOCAL INFILE doesn't seem to create file in /tmp as the manual claims?
Submitted: 1 May 2014 11:17 Modified: 11 Apr 2017 22:48
Reporter: Hartmut Holzgraefe Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:MySQL >= 5.5.36 OS:Linux
Assigned to: Paul DuBois CPU Architecture:Any

[1 May 2014 11:17] Hartmut Holzgraefe
Description:
The manual says "When using LOCAL with LOAD DATA, a copy of the file is created in the server's temporary directory." (on dev.mysql.com/doc/refman/5.6/en/load-data.html ) 

I'm not sure whether this has been true in prior versions, but I've tested this with MySQL 5.5.36, loading a few millions of rows into a MyISAM table, and the only files being touched were the tables MYD/MYI files. There was nothing in strace touching (creating/reading/writing) the tmp dir, and no additional file descriptors showed up in /proc/$mysqld_pid/fd either besides those for the MyISAM table files.

How to repeat:
Do large LOAD DATA LOCAL INFILE import, watch mysqld process file descriptors, strace output, or df/du information for the file system /tmp is on while the LOAD is going on ...

Suggested fix:
Check in which server version this changed, or whether it was ever true at all, and correct the documentation accordingly ...
[2 May 2014 7:57] MySQL Verification Team
Hello Hartmut,

Thank you for the report.

Thanks,
Umesh
[11 Apr 2017 22:48] Paul DuBois
Posted by developer:
 
I used lsof -p <mysql-PID> and I can observe a temp file growing during LOAD LOCAL INFILE.
On Linux, the file was in /tmp.
On macOS, the file was in /private/var/folders/69/x78kqn256txgtzrp5mgy_lm80000gn/T (presumably this changes over time or across boots).