Bug #21371 LOAD DATA LOCAL INFILE incorrect ordering
Submitted: 31 Jul 2006 19:48 Modified: 1 Sep 2006 7:47
Reporter: [ name withheld ] Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version: OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any
Tags: LOAD DATA LOCAL INFILE

[31 Jul 2006 19:48] [ name withheld ]
Description:
Using LOAD DATA LOCAL INFILE on a newly created table inserts the data correctly.  

Using LOAD DATA LOCAL INFILE on a recently cleared (DELETE FROM tablename) table produces backward results (last row of Tab-Delimited file is first in database, with some scattering of content throughout)

Using LOAD DATA LOCAL INFILE on a recently dropped (DROP TABLE tablename) and recreated (CREATE TABLE tablename...) table inserts data correctly.

How to repeat:
create a script in php that:
"create table if not exists tablename (...)", "delete from tablename", "load data local infile 'filename.txt' into table tablename..." 

this will work the first time through (when the table does not exist).  when it does exist, the results will be backwards and a little scattered.
[1 Aug 2006 7:47] Valeriy Kravchuk
Thank you for a problem report. Please, specify the exact version of MySQL server used. Please, not, that to get rows in any particular order from the realtional database you have to add ORDER BY clause. Otherwise order is not guaranteed in general. So, this part of the behaviour described is not a bug.

Can you repeat the same results (incorrect data loaded) with mysql command line client?
[1 Sep 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".