apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.28k stars 8.78k forks source link

sharding-jdbc无法解析路由seata生成的查询语句 #4093

Open lIIlIIlI opened 2 years ago

lIIlIIlI commented 2 years ago

Ⅰ. Issue Description

sharding-jdbc分表后使用seata,seata生成的操作表查询语句sharding-jdbc无法路由,因为生成的主键被括号包了起来,sharding-jdbc无法解析该字段

Ⅱ. Describe what happened

image 此处将主键单独使用括号包了起来 image

Ⅲ. Describe what you expected to happen

是否能取消生成的sql语句主键外的括号呢?比如该处语句变为:SELECT * FROM task_refresh_package_log WHERE id in ( (?) )

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

1.集成sharding-jdbc

  1. 将要操作的表使用sharding-jdbc分库分表,主键作为分表字段

Ⅵ. Environment:

funky-eyes commented 2 years ago

看不到你的图片呀

lIIlIIlI commented 2 years ago

修改了一下内容,可以看见图片了

funky-eyes commented 2 years ago

你可以尝试用类覆盖的方式,改动下这个类的代码试试

lIIlIIlI commented 2 years ago

谢谢,我这边已经通过这种改动了

zhangxiangfeng commented 2 years ago

比较官方一点的处理方式是什么?