Open sandynz opened 1 year ago
Thank you for your feedback, I will investigate this issue.
The reason is that byte[] does not implement the Comparable interface, resulting in an exception. After changing byte[] to String, the execution is normal.
Hi @harvies , thanks for your investigation.
In real world, order_id
might be byte array with special characters (e.g. 0x05), then we could not just call setObject(int,String)
.
Feature Request
Is your feature request related to a problem?
Yes
Describe the feature you would like.
MySQL is used, table primary key is VARBINARY type. Primary key column is NOT sharding column, and keyGenerateStrategy is configured. When insert into table, primary key value is set in SQL, not generated by ShardingSphere. There's exception thrown.
table structure example:
sharding rule
driver/test_varbinary_pk_batch_insert.yaml
:Test java code:
Possible solution
Current work around: Remove
keyGenerateStrategy
configuration, then it works.If
keyGenerateStrategy
is set, could we ignorecreateGenerateKeyContext
when related column's value is set in SQL?