Open 15767637775 opened 3 months ago
Thanks for reporting. I have checked in v7.1.5 the error message is correct.
mysql> LOAD DATA LOCAL INFILE '/tmp/sql.csv'
-> IGNORE INTO TABLE t_related_group_account
-> FIELDS TERMINATED BY '\t'
-> LINES TERMINATED BY '\n'
-> (group_id,group_key,group_type,account_id,account_type,
-> market_id,customer_id,one_pass_account,customer_name,
-> open_date,certificate_type,certificate_number,branch_id,
-> customer_contact,broker_name,broker_contact,branch_name,
-> accountsJson,data_status,business_type,permission_id,
-> group_type,add_time,add_user,update_time,update_user);
ERROR 1110 (42000): Column 'group_type' specified twice
I'll check MySQL behaviour later.
As a workaround, you can change the duplicated column to @dummy
, like
LOAD DATA LOCAL INFILE '/tmp/sql.csv'
IGNORE INTO TABLE t_related_group_account
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
(group_id,group_key,group_type,account_id,account_type,
market_id,customer_id,one_pass_account,customer_name,
open_date,certificate_type,certificate_number,branch_id,
customer_contact,broker_name,broker_contact,branch_name,
accountsJson,data_status,business_type,permission_id,
@dummy,add_time,add_user,update_time,update_user);
Bug Report
1. Minimal reproduce step (Required)
this sql has 2 identical column named 'group_type':
The attachment is here: sql.csv
table schema:
tidb.log:
2. What did you expect to see? (Required)
This should not cause an error, the data will be successfully imported, just like in MySQL 5.7. tidb v6.5.9 sql_mode is the same as mysql :
3. What did you see instead (Required)
I saw the error: ERROR 1105 (HY000): commit forced to quit.
The error should be "Column 'group_type' specified twice", not "commit forced to quit". There might be an issue somewhere in the process.
4. What is your TiDB version? (Required)
v6.5.9