You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/09/07 05:35:01 UTC

[shardingsphere] branch master updated: [Issue #20388]-Improving coverage of CreateFunctionStatementHandler (#20839)

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

duanzhengqiang 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 3d532e785ae [Issue #20388]-Improving coverage of CreateFunctionStatementHandler (#20839)
3d532e785ae is described below

commit 3d532e785ae529a9d140585c51044e145efe18f5
Author: Abhinav Koppula <ab...@gmail.com>
AuthorDate: Wed Sep 7 11:04:52 2022 +0530

    [Issue #20388]-Improving coverage of CreateFunctionStatementHandler (#20839)
---
 .../handler/ddl/CreateFunctionStatementHandlerTest.java      | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/ddl/CreateFunctionStatementHandlerTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/ddl/CreateFunctionStatementHandlerTest.java
index 33950c196ee..70e938fa000 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/ddl/CreateFunctionStatementHandlerTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/ddl/CreateFunctionStatementHandlerTest.java
@@ -19,6 +19,10 @@ package org.apache.shardingsphere.sql.parser.sql.dialect.handler.ddl;
 
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.routine.RoutineBodySegment;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLCreateFunctionStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.OpenGaussCreateFunctionStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl.OracleCreateFunctionStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateFunctionStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerCreateFunctionStatement;
 import org.junit.Test;
 
 import java.util.Optional;
@@ -43,4 +47,12 @@ public final class CreateFunctionStatementHandlerTest {
         Optional<RoutineBodySegment> routineBodySegment = CreateFunctionStatementHandler.getRoutineBodySegment(createFunctionStatement);
         assertFalse(routineBodySegment.isPresent());
     }
+    
+    @Test
+    public void assertGetRoutineBodySegmentForOtherDatabases() {
+        assertFalse(CreateFunctionStatementHandler.getRoutineBodySegment(new OpenGaussCreateFunctionStatement()).isPresent());
+        assertFalse(CreateFunctionStatementHandler.getRoutineBodySegment(new OracleCreateFunctionStatement()).isPresent());
+        assertFalse(CreateFunctionStatementHandler.getRoutineBodySegment(new PostgreSQLCreateFunctionStatement()).isPresent());
+        assertFalse(CreateFunctionStatementHandler.getRoutineBodySegment(new SQLServerCreateFunctionStatement()).isPresent());
+    }
 }