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 10cb6f0a119 [Issue #20371]-Improve coverage for
ExplainStatementHandler (#20823)
10cb6f0a119 is described below
commit 10cb6f0a1199a6e9aa646901816ff7f0a150aa50
Author: Abhinav Koppula <[email protected]>
AuthorDate: Tue Sep 6 16:15:47 2022 +0530
[Issue #20371]-Improve coverage for ExplainStatementHandler (#20823)
---
.../sql/dialect/handler/dal/ExplainStatementHandlerTest.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dal/ExplainStatementHandlerTest.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dal/ExplainStatementHandlerTest.java
index ac760fac0fb..84d70311378 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dal/ExplainStatementHandlerTest.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dal/ExplainStatementHandlerTest.java
@@ -21,6 +21,9 @@ import
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.Sim
import
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
import
org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLExplainStatement;
+import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.dal.OpenGaussExplainStatement;
+import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dal.PostgreSQLExplainStatement;
+import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.dal.SQLServerExplainStatement;
import org.junit.Test;
import java.util.Optional;
@@ -44,4 +47,11 @@ public final class ExplainStatementHandlerTest {
Optional<SimpleTableSegment> simpleTableSegment =
ExplainStatementHandler.getSimpleTableSegment(explainStatement);
assertFalse(simpleTableSegment.isPresent());
}
+
+ @Test
+ public void assertGetSimpleTableSegmentForOtherDatabases() {
+ assertFalse(ExplainStatementHandler.getSimpleTableSegment(new
OpenGaussExplainStatement()).isPresent());
+ assertFalse(ExplainStatementHandler.getSimpleTableSegment(new
PostgreSQLExplainStatement()).isPresent());
+ assertFalse(ExplainStatementHandler.getSimpleTableSegment(new
SQLServerExplainStatement()).isPresent());
+ }
}