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

insert on duplicate语句不带列字段时出现空指针问题 #5005

Closed
1 task
renliangyu857 opened this issue Oct 19, 2022 · 1 comment · Fixed by #5033
Closed
1 task

insert on duplicate语句不带列字段时出现空指针问题 #5005

renliangyu857 opened this issue Oct 19, 2022 · 1 comment · Fixed by #5033
Assignees
Labels
task: help-wanted Extra attention is needed

Comments

@renliangyu857
Copy link
Contributor

renliangyu857 commented Oct 19, 2022

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

Ⅰ. Issue Description

不带列字段时出现空指针,如insert into t values(1,1,1) on duplicate key update a = 2;

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:
定位到时在通过插入的数据构造前置镜像时,recognizer.getInsertColumns返回了null,在遍历时出现空指针问题;此时应该根据values构造主键查询列,参考BaseInsertExecutor#parsePKValuesFromStatement

image

Ⅲ. Describe what you expected to happen

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

  1. xxx
  2. xxx
  3. xxx

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version :
  • Seata version:
  • OS :
  • Others:
@funky-eyes funky-eyes added the task: help-wanted Extra attention is needed label Oct 21, 2022
@funky-eyes
Copy link
Contributor

insert into t_nounique values(3,3) on duplicate key update b = 5
这种sql需要根据matedata信息读到列的顺序去找到主键

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task: help-wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants