Copilot commented on code in PR #8118:
URL: https://github.com/apache/incubator-seata/pull/8118#discussion_r3329764585


##########
rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/AbstractUndoExecutor.java:
##########
@@ -306,10 +306,16 @@ protected TableRecords 
queryCurrentRecords(ConnectionProxy connectionProxy) thro
         int pkRowSize = pkRowValues.get(firstKey).size();
         List<SqlGenerateUtils.WhereSql> sqlConditions =
                 SqlGenerateUtils.buildWhereConditionListByPKs(pkNameList, 
pkRowSize, connectionProxy.getDbType());
+
+        List<Row> rows = undoRecords.getRows();
+        String selectColumns = 
undoRecords.getRows().get(0).getFields().stream()
+                .map(field -> ColumnUtils.addEscape(field.getName(), 
connectionProxy.getDbType()))
+                .collect(Collectors.joining(", "));
+
         TableRecords currentRecords = new TableRecords(tableMeta);
         int totalRowIndex = 0;
         for (SqlGenerateUtils.WhereSql sqlCondition : sqlConditions) {
-            String checkSQL = buildCheckSql(sqlUndoLog.getTableName(), 
sqlCondition.getSql());
+            String checkSQL = buildCheckSql(sqlUndoLog.getTableName(), 
sqlCondition.getSql(), selectColumns);

Review Comment:
   This new overload call bypasses the existing 
`BaseSqlServerUndoExecutor.buildCheckSql(String, String)` override, so SQL 
Server undo validation will now use the base `... FOR UPDATE` syntax instead of 
`WITH(UPDLOCK)`, which is invalid for SQL Server. Please preserve the dialect 
override path or add a SQL Server override for the new explicit-column overload.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to