You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/21 15:11:51 UTC

[GitHub] [shardingsphere] suikenungleung opened a new issue #12608: There are no abnormal errors displayed.

suikenungleung opened a new issue #12608:
URL: https://github.com/apache/shardingsphere/issues/12608


   ## Bug Report
   
   ### Development environment
   Spring Boot: 2.5.4 
   MyBatis Spring Boot Starter: 2.2.0
   ShardingSphere JDBC: 5.0.0-beta
   MySQL: 8.0.23
   ### Which version of ShardingSphere did you use?
   5.0.0-beta
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   shardingsphere-jdbc-core
   ### Expected behavior
   Throw an exception.
   The username field is unique, an exception should be thrown when adding duplicates. It is normal when not using ShardingSphere.
   
   ```
   org.springframework.dao.DuplicateKeyException: 
   ### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'suikenung' for key 'user.uk_username'
   ### The error may exist in file [D:\Software\JetBrains\Projects\Java\sugus\sugus-system\target\classes\mapper\UserMapper.xml]
   ### The error may involve com.lrq.sugus.system.mapper.UserMapper.insert-Inline
   ### The error occurred while setting parameters
   ### SQL: insert into `user`          ( username,                                           `password`,                                           enabled,                                           full_name,                                           email,                                           mobile,                                           sex )           values ( ?,                                           ?,                                           ?,                                           ?,                                           ?,                                           ?,                                           ? )
   ### Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'suikenung' for key 'user.uk_username'
   ; Duplicate entry 'suikenung' for key 'user.uk_username'; nested exception is java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'suikenung' for key 'user.uk_username'
   ```
   
   ### Actual behavior
   When using ShardingSphere, nothing happened. And no exception is thrown.
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ```
   CREATE TABLE `user`  (
     ...
     UNIQUE INDEX `uk_username`(`username`) USING BTREE
   ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
   ```
   ```
   <insert id="insert" keyProperty="id" parameterType="com.lrq.sugus.system.dataobject.UserDO" useGeneratedKeys="true">
   	insert into `user` (username) values (#{username})
   </insert>
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #12608: There are no abnormal errors displayed.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #12608:
URL: https://github.com/apache/shardingsphere/issues/12608#issuecomment-924486853


   Duplicate with #10844.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #12608: There are no abnormal errors displayed.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #12608:
URL: https://github.com/apache/shardingsphere/issues/12608#issuecomment-924477720






-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu closed issue #12608: There are no abnormal errors displayed.

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #12608:
URL: https://github.com/apache/shardingsphere/issues/12608


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] suikenungleung commented on issue #12608: There are no abnormal errors displayed.

Posted by GitBox <gi...@apache.org>.
suikenungleung commented on issue #12608:
URL: https://github.com/apache/shardingsphere/issues/12608#issuecomment-924728581


   @RaigorJiang @strongduanmu Thank you very much.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu removed a comment on issue #12608: There are no abnormal errors displayed.

Posted by GitBox <gi...@apache.org>.
strongduanmu removed a comment on issue #12608:
URL: https://github.com/apache/shardingsphere/issues/12608#issuecomment-924477720


   Hi @suikenungleung, what is your sharding config?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #12608: There are no abnormal errors displayed.

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #12608:
URL: https://github.com/apache/shardingsphere/issues/12608#issuecomment-924483051


   @suikenungleung @strongduanmu 
   This issue has been fixed in master branch, please refer to #10138, #10844.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org