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

字段值为空时,分布式主键id赋值错误 #2896

Closed
1071746754 opened this issue Aug 20, 2019 · 1 comment
Closed

字段值为空时,分布式主键id赋值错误 #2896

1071746754 opened this issue Aug 20, 2019 · 1 comment

Comments

@1071746754
Copy link

1071746754 commented Aug 20, 2019

现象:
4.0.0-RC1版本,当我插入的数据中,有一个字段是null的时候,自动生成的主键id赋值到了其他字段。例如我要插入INSERT INTO user (name, remark, age) VALUES ("test", null, 18),经过sharding处理之后变成了INSERT INTO user (name, remark, age, id) VALUES ("test", 18, "自动生成的主键id", null)

分析:
InsertOptimizeResultUnit类中的getCurrentIndex方法有问题,当获取当前index下标的时候判断有问题。这里感觉不需要在重新计算一次当前下表了,根据前面的字段数量即可知道当前下标量了

@terrymanu
Copy link
Member

For English only, other languages will not accept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants