kingshard icon indicating copy to clipboard operation
kingshard copied to clipboard

执行预处理语句-报错-报表不存在

Open fengdangxing opened this issue 4 years ago • 6 comments

SELECT * FROM test_shard_month WHERE id IN (?,?,?)

fengdangxing avatar Jun 23 '20 01:06 fengdangxing

是的不支持,三方mysql库连kingshard库都报这个错INSERT INTO task_record (id,jobName,keyId,createdTime) VALUES (?, ?, ?, ?) ERROR 1146 (42S02): Table 'report.task_record' doesn't exist

如果改写成SELECT * FROM test_shard_month WHERE id IN (1,2,3) 就正常。

franklwel1990 avatar Jul 25 '20 08:07 franklwel1990

预处理的不支持吗

fengdangxing avatar Aug 03 '20 02:08 fengdangxing

准确的说查询分表的预处理语句是不支持的,不分表的预处理是正常的。

fengdangxing [email protected] 于 2020年8月3日周一 上午9:19写道:

预处理的不支持吗

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flike/kingshard/issues/573#issuecomment-667768144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2X5MZMHPQ2BMJCI3QDCX3R6YNDBANCNFSM4OFF26NQ .

franklwel1990 avatar Aug 03 '20 02:08 franklwel1990

这样php 框架的 就很难使用

fengdangxing avatar Aug 03 '20 02:08 fengdangxing

可以先转成不带?号的普通SQL语句也是一样正常能用的,这个bug有时间再修复一下,不影响正常使用,它的分表,读写分离,并发还是挺不错的

fengdangxing [email protected] 于 2020年8月3日周一 上午9:50写道:

这样php 框架的 就很难使用

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flike/kingshard/issues/573#issuecomment-667775382, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2X5MZRZCAFSNS2RYDRWKLR6YQX5ANCNFSM4OFF26NQ .

franklwel1990 avatar Aug 03 '20 02:08 franklwel1990

现在主要是主流都预处理,只能写原生sql才能兼容

fengdangxing avatar Aug 03 '20 02:08 fengdangxing