shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

insert ... on duplicate key update has some bug

Open maxiaoguang64 opened this issue 8 years ago • 5 comments

sql like that insert into table(id, name) values (1, ?)on duplicate key update name = ? when parameter after on duplicate key update that has some bug

maxiaoguang64 avatar Jul 30 '18 07:07 maxiaoguang64

Is any relationship of this issue and #1105? @AIKiller

terrymanu avatar Aug 07 '18 17:08 terrymanu

I won't to fix after careful consideration l don't think it possible that use placeholder in update clause usually, we use insert ... update like this 1、insert into table (name, version) values (?, ?) on duplicate key update version = version + 1 2、insert into table (name) values (?), (?) on duplicate key update version = values(name)

maxiaoguang64 avatar Aug 08 '18 14:08 maxiaoguang64

Hi! Just FYI it is possible to use the placeholder in the update clause but as you say the common usage is just to use the values keyword or similar.

Cheers!

victormferrara avatar Aug 08 '18 14:08 victormferrara

您好,我也遇到了相同的问题,insert on duplicate key update是一个非常重要的功能,尤其是对于后台的增删改查来说。请看下能否支持? 谢谢。  Hello, I came across the same problem, "insert on duplicate key update" is an important feature in MySQL, especially for some admin operations. I sincerely hope that sharding-jdbc can support it, thanks very much.

giantoneday avatar Jan 17 '19 15:01 giantoneday

For English only, other languages will not accept.

terrymanu avatar Jan 17 '19 16:01 terrymanu