apache / apache/incubator-seata

不支持insert into select操作

Open
#3,965 2 comments 0 reactions 0 assignees View on GitHub
task: help-wanted
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

经定位问题发生在BaseInsertExecutor.parsePkValuesFromStatement()
if (statementProxy instanceof PreparedStatementProxy) {
PreparedStatementProxy preparedStatementProxy = (PreparedStatementProxy) statementProxy;

List> insertRows = recognizer.getInsertRows(pkIndexMap.values());
if (insertRows != null && !insertRows.isEmpty()) {
问题发生在上述代码最后一个if处,!insertRows.isEmpty()为false,导致无法为pkValuesMap赋值,以致
if (pkValuesMap.isEmpty()) {
throw new ShouldNeverHappenException();
}
seata服务端版本1.3.0,客户端1.3.0、1.4.2
数据库:MySQL 5.7.12,驱动8.0.22

Contributor guide

Open the contributing guide

Research direction

Start in BaseInsertExecutor.parsePkValuesFromStatement() and inspect how INSERT INTO SELECT is handled when recognizer.getInsertRows(...) returns an empty list. Reproduce the reported operation with MySQL 5.7.12 using the Seata 1.3.0 or 1.4.2 client, then verify that pkValuesMap is populated without triggering ShouldNeverHappenException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mysql
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.