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/05/08 03:00:24 UTC

[GitHub] [shardingsphere] LikeElephantintheforest opened a new issue #10278: SELECT LAST_INSERT_ID() expect return the self-growth primary key

LikeElephantintheforest opened a new issue #10278:
URL: https://github.com/apache/shardingsphere/issues/10278


   ## Question
   
   At mybatis mapper.xml , I using following code to expect return the self-growth primary key and then hope the model have id value.
   
   ```sql
       <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
         SELECT LAST_INSERT_ID()
       </selectKey>
   ```
   > but it given me null .
   
   in my sharding conf , I setting master-slave like this :
   
   sharding.jdbc.config.sharding.master-slave-rules.ms0.master-data-source-name = 
   sharding.jdbc.config.sharding.master-slave-rules.ms0.slave-data-source-names = 
   sharding.jdbc.config.sharding.master-slave-rules.ms1.master-data-source-name = 
   sharding.jdbc.config.sharding.master-slave-rules.ms1.slave-data-source-names = 
   sharding.jdbc.config.sharding.master-slave-rules.ms2.master-data-source-name = 
   sharding.jdbc.config.sharding.master-slave-rules.ms2.slave-data-source-names =
   sharding.jdbc.config.sharding.master-slave-rules.ms3.master-data-source-name = 
   sharding.jdbc.config.sharding.master-slave-rules.ms3.slave-data-source-names = 
   sharding.jdbc.config.sharding.master-slave-rules.ms4.master-data-source-name = 
   sharding.jdbc.config.sharding.master-slave-rules.ms4.slave-data-source-names = 
   // ignore other settings ....
   
   when i remove  master - slave conf ,  i unexpectedly get the self-growth primary key , i don't konw why .... 
   
   look other about  'SELECT LAST_INSERT_ID()' issures , talks shading not support this way , but it cant explain why did i remove master - slave conf ,it can be works .
   
   sorry for my bad English , thanks ,谢谢。
   
   current talk version like :
   ![image](https://user-images.githubusercontent.com/28836829/117523291-9f9ce600-afea-11eb-82e5-7bceaff7c720.png)
   
   
   
   


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #10278: SELECT LAST_INSERT_ID() expect return the self-growth primary key

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


   Hi could you try 5.x or 4.x release? I suppose we fixed it already. BTW, I suggest you search the keywords in the issue list (Especially these closed ones) so that you can know which release included this bug fix. Thanks.


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #10278: SELECT LAST_INSERT_ID() expect return the self-growth primary key

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


   Close because of no repsonse


-- 
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] LikeElephantintheforest commented on issue #10278: SELECT LAST_INSERT_ID() expect return the self-growth primary key

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


   sharding.jdbc.config.sharding.master-slave-rules.ms0.master-data-source-name = 
   
   value is not empty , i replaced them for ask question;


-- 
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu edited a comment on issue #10278: SELECT LAST_INSERT_ID() expect return the self-growth primary key

Posted by GitBox <gi...@apache.org>.
terrymanu edited a comment on issue #10278:
URL: https://github.com/apache/shardingsphere/issues/10278#issuecomment-927271772


   Close because of no response


-- 
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] terrymanu closed issue #10278: SELECT LAST_INSERT_ID() expect return the self-growth primary key

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


   


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