yunmengmeng opened a new issue, #18837:
URL: https://github.com/apache/shardingsphere/issues/18837

   I set two databases.The second is sharding database.
   When i use ` INSERT INTO   .... SELECT LAST_INSERT_ID() AS ...` to the first 
dabase,the tables's primary key type is auto-incrment,it saves in the first 
database,but when querying insert id,it's return value is wrong.Just retuns 0.
   
   ### Which version of ShardingSphere did you use?
   5.1.2
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   LAST_INSERT_ID()
   ### Actual behavior
   0
   ### Reason analyze (If you can)
   It chooses the second database.
   
   
   
![image](https://user-images.githubusercontent.com/46476040/177172870-397deb3a-d77c-4ad8-ae73-2c056ebeae94.png)
   
   PartialSQLRouteExecutor
   
   
![image](https://user-images.githubusercontent.com/46476040/177173113-0434040d-4b8f-4473-9f29-5eee18a2fd8c.png)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   INSERT INTO tree1 (pid) VALUES (1);
   SELECT LAST_INSERT_ID() AS id;
   
   
   
   


-- 
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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to