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

zhangliang 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 3442f679eca Support parsing Doris CANCEL BACKUP syntax (#38299)
3442f679eca is described below

commit 3442f679ecac41ead5e75e84aad107f9b2cc74f7
Author: cxy <[email protected]>
AuthorDate: Tue Mar 3 12:12:35 2026 +0800

    Support parsing Doris CANCEL BACKUP syntax (#38299)
---
 .../core/database/visitor/SQLVisitorRule.java      |  2 +
 .../src/main/antlr4/imports/doris/DALStatement.g4  |  4 ++
 .../sql/parser/autogen/DorisStatement.g4           |  1 +
 .../statement/type/DorisDALStatementVisitor.java   | 12 +++++
 .../doris/dal/DorisCancelBackupStatement.java      | 40 +++++++++++++++++
 .../dal/dialect/doris/DorisDALStatementAssert.java |  5 +++
 .../type/DorisCancelBackupStatementAssert.java     | 51 ++++++++++++++++++++++
 .../cases/parser/jaxb/RootSQLParserTestCases.java  |  4 ++
 .../doris/DorisCancelBackupStatementTestCase.java  | 43 ++++++++++++++++++
 .../src/main/resources/case/dal/cancel-backup.xml  | 31 +++++++++++++
 .../resources/sql/supported/dal/cancel-backup.xml  | 24 ++++++++++
 11 files changed, 217 insertions(+)

diff --git 
a/parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/core/database/visitor/SQLVisitorRule.java
 
b/parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/core/database/visitor/SQLVisitorRule.java
index faaa168448d..2a6c33a34c3 100644
--- 
a/parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/core/database/visitor/SQLVisitorRule.java
+++ 
b/parser/sql/engine/core/src/main/java/org/apache/shardingsphere/sql/parser/engine/core/database/visitor/SQLVisitorRule.java
@@ -553,6 +553,8 @@ public enum SQLVisitorRule {
     
     BACKUP("Backup", SQLStatementType.DAL),
     
+    CANCEL_BACKUP("CancelBackup", SQLStatementType.DAL),
+    
     DORIS_ALTER_SYSTEM("DorisAlterSystem", SQLStatementType.DAL),
     
     CREATE_SQL_BLOCK_RULE("CreateSqlBlockRule", SQLStatementType.DAL),
diff --git 
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4 
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4
index 67cbbd75a64..85499ab4bc7 100644
--- 
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4
+++ 
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DALStatement.g4
@@ -802,6 +802,10 @@ backupTableSpec
     : tableName (PARTITION LP_ partitionList RP_)?
     ;
 
+cancelBackup
+    : CANCEL GLOBAL? BACKUP (FROM databaseName)?
+    ;
+
 show
     : showDatabases
     | showTables
diff --git 
a/parser/sql/engine/dialect/doris/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/DorisStatement.g4
 
b/parser/sql/engine/dialect/doris/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/DorisStatement.g4
index 263c6d855c2..ef0cc52bec7 100644
--- 
a/parser/sql/engine/dialect/doris/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/DorisStatement.g4
+++ 
b/parser/sql/engine/dialect/doris/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/DorisStatement.g4
@@ -160,6 +160,7 @@ execute
     | unsetVariable
     | createJob
     | backup
+    | cancelBackup
     // TODO consider refactor following sytax to SEMI_? EOF
     ) (SEMI_ EOF? | EOF)
     | EOF
diff --git 
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java
 
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java
index 28c6be0d0a9..ddb2f720a8b 100644
--- 
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java
+++ 
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDALStatementVisitor.java
@@ -160,6 +160,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowBui
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ShowAlterTableContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.BackupContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.BackupTableSpecContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CancelBackupContext;
 import 
org.apache.shardingsphere.sql.parser.engine.doris.visitor.statement.DorisStatementVisitor;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.BackupTableSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.CacheTableIndexSegment;
@@ -212,6 +213,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.core.value.literal.impl.Te
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterResourceStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterSystemStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisBackupStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCancelBackupStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateSqlBlockRuleStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateRepositoryStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisSwitchStatement;
@@ -1477,4 +1479,14 @@ public final class DorisDALStatementVisitor extends 
DorisStatementVisitor implem
         }
         return result;
     }
+    
+    @Override
+    public ASTNode visitCancelBackup(final CancelBackupContext ctx) {
+        DorisCancelBackupStatement result = new 
DorisCancelBackupStatement(getDatabaseType());
+        result.setGlobal(null != ctx.GLOBAL());
+        if (null != ctx.databaseName()) {
+            result.setDatabase((DatabaseSegment) visit(ctx.databaseName()));
+        }
+        return result;
+    }
 }
diff --git 
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisCancelBackupStatement.java
 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisCancelBackupStatement.java
new file mode 100644
index 00000000000..f31c82c030b
--- /dev/null
+++ 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/dal/DorisCancelBackupStatement.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.statement.doris.dal;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.generic.DatabaseSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.DALStatement;
+
+/**
+ * Cancel backup statement for Doris.
+ */
+@Getter
+@Setter
+public final class DorisCancelBackupStatement extends DALStatement {
+    
+    private boolean global;
+    
+    private DatabaseSegment database;
+    
+    public DorisCancelBackupStatement(final DatabaseType databaseType) {
+        super(databaseType);
+    }
+}
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/DorisDALStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/DorisDALStatementAssert.java
index 1316716dca9..2f98509de79 100644
--- 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/DorisDALStatementAssert.java
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/DorisDALStatementAssert.java
@@ -24,6 +24,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.dal.Un
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterResourceStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisAlterSystemStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisBackupStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCancelBackupStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateSqlBlockRuleStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCreateRepositoryStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisDescFunctionStatement;
@@ -40,6 +41,7 @@ import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAsse
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAlterResourceStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisAlterSystemStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisBackupStatementAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCancelBackupStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCreateSqlBlockRuleStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisCreateRepositoryStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type.DorisDescFunctionStatementAssert;
@@ -57,6 +59,7 @@ import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.S
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAlterResourceStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAlterSystemStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisBackupStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCancelBackupStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateSqlBlockRuleStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCreateRepositoryStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisDescFunctionStatementTestCase;
@@ -117,6 +120,8 @@ public final class DorisDALStatementAssert {
             DorisShowDataStatementAssert.assertIs(assertContext, 
(DorisShowDataStatement) actual, (DorisShowDataStatementTestCase) expected);
         } else if (actual instanceof DorisBackupStatement) {
             DorisBackupStatementAssert.assertIs(assertContext, 
(DorisBackupStatement) actual, (DorisBackupStatementTestCase) expected);
+        } else if (actual instanceof DorisCancelBackupStatement) {
+            DorisCancelBackupStatementAssert.assertIs(assertContext, 
(DorisCancelBackupStatement) actual, (DorisCancelBackupStatementTestCase) 
expected);
         }
     }
 }
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisCancelBackupStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisCancelBackupStatementAssert.java
new file mode 100644
index 00000000000..42e2b2db1de
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dal/dialect/doris/type/DorisCancelBackupStatementAssert.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dal.dialect.doris.type;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.dal.DorisCancelBackupStatement;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.database.DatabaseAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCancelBackupStatementTestCase;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Cancel backup statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisCancelBackupStatementAssert {
+    
+    /**
+     * Assert cancel backup statement is correct with expected parser result.
+     *
+     * @param assertContext assert context
+     * @param actual actual cancel backup statement
+     * @param expected expected cancel backup statement test case
+     */
+    public static void assertIs(final SQLCaseAssertContext assertContext, 
final DorisCancelBackupStatement actual, final 
DorisCancelBackupStatementTestCase expected) {
+        assertThat(assertContext.getText("global flag does not match: "), 
actual.isGlobal(), is(expected.isGlobal()));
+        if (null != expected.getDatabase()) {
+            assertNotNull(actual.getDatabase(), assertContext.getText("Actual 
database should exist."));
+            DatabaseAssert.assertIs(assertContext, actual.getDatabase(), 
expected.getDatabase());
+        }
+    }
+}
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
index a99710ba408..b39fd97f721 100644
--- 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
@@ -107,6 +107,7 @@ import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.s
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.mysql.table.MySQLRepairTableStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisAlterResourceStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisBackupStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisCancelBackupStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisSyncStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisDescFunctionStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris.DorisShowFunctionsStatementTestCase;
@@ -1283,6 +1284,9 @@ public final class RootSQLParserTestCases {
     @XmlElement(name = "backup")
     private final List<DorisBackupStatementTestCase> backupTestCases = new 
LinkedList<>();
     
+    @XmlElement(name = "cancel-backup")
+    private final List<DorisCancelBackupStatementTestCase> 
cancelBackupTestCases = new LinkedList<>();
+    
     @XmlElement(name = "drop-shadow-algorithm")
     private final List<DropShadowAlgorithmStatementTestCase> 
dropShadowAlgorithmTestCases = new LinkedList<>();
     
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisCancelBackupStatementTestCase.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisCancelBackupStatementTestCase.java
new file mode 100644
index 00000000000..efa5eee8cbd
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/dal/dialect/doris/DorisCancelBackupStatementTestCase.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.dal.dialect.doris;
+
+import lombok.Getter;
+import lombok.Setter;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.database.ExpectedDatabase;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Cancel backup statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisCancelBackupStatementTestCase extends 
SQLParserTestCase {
+    
+    @XmlAttribute(name = "global")
+    private boolean global;
+    
+    @XmlElement
+    private ExpectedDatabase database;
+}
diff --git a/test/it/parser/src/main/resources/case/dal/cancel-backup.xml 
b/test/it/parser/src/main/resources/case/dal/cancel-backup.xml
new file mode 100644
index 00000000000..70924bd7741
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/dal/cancel-backup.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-parser-test-cases>
+    <cancel-backup sql-case-id="cancel_backup_without_global_without_db" />
+
+    <cancel-backup sql-case-id="cancel_backup_without_global_with_db">
+        <database name="example_db" start-index="19" stop-index="28" />
+    </cancel-backup>
+
+    <cancel-backup sql-case-id="cancel_backup_with_global_without_db" 
global="true" />
+
+    <cancel-backup sql-case-id="cancel_backup_with_global_with_db" 
global="true">
+        <database name="example_db" start-index="26" stop-index="35" />
+    </cancel-backup>
+</sql-parser-test-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dal/cancel-backup.xml 
b/test/it/parser/src/main/resources/sql/supported/dal/cancel-backup.xml
new file mode 100644
index 00000000000..4cfc73b74e4
--- /dev/null
+++ b/test/it/parser/src/main/resources/sql/supported/dal/cancel-backup.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-cases>
+    <sql-case id="cancel_backup_without_global_without_db" value="CANCEL 
BACKUP" db-types="Doris" />
+    <sql-case id="cancel_backup_without_global_with_db" value="CANCEL BACKUP 
FROM example_db" db-types="Doris" />
+    <sql-case id="cancel_backup_with_global_without_db" value="CANCEL GLOBAL 
BACKUP" db-types="Doris" />
+    <sql-case id="cancel_backup_with_global_with_db" value="CANCEL GLOBAL 
BACKUP FROM example_db" db-types="Doris" />
+</sql-cases>

Reply via email to