Will all inserts performed when using LOAD DATA IN

2019-08-12 06:22发布

问题:

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