strongduanmu commented on code in PR #23612:
URL: https://github.com/apache/shardingsphere/pull/23612#discussion_r1072037760


##########
proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/header/update/UpdateResponseHeader.java:
##########
@@ -43,24 +44,40 @@ public final class UpdateResponseHeader implements 
ResponseHeader {
     private long updateCount;
     
     public UpdateResponseHeader(final SQLStatement sqlStatement) {
-        this(sqlStatement, Collections.emptyList());
+        this(sqlStatement, Collections.emptyList(), Collections.emptyList());
     }
     
     public UpdateResponseHeader(final SQLStatement sqlStatement, final 
Collection<UpdateResult> updateResults) {
+        this(sqlStatement, updateResults, Collections.emptyList());
+    }
+    
+    public UpdateResponseHeader(final SQLStatement sqlStatement, final 
Collection<UpdateResult> updateResults, final Collection<Comparable<?>> 
autoIncrementGeneratedValues) {
         this.sqlStatement = sqlStatement;
-        lastInsertId = getLastInsertId(updateResults);
+        lastInsertId = getLastInsertId(updateResults, 
autoIncrementGeneratedValues);
         updateCount = updateResults.iterator().hasNext() ? 
updateResults.iterator().next().getUpdateCount() : 0;
         for (UpdateResult each : updateResults) {
             updateCounts.add(each.getUpdateCount());
         }
     }
     
-    private long getLastInsertId(final Collection<UpdateResult> updateResults) 
{
-        long result = 0;
+    private long getLastInsertId(final Collection<UpdateResult> updateResults, 
final Collection<Comparable<?>> autoIncrementGeneratedValues) {
+        List<Long> lastInsertIds = new LinkedList<>();

Review Comment:
   Thank you for your suggestion, I will optimize it.



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