如果失败,使用 LOAD DATA INFILE 时执行的所有插入是否都会回滚?
我使用 C# 中的 LOAD DATA INFILE,使用 MySQL Connector for .NET 的 MySQLBulkLoader 对象,将 24 GB 数据加载到 MySQL 5.5 表中。
我想知道如果发生失败(出于任何原因,甚至是警告),批量插入是否会正确回滚,就好像它是在事务中完成的一样,或者我是否应该看到已经提交的第一个成功记录。
MySQL 手册上的相关页面信息不是很丰富在这方面。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自动提交模式(默认)下的 MySQL 尝试将每个语句包装在其自己的事务中。
如果您使用 InnoDB 那么是
如果您使用 MyISAM 那么否
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