I have a csv file which should be loaded in sequential order so I can update blank person_name field with the previous row’s person_name.
I have added a id (auto increment) which I can use to update the blank rows.
Table person
id person_name car model
1 Fred Volvo 2001
2 FIAT 2000
3 Paul Volvo 2010
My doubt is, Can I be confident that the file will always be loaded in sequential order?
Although documentation does not state that I think it’s pretty safe bet that data will inserted into table sequentially, line by line.
However keep in mind that it does not guarantee that rows will be in any order when retrieved from table.
Different storage engines may (and do) internally allocate rows differently and retrieve them in completely different order. Therefore it is not safe for You to relay on that. You should either number Your rows in input file and use line_id/row_id for further processing or process the file before You load it into MySQL server.