strongduanmu commented on issue #23047: URL: https://github.com/apache/shardingsphere/issues/23047#issuecomment-1385124792
Hi @lanxw @jeff-lai, I did some research on this issue. In MySQL, we use `auto_increment` to identify the primary key that needs to be auto-incremented. When we execute the insert statement, MySQL will return lastInsertId and updateCount, and the MySQL driver will calculate the auto-increment id value based on updateCount and autoIncrementValue. Therefore, we cannot support Proxy to obtain auto-increment ids when using the SNOWFLAKE algorithm, because the SNOWFLAKE algorithm is not continuous. In order to support the MySQL auto-increment id feature, I added isSupportAutoIncrement to KeyGenerateAlgorithm. We can implement our own auto-increment id algorithm based on the SPI interface, and then override isSupportAutoIncrement and return true. At this time, we can support returning auto-increment 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]
