I can confirm this is the case when log_bin is disabled, but not when it is enabled.
Interestingly, depending on table schema, either a deadlock or duplicate key error is returned.
mysql> load data local infile '/var/lib/mysql-files/BREK_test1.csv' into table B_test;
ERROR 1213 (40001): WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction
I can confirm this is the case when log_bin is disabled, but not when it is enabled.
Interestingly, depending on table schema, either a deadlock or duplicate key error is returned.
mysql> select @@version, @@log_bin, @@log_slave_ updates; ------- -+----- ------+ ------- ------- ------- + ------- -+----- ------+ ------- ------- ------- + ------- -+----- ------+ ------- ------- ------- +
+------
| @@version | @@log_bin | @@log_slave_updates |
+------
| 5.7.18-15-57 | 0 | 0 |
+------
1 row in set (0.00 sec)
mysql> show create table B_test\G ******* ******* ****** 1. row ******* ******* ******* ******
*******
Table: B_test
Create Table: CREATE TABLE `B_test` (
`INDaa` decimal(1,0) DEFAULT NULL,
`EUaa` decimal(1,0) DEFAULT NULL,
`BAaa` decimal(3,0) DEFAULT NULL,
`REKaa` decimal(10,0) NOT NULL,
`IBaa` varchar(34) NOT NULL,
`SALDOaa` decimal(13,2) DEFAULT NULL,
`SALDO_aa` decimal(11,2) DEFAULT NULL,
`SALDO_Caa` decimal(11,2) DEFAULT NULL,
`SALDO_Vaa` decimal(13,2) DEFAULT NULL,
`REK_SRaa` decimal(3,0) DEFAULT NULL,
`RAPaa` decimal(2,0) DEFAULT NULL,
`VERHaa` decimal(1,0) DEFAULT NULL,
`ZAB` decimal(1,0) DEFAULT NULL,
`SFIATIG` decimal(1,0) DEFAULT NULL,
`DFIATIE_UIT` decimal(1,0) DEFAULT NULL,
`IIV_RFTE` decimal(1,0) DEFAULT NULL,
`INDAILEN` decimal(1,0) DEFAULT NULL,
`DAT_TST_TRASA` decimal(8,0) DEFAULT NULL,
`JKOM_BH_KANTF` decimal(4,0) DEFAULT NULL,
`RDEDEN` decimal(3,0) DEFAULT NULL,
`HEGRLD_VAAGJ` decimal(1,0) DEFAULT NULL,
`RAT_OPENIKL` decimal(8,0) DEFAULT NULL,
`RED_LIMIT` decimal(11,2) DEFAULT NULL,
PRIMARY KEY (`REKaa`),
UNIQUE KEY `BREKIBANIDX` (`IBaa`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
mysql> load data local infile '/var/lib/ mysql-files/ BREK_test1. csv' into table B_test;
ERROR 1213 (40001): WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction
Works OK with log_bin enabled:
mysql> select @@version, @@log_bin, @@log_slave_ updates; ------- -----+- ------- ---+--- ------- ------- ----+ ------- -----+- ------- ---+--- ------- ------- ----+ ------- -----+- ------- ---+--- ------- ------- ----+
+------
| @@version | @@log_bin | @@log_slave_updates |
+------
| 5.7.18-15-57-log | 1 | 0 |
+------
1 row in set (0.00 sec)
mysql> truncate B_test;
Query OK, 0 rows affected (0.06 sec)
mysql> load data local infile '/var/lib/ mysql-files/ BREK_test1. csv' into table B_test;
Query OK, 17542 rows affected (1.62 sec)
Records: 17542 Deleted: 0 Skipped: 0 Warnings: 0
For a sysbench table, result different (log_bin disabled):
mysql> truncate sbtest1;
Query OK, 0 rows affected (0.03 sec)
mysql> load data local infile '/var/lib/ mysql-files/ sbtest1. csv' into table sbtest1;
Query OK, 5000 rows affected, 10000 warnings (0.91 sec)
Records: 15000 Deleted: 0 Skipped: 10000 Warnings: 10000
mysql> show warnings; ---+--- ---+--- ------- ------- ------- ------- ------- ---+ ---+--- ---+--- ------- ------- ------- ------- ------- ---+
+------
| Level | Code | Message |
+------
| Warning | 1062 | Duplicate entry '2' for key 'PRIMARY' |
| Warning | 1062 | Duplicate entry '5' for key 'PRIMARY' |
| Warning | 1062 | Duplicate entry '8' for key 'PRIMARY' |
...