pingcap / pingcap/tidb

lightning:When importing non-enumerated values in Lightning, everything imports successfully without errors or prompts, and the inserted values are not the strings from the source file.

Open
#57,637 0 comments 0 reactions 0 assignees View on GitHub
component/lightning may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

When importing non-enumerated values in Lightning, everything imports successfully without errors or prompts, and the inserted values are not the strings from the source file.

### 1. Minimal reproduce step (Required)
1. create table a
```
CREATE TABLE `a` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`mode` enum('aaa','bbb','ccc') NOT NULL,
PRIMARY KEY(`id`) CLUSTERED)
ENGINE = InnoDB DEFAULT CHARACTER SET = UTF8MB4 DEFAULT COLLATE = UTF8MB4_BIN AUTO_INCREMENT = 1284046222587412087
```

3. use lightning to load data from csv
![image](https://github.com/user-attachments/assets/47684ad3-d145-4ae5-9e82-922c34217405)
[test.a.1.csv](https://github.com/user-attachments/files/17867474/test.a.1.csv)

lightning toml
```
[lightning]
level = "info"
check-requirements = false
status-addr = ':8289'
index-concurrency = 64
table-concurrency = 64
io-concurrency = 32
region-concurrency = 64

[tikv-importer]
backend = "local"
incremental-import = true
sorted-kv-dir = "/tiup/sort"
range-concurrency = 64

[tidb]
# Information of the target cluster
port = 4000
user = "root"
password = ""
host = "tidb-1-peer"
status-port = 10080
pd-addr = "pd-peer:2379"
build-stats-concurrency = 20
distsql-scan-concurrency = 15
index-serial-scan-concurrency = 20
checksum-table-concurrency = 2
[mydumper]
no-schema = true
data-source-dir = 'xxx'
[mydumper.csv]
header = false

[checkpoint]
# Whether to enable checkpoints.
enable = true
driver = "file"

[post-restore]
checksum = false
analyze = false

[conflict]
strategy = "replace"
```

### 2. What did you expect to see? (Required)
Lightning reports an error or prompts that the inserted value is not within the enumeration range.

### 3. What did you see instead (Required)
Lightning imports successfully, with no prompts or errors, and the inserted value is null."

![image](https://github.com/user-attachments/assets/c72ff560-080b-4d7f-9c74-66ac647bf697)

### 4. What is your TiDB version? (Required)
v8.4.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.