xfyang1989 opened a new issue #2271: INSERT ... ON DUPLICATE KEY UPDATE 
,Reporting the following error
URL: https://github.com/apache/incubator-shardingsphere/issues/2271
 
 
   sql:
   insert into t_order (id, avl_inventory, `type`, 
   create_person, create_time, update_person, update_time, is_deleted, version 
) 
   VALUES 
     (76667, 100, 1, 'xx(189870)', '2019-4-25 18:25:20', 
'xx(189870)','2019-4-25 18:25:20', 0,0 ) , 
    (78143, 100, 1, 'xx(189870)', '2019-4-25 18:25:20',
    'xx(189870)', '2019-4-25 18:25:20', 0,0 )
    ON DUPLICATE KEY UPDATE avl_inventory = VALUES(avl_inventory),
    `type` = VALUES(`type`),
    create_time = VALUES(create_time), create_person = VALUES(create_person),
    update_time = VALUES(update_time), update_person = VALUES(update_person);
   
   error:
   Caused by: 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: 
Duplicate entry '78143' for key 'PRIMARY'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
        at com.mysql.jdbc.Util.getInstance(Util.java:408)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
        at 
com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1283)
        at 
com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:783)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197)
        at 
com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
        at 
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
        at 
org.apache.shardingsphere.shardingjdbc.executor.SQLExecuteCallbackFactory$2.executeSQL(SQLExecuteCallbackFactory.java:65)
        at 
org.apache.shardingsphere.shardingjdbc.executor.SQLExecuteCallbackFactory$2.executeSQL(SQLExecuteCallbackFactory.java:61)
        at 
org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteCallback.execute0(SQLExecuteCallback.java:69)
        at 
org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteCallback.execute(SQLExecuteCallback.java:58)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to