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

Index0utOfBoundsException occurs when execute merge statement without sharding generated key #32934

Open
strongduanmu opened this issue Sep 20, 2024 · 0 comments

Comments

@strongduanmu
Copy link
Member

Bug Report

Which version of ShardingSphere did you use?

b7294f7

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

Execute merge statement successfully when I not config sharding generated key.

Actual behavior

image

Reason analyze (If you can)

The generated in ShardingSphereColumn should indicate whether to use the distributed key, rather than the id generated in the underlying db. This logic is correct in earlier versions (such as 5.0.0).

The logic of the latest version is wrong. It will first determine whether it is a distributed ID. If not, it will use the ID generated in the db.

image

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

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