Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

复合主建自增表结构,插入多行数据且未携带主键值时执行异常 #5043

Open
1 task
renliangyu857 opened this issue Nov 2, 2022 · 2 comments
Labels
type: bug Category issues or prs related to bug.

Comments

@renliangyu857
Copy link
Contributor

  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

Just paste your stack trace here!

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

表结构:
CREATE TABLE t_multi_primary (
id1 int(11) NOT NULL AUTO_INCREMENT,
id2 int(11) NOT NULL,
a int(11) DEFAULT NULL,
b int(11) DEFAULT NULL,
PRIMARY KEY (id1,id2)
) ENGINE=InnoDB;
测试case语句:
insert into t_multi_primary(id1,id2,a,b) values(null,2,1,1),(null,3,2,2)
问题原因:
image
获取自增主键时,两行数据应该是两个自增主键值,但在复合主键下只获取到了一个

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version :
  • Seata version:
  • OS :
  • Others:
@funky-eyes funky-eyes added the type: bug Category issues or prs related to bug. label Jun 9, 2023
@funky-eyes
Copy link
Contributor

这个问题可能跟driver有关,无法返回多行pk,某些数据库的driver就有这个问题,还需要框架层去通过步长计算pk

@dreamskyvision
Copy link
Contributor

Please assign me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Category issues or prs related to bug.
Projects
None yet
Development

No branches or pull requests

3 participants