Bug #31975 | LOAD DATA LOCAL INFILE - Duplicate entry error should come | ||
---|---|---|---|
Submitted: | 31 Oct 2007 7:36 | Modified: | 1 Sep 2009 13:19 |
Reporter: | Ashish Parkhi | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S4 (Feature request) |
Version: | mysql-connector-java-3.1.8-bin.jar | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[31 Oct 2007 7:36]
Ashish Parkhi
[1 Sep 2009 13:19]
Tonci Grgin
This report is misfiled under c/J section while it's actually mysql client. The behavior of LOAD DATA is described in http://dev.mysql.com/doc/refman/5.1/en/load-data.html. Particular case is described as: With LOCAL, the default behavior is the same as if IGNORE is specified; this is because the server has no way to stop transmission of the file in the middle of the operation. IGNORE is explained further later in this section. and If you specify IGNORE, input rows that duplicate an existing row on a unique key value are skipped. If you do not specify either option, the behavior depends on whether the LOCAL keyword is specified. Without LOCAL, an error occurs when a duplicate key value is found, and the rest of the text file is ignored. With LOCAL, the default behavior is the same as if IGNORE is specified; this is because the server has no way to stop transmission of the file in the middle of the operation. So, if you wish, you might change options in LOAD DATA or file a mysql client feature request. Behavior is well documented and configurable thus !Bg.