TiDB and MySQL get generated key different at INSERT ON DUPLICATE KEY
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
I used `INSERT ... ON DUPLICATE KEY ...` statement to insert data. MySQL will add the PK of updated data to `GeneratedKeys`. TiDB will not do like that.
### 1. Minimal reproduce step (Required)
1. Install TiDB
2. Install MySQL
3. Clone this [code](https://github.com/Icemap/tidb-java-gitpod/tree/on-duplicate-key-generated-keys)
4. Point [JDBC URL](https://github.com/Icemap/tidb-java-gitpod/blob/on-duplicate-key-generated-keys/src/main/java/com/pingcap/App.java#L17) to TiDB host
5. Run `mvn clean package && java -jar target/tidb-java-gitpod-0.0.1-jar-with-dependencies.jar`
6. Point `JDBC URL` to MySQL host
7. Run `mvn clean package && java -jar target/tidb-java-gitpod-0.0.1-jar-with-dependencies.jar`
8. Outputs are not same
### 2. What did you expect to see? (Required)
[1, 2, 3]
[4]
[8]
[8]
### 3. What did you see instead (Required)
[1, 2, 3]
[4]
[8]
[]
### 4. What is your TiDB version? (Required)
5.7.25-TiDB-None (master branch)
Contributor guide
Assessment
This issue has not been assessed yet.