问题
I use LOAD DATA INFILE from C# using the MySQLBulkLoader object of the MySQL Connector for .NET, to load 24 GB of data into a MySQL 5.5 table.
I am wondering whether in case of failure (for any reason, even warnings), the bulk insertion would be properly rolled back as if it had been done within a transaction, or if I should expect to see the first successful records already commited.
The relevant page on the MySQL manual is not very informative in this regard.
回答1:
MySQL in auto-commit mode (the default) tries to wrap every single statement in its own transaction.
If you use InnoDB then yes
If you use MyISAM then no
来源:https://stackoverflow.com/questions/7491338/will-all-inserts-performed-when-using-load-data-infile-be-rolled-back-if-it-fail