apache / apache/incubator-seata

执行sql出现错误Fail to get auto-generated keys, use 'SELECT LAST_INSERT_ID()' instead. Be cautious, statement could be polluted. Recommend you set the statement to return generated keys.

Open
#4,568 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

### 现象
在执行sql时,会出现错误:Fail to get auto-generated keys, use 'SELECT LAST_INSERT_ID()' instead. Be cautious, statement could be polluted. Recommend you set the statement to return generated keys.
### 环境
seata 1.4.2
jdk 1.8
springboot 2.3.12.RELEASE
主键为自增

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is identified. Reproduce the auto-generated-key error in Seata 1.4.2 with JDK 8, Spring Boot 2.3.12, and an auto-increment primary key, then trace the SQL execution path; done means generated keys are returned without the reported error or unsafe fallback warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.