This is an automated email from the ASF dual-hosted git repository.

terrymanu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 377f8cfeee8 Fix MCP savepoint rollback statement normalization (#39163)
377f8cfeee8 is described below

commit 377f8cfeee861872b3b9c879da7da03e985afb6e
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Jul 17 12:57:51 2026 +0800

    Fix MCP savepoint rollback statement normalization (#39163)
    
    * Improve workflow validation and JDBC diagnostics
    
    - isolate workflow plans by kind and reject conflicting rule inputs
    - complete sharding validation and key generation strategy coverage
    - classify runtime JDBC failures for supported database dialects
    - extend MCP workflow contract and proxy E2E coverage
    
    * Improve workflow validation and JDBC diagnostics
    
    - isolate workflow plans by kind and reject conflicting rule inputs
    - complete sharding validation and key generation strategy coverage
    - classify runtime JDBC failures for supported database dialects
    - extend MCP workflow contract and proxy E2E coverage
    
    * Fix MCP savepoint rollback statement normalization
---
 .../mcp/core/tool/handler/execute/MCPStatementAnalyzer.java          | 5 +----
 .../mcp/core/tool/handler/execute/MCPStatementAnalyzerTest.java      | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git 
a/mcp/core/src/main/java/org/apache/shardingsphere/mcp/core/tool/handler/execute/MCPStatementAnalyzer.java
 
b/mcp/core/src/main/java/org/apache/shardingsphere/mcp/core/tool/handler/execute/MCPStatementAnalyzer.java
index e37cde39fd8..e5ec1644e38 100644
--- 
a/mcp/core/src/main/java/org/apache/shardingsphere/mcp/core/tool/handler/execute/MCPStatementAnalyzer.java
+++ 
b/mcp/core/src/main/java/org/apache/shardingsphere/mcp/core/tool/handler/execute/MCPStatementAnalyzer.java
@@ -184,11 +184,8 @@ final class MCPStatementAnalyzer {
         if (upperSql.startsWith("START TRANSACTION")) {
             return "START TRANSACTION";
         }
-        if (upperSql.startsWith("ROLLBACK TO SAVEPOINT")) {
-            return "ROLLBACK TO SAVEPOINT";
-        }
         if (upperSql.startsWith("ROLLBACK TO")) {
-            return "ROLLBACK TO";
+            return "ROLLBACK TO SAVEPOINT";
         }
         if (upperSql.startsWith("RELEASE SAVEPOINT")) {
             return "RELEASE SAVEPOINT";
diff --git 
a/mcp/core/src/test/java/org/apache/shardingsphere/mcp/core/tool/handler/execute/MCPStatementAnalyzerTest.java
 
b/mcp/core/src/test/java/org/apache/shardingsphere/mcp/core/tool/handler/execute/MCPStatementAnalyzerTest.java
index 9d17190db1d..7d09bda1842 100644
--- 
a/mcp/core/src/test/java/org/apache/shardingsphere/mcp/core/tool/handler/execute/MCPStatementAnalyzerTest.java
+++ 
b/mcp/core/src/test/java/org/apache/shardingsphere/mcp/core/tool/handler/execute/MCPStatementAnalyzerTest.java
@@ -213,7 +213,7 @@ class MCPStatementAnalyzerTest {
                 Arguments.of("commit", "MySQL", "COMMIT", 
SupportedMCPStatement.TRANSACTION_CONTROL, "COMMIT", "COMMIT", "", ""),
                 Arguments.of("rollback", "MySQL", "ROLLBACK", 
SupportedMCPStatement.TRANSACTION_CONTROL, "ROLLBACK", "ROLLBACK", "", ""),
                 Arguments.of("savepoint", "MySQL", "SAVEPOINT order_sp", 
SupportedMCPStatement.SAVEPOINT, "SAVEPOINT", "SAVEPOINT order_sp", "", 
"order_sp"),
-                Arguments.of("rollback to without optional keyword", "MySQL", 
"ROLLBACK TO order_sp", SupportedMCPStatement.SAVEPOINT, "ROLLBACK TO",
+                Arguments.of("rollback to without optional keyword", "MySQL", 
"ROLLBACK TO order_sp", SupportedMCPStatement.SAVEPOINT, "ROLLBACK TO 
SAVEPOINT",
                         "ROLLBACK TO order_sp", "", "order_sp"),
                 Arguments.of("rollback to", "MySQL", "ROLLBACK TO SAVEPOINT 
order_sp", SupportedMCPStatement.SAVEPOINT, "ROLLBACK TO SAVEPOINT",
                         "ROLLBACK TO SAVEPOINT order_sp", "", "order_sp"),

Reply via email to