-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
1.6.1,pgsql自增主键、当insert语句不包含主键列时,报[ShouldNeverHappenException: pkIndex is not found] #5264
Comments
at对pg的支持上本身不支持自增主键的获取,只支持通过insert中的主键列来获取,应该是因为1.6的多主键支持后开始做了检测 |
这句话不能理解,因为我使用1.5.2测试,是支持pgsql自增主键的(能insert成功、也能回滚成功)。 基于1.5.2支持pgsql自增主键这个事实前提,能否怀疑这两种可能性:
第1点可能性不大,因为这会给1.5.x的用户后面升级高版本带来困难;而且[单主键]比[多主键]普遍的多,为了较少的场景而放弃更加普适的功能,一般也不太可能做这样的选择。 |
抱歉是我看错了,确实是多主键支持后出现的bug,我们看下如何解决 |
插入列不包含pk时走getGeneratedKeys应该是可以拿到2个自增主键的值的,你有兴趣来修复这个bug吗? |
下面是基于个人理解,对
另外,目前oracle的实现与pgsql很相似,可能也需要验证验证。 |
或许oracle那块也存在这个问题,你可以在本地验证通过后,提交一个pr给社区 |
这个问题有修复吗 |
等1.7发版 |
Ⅰ. Issue Description
seata1.6.1,AT模式,使用pgsql自增主键、且insert语句不包含主键列时,抛出异常[ShouldNeverHappenException: pkIndex is not found]
Ⅱ. Describe what happened
If there is an exception, please attach the exception trace:
Ⅲ. Describe what you expected to happen
seata1.6.1,AT模式,使用pgsql自增主键、且insert语句不包含主键列时,不发生异常,insert执行成功。
Ⅳ. How to reproduce it (as minimally and precisely as possible)
如下是测试代码
demo传送门:https://github.com/isharpever/seata-demo.git
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
The text was updated successfully, but these errors were encountered: