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/04/08 05:11:12 UTC

[shardingsphere] branch master updated: Support comment statement for pg/og (#16654)

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 adb2f259074 Support comment statement for pg/og (#16654)
adb2f259074 is described below

commit adb2f259074d353fb59d8d761b170d862858261d
Author: Chuxin Chen <ch...@qq.com>
AuthorDate: Fri Apr 8 13:11:00 2022 +0800

    Support comment statement for pg/og (#16654)
    
    * support comment for pg/og
    
    * support comment for pg/og
---
 .../sql/parser/autogen/OpenGaussStatement.g4       |  1 +
 .../impl/OpenGaussDDLStatementSQLVisitor.java      |  7 +++
 .../parser/autogen/PostgreSQLStatementParser.g4    |  1 +
 .../impl/PostgreSQLDDLStatementSQLVisitor.java     |  7 +++
 .../statement/ddl/CommentStatement.java}           | 21 +------
 .../ddl/OpenGaussCommentStatement.java}            | 24 ++------
 .../oracle/ddl/OracleCommentStatement.java         |  5 +-
 .../ddl/PostgreSQLCommentStatement.java}           | 24 ++------
 .../src/main/resources/case/ddl/comment.xml        |  4 ++
 .../main/resources/sql/supported/ddl/comment.xml   |  8 ++-
 .../main/resources/sql/unsupported/unsupported.xml | 71 ----------------------
 11 files changed, 41 insertions(+), 132 deletions(-)

diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/OpenGaussStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/OpenGaussStatement.g4
index 1af64f021ee..375e03f7595 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/OpenGaussStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/OpenGaussStatement.g4
@@ -64,6 +64,7 @@ execute
     | alterProcedure
     | alterServer
     | alterSequence
+    | comment
     | createDatabase
     | createFunction
     | createProcedure
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
index 85e21ee4f9b..c15b038aa02 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
@@ -96,6 +96,7 @@ import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.Val
 import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.AlterGroupContext;
 import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.AlterMaterializedViewContext;
 import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.DeclareContext;
+import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.CommentContext;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.AlterDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.CreateDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.ColumnDefinitionSegment;
@@ -138,6 +139,7 @@ import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.OpenGaussAlterTablespaceStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.OpenGaussAlterTextSearchStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.OpenGaussAlterViewStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.OpenGaussCommentStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.OpenGaussCreateConversionStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.OpenGaussCreateDatabaseStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl.OpenGaussCreateDomainStatement;
@@ -743,4 +745,9 @@ public final class OpenGaussDDLStatementSQLVisitor extends OpenGaussStatementSQL
     public ASTNode visitDeclare(final DeclareContext ctx) {
         return new OpenGaussDeclareStatement();
     }
+    
+    @Override
+    public ASTNode visitComment(final CommentContext ctx) {
+        return new OpenGaussCommentStatement();
+    }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
index 2d4a2c96380..395481c44c8 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatementParser.g4
@@ -70,6 +70,7 @@ execute
     | alterProcedure
     | alterServer
     | alterSequence
+    | comment
     | createDatabase
     | createFunction
     | createProcedure
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
index e0e8c3eb840..340a8cfa5c4 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
@@ -113,6 +113,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Ta
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.TableNamesClauseContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.TruncateTableContext;
 import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.ValidateConstraintSpecificationContext;
+import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.CommentContext;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.AlterDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.CreateDefinitionSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.ColumnDefinitionSegment;
@@ -157,6 +158,7 @@ import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterTablespaceStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterTextSearchStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterViewStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCommentStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateConversionStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateDatabaseStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateDomainStatement;
@@ -862,4 +864,9 @@ public final class PostgreSQLDDLStatementSQLVisitor extends PostgreSQLStatementS
     public ASTNode visitDropType(final DropTypeContext ctx) {
         return new PostgreSQLDropTypeStatement();
     }
+    
+    @Override
+    public ASTNode visitComment(final CommentContext ctx) {
+        return new PostgreSQLCommentStatement();
+    }
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/CommentStatement.java
similarity index 52%
copy from shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
copy to shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/CommentStatement.java
index 8f7f7bfcab9..84fdf872a32 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/CommentStatement.java
@@ -15,29 +15,14 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl;
+package org.apache.shardingsphere.sql.parser.sql.common.statement.ddl;
 
-import lombok.Getter;
-import lombok.Setter;
 import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndextypeSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
-import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.OracleStatement;
 
 /**
- * Oracle comment statement.
+ * Comment statement.
  */
-@Getter
-@Setter
 @ToString
-public final class OracleCommentStatement extends AbstractSQLStatement implements DDLStatement, OracleStatement {
-
-    private SimpleTableSegment table;
-
-    private ColumnSegment column;
-
-    private IndextypeSegment indextype;
+public abstract class CommentStatement extends AbstractSQLStatement implements DDLStatement {
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/opengauss/ddl/OpenGaussCommentStatement.java
similarity index 58%
copy from shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
copy to shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/opengauss/ddl/OpenGaussCommentStatement.java
index 8f7f7bfcab9..4dd5f9b683e 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/opengauss/ddl/OpenGaussCommentStatement.java
@@ -15,29 +15,15 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl;
+package org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl;
 
-import lombok.Getter;
-import lombok.Setter;
 import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndextypeSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
-import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.OracleStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CommentStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.OpenGaussStatement;
 
 /**
- * Oracle comment statement.
+ * OpenGauss comment statement.
  */
-@Getter
-@Setter
 @ToString
-public final class OracleCommentStatement extends AbstractSQLStatement implements DDLStatement, OracleStatement {
-
-    private SimpleTableSegment table;
-
-    private ColumnSegment column;
-
-    private IndextypeSegment indextype;
+public final class OpenGaussCommentStatement extends CommentStatement implements OpenGaussStatement {
 }
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
index 8f7f7bfcab9..9cb52e101d0 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
@@ -23,8 +23,7 @@ import lombok.ToString;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndextypeSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
 import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CommentStatement;
 import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.OracleStatement;
 
 /**
@@ -33,7 +32,7 @@ import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.OracleS
 @Getter
 @Setter
 @ToString
-public final class OracleCommentStatement extends AbstractSQLStatement implements DDLStatement, OracleStatement {
+public final class OracleCommentStatement extends CommentStatement implements OracleStatement {
 
     private SimpleTableSegment table;
 
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLCommentStatement.java
similarity index 58%
copy from shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
copy to shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLCommentStatement.java
index 8f7f7bfcab9..e7ce18ab0e7 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/ddl/OracleCommentStatement.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/postgresql/ddl/PostgreSQLCommentStatement.java
@@ -15,29 +15,15 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl;
+package org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl;
 
-import lombok.Getter;
-import lombok.Setter;
 import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndextypeSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
-import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
-import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.OracleStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CommentStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.PostgreSQLStatement;
 
 /**
- * Oracle comment statement.
+ * PostgreSQL comment statement.
  */
-@Getter
-@Setter
 @ToString
-public final class OracleCommentStatement extends AbstractSQLStatement implements DDLStatement, OracleStatement {
-
-    private SimpleTableSegment table;
-
-    private ColumnSegment column;
-
-    private IndextypeSegment indextype;
+public final class PostgreSQLCommentStatement extends CommentStatement implements PostgreSQLStatement {
 }
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/comment.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/comment.xml
index 3a6b009f00b..a7d87301f52 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/comment.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/ddl/comment.xml
@@ -32,4 +32,8 @@
     <comment sql-case-id="comment_on_table" >
         <table name="employee" start-index="17" stop-index="25" />
     </comment>
+    <comment sql-case-id="comment_on_constraint" />
+    <comment sql-case-id="comment_on_domain" />
+    <comment sql-case-id="comment_on_event_trigger" />
+    <comment sql-case-id="comment_on_index" />
 </sql-parser-test-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/comment.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/comment.xml
index 004c9559b0b..be5123c80e6 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/comment.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/ddl/comment.xml
@@ -18,11 +18,15 @@
 
 <sql-cases>
     <sql-case id="comment_on_policy" value="COMMENT ON AUDIT POLICY read_dir_pol IS 'this is a default policy'" db-types="Oracle" />
-    <sql-case id="comment_on_column" value="COMMENT ON COLUMN employees.job_id IS 'abbreviated job title'" db-types="Oracle" />
+    <sql-case id="comment_on_column" value="COMMENT ON COLUMN employees.job_id IS 'abbreviated job title'" db-types="Oracle, PostgreSQL" />
     <sql-case id="comment_on_edition" value="COMMENT ON EDITION editionName IS 'some comments'" db-types="Oracle" />
     <sql-case id="comment_on_indextype" value="COMMENT ON INDEXTYPE indtype IS 'some comments'" db-types="Oracle" />
     <sql-case id="comment_on_view" value="COMMENT ON MATERIALIZED VIEW viewName IS 'some comments'" db-types="Oracle" />
     <sql-case id="comment_on_model" value="COMMENT ON MINING MODEL modelName IS 'some comments'" db-types="Oracle" />
     <sql-case id="comment_on_operator" value="COMMENT ON OPERATOR op IS 'some comments'" db-types="Oracle" />
-    <sql-case id="comment_on_table" value="COMMENT ON TABLE employees IS 'some comments'" db-types="Oracle" />
+    <sql-case id="comment_on_table" value="COMMENT ON TABLE employees IS 'some comments'" db-types="Oracle, PostgreSQL, openGauss" />
+    <sql-case id="comment_on_constraint" value="comment on constraint test_id_name_key on test is &apos;child&apos;;" db-types="PostgreSQL, openGauss"/>
+    <sql-case id="comment_on_domain" value="comment on domain test is &apos;About to drop this..&apos;;" db-types="PostgreSQL, openGauss"/>
+    <sql-case id="comment_on_event_trigger" value="comment on event trigger test_trigger is &apos;test&apos;;" db-types="PostgreSQL, openGauss"/>
+    <sql-case id="comment_on_index" value="comment on index at_partitioned_0_id_name_key is &apos;child&apos;;" db-types="PostgreSQL, openGauss"/>
 </sql-cases>
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml
index 526e635b1bc..2b69f5515fe 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml
+++ b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml
@@ -42,7 +42,6 @@
     <sql-case id="alter_operator" value="ALTER OPERATOR @+@(int4, int4) OWNER TO regress_alter_generic_user2" db-types="PostgreSQL" />
     <sql-case id="create_statistics" value="CREATE STATISTICS alt_stat1 ON a, b FROM alt_regress_1" db-types="PostgreSQL" />
     <sql-case id="alter_statistics" value="ALTER STATISTICS alt_stat1 RENAME TO alt_stat2" db-types="PostgreSQL" />
-    <sql-case id="comment_on_table" value="COMMENT ON TABLE attmp_wrong IS 'table comment';" db-types="PostgreSQL" />
     <sql-case id="alter_view_rename" value="ALTER VIEW attmp_view_new RENAME TO fail" db-types="PostgreSQL" />
     <sql-case id="create_table_no_valid" value="create table nv_parent (d date, check (false) no inherit not valid)" db-types="PostgreSQL" />
     <sql-case id="create_as_select" value="create table attest1 as select * from atacc1" db-types="PostgreSQL" />
@@ -4297,64 +4296,6 @@
     <sql-case id="cluster_by_postgresql_source_test_case16" value="CLUSTER hs2 using hs1_pkey;" db-types="PostgreSQL"/>
     <sql-case id="cluster_by_postgresql_source_test_case17" value="CLUSTER vaccluster;" db-types="PostgreSQL"/>
     <sql-case id="cluster;_by_postgresql_source_test_case1" value="CLUSTER;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case1" value="COMMENT ON AGGREGATE newavg (int4) IS &apos;an agg comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case2" value="COMMENT ON AGGREGATE newavg (int4) IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case3" value="COMMENT ON AGGREGATE newavg_wrong (int4) IS &apos;an agg comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case4" value="COMMENT ON AGGREGATE newcnt (&quot;any&quot;) IS &apos;an agg(any) comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case5" value="COMMENT ON AGGREGATE newcnt (*) IS &apos;an agg(*) comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case6" value="COMMENT ON AGGREGATE nosuchagg (*) IS &apos;should fail&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case7" value="COMMENT ON COLLATION test0 IS &apos;US English&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case8" value="COMMENT ON COLUMN default_test_row.f1 IS &apos;good comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case9" value="COMMENT ON COLUMN default_test_row.f1 IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case10" value="COMMENT ON COLUMN default_test_row.nope IS &apos;bad comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case11" value="COMMENT ON COLUMN ft1.c1 IS &apos;foreign column&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case12" value="COMMENT ON COLUMN ft1.c1 IS &apos;ft1.c1&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case13" value="COMMENT ON COLUMN ft1.c1 IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case14" value="COMMENT ON COLUMN parted_col_comment.a IS &apos;Partition key&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case15" value="COMMENT ON CONSTRAINT constrname ON FKTABLE IS &apos;fk constraint comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case16" value="COMMENT ON CONSTRAINT constrname ON FKTABLE IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case17" value="COMMENT ON CONSTRAINT constrname_wrong ON FKTABLE IS &apos;fk constraint comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case18" value="COMMENT ON CONVERSION myconv IS &apos;bar&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case19" value="COMMENT ON CONVERSION myconv IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case20" value="COMMENT ON CONVERSION myconv_bad IS &apos;foo&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case21" value="COMMENT ON FOREIGN DATA WRAPPER dummy IS &apos;useless&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case22" value="COMMENT ON FOREIGN TABLE ft1 IS &apos;foreign table&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case23" value="COMMENT ON FOREIGN TABLE ft1 IS &apos;ft1&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case24" value="COMMENT ON FOREIGN TABLE ft1 IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case25" value="COMMENT ON FUNCTION tg_hub_adjustslots(bpchar, integer, integer) IS &apos;function with args&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case26" value="COMMENT ON FUNCTION tg_hub_adjustslots(bpchar, integer, integer) IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case27" value="COMMENT ON FUNCTION tg_hub_adjustslots_wrong(bpchar, integer, integer) IS &apos;function with args&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case28" value="COMMENT ON INDEX six IS &apos;good index&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case29" value="COMMENT ON INDEX six IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case30" value="COMMENT ON INDEX six_wrong IS &apos;bad index&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case31" value="COMMENT ON INDEX testcomment_idx1 IS &apos;test comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case32" value="COMMENT ON OPERATOR ###### (NONE, int4) IS &apos;bad prefix&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case33" value="COMMENT ON OPERATOR ###### (int4, NONE) IS &apos;bad postfix&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case34" value="COMMENT ON OPERATOR ###### (int4, int8) IS &apos;bad infix&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case35" value="COMMENT ON PUBLICATION testpub_default IS &apos;test publication&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case36" value="COMMENT ON RULE rtest_v1_bad ON rtest_v1 IS &apos;bad rule&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case37" value="COMMENT ON RULE rtest_v1_del ON rtest_v1 IS &apos;delete rule&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case38" value="COMMENT ON RULE rtest_v1_del ON rtest_v1 IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case39" value="COMMENT ON SEQUENCE asdf IS &apos;won&apos;&apos;t work&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case40" value="COMMENT ON SEQUENCE sequence_test2 IS &apos;will work&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case41" value="COMMENT ON SEQUENCE sequence_test2 IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case42" value="COMMENT ON SERVER s1 IS &apos;foreign server&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case43" value="COMMENT ON STATISTICS ab1_a_b_stats IS &apos;changed comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case44" value="COMMENT ON STATISTICS ab1_a_b_stats IS &apos;new comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case45" value="COMMENT ON SUBSCRIPTION regress_testsub IS &apos;test subscription&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case46" value="COMMENT ON TABLE attmp IS &apos;table comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case47" value="COMMENT ON TABLE attmp IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case48" value="COMMENT ON TABLE attmp_wrong IS &apos;table comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case49" value="COMMENT ON TABLE parted_col_comment IS &apos;Am partitioned table&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case50" value="COMMENT ON TRIGGER check_fkeys2_pkey_bad ON fkeys2 IS &apos;wrong&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case51" value="COMMENT ON TRIGGER check_fkeys2_pkey_exist ON fkeys2 IS &apos;right&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case52" value="COMMENT ON TRIGGER check_fkeys2_pkey_exist ON fkeys2 IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case53" value="COMMENT ON TYPE bad IS &apos;bad comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case54" value="COMMENT ON TYPE default_test_row IS &apos;good comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case55" value="COMMENT ON TYPE default_test_row IS NULL;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case56" value="COMMENT ON VIEW noview IS &apos;no view&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case57" value="COMMENT ON VIEW toyemp IS &apos;is a view&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="comment_by_postgresql_source_test_case58" value="COMMENT ON VIEW toyemp IS NULL;" db-types="PostgreSQL"/>
     <sql-case id="copy_by_postgresql_source_test_case1" value="COPY testnull FROM stdin WITH NULL AS E&apos;\\0&apos;;" db-types="PostgreSQL"/>
     <sql-case id="copy_by_postgresql_source_test_case2" value="COPY testnull TO stdout WITH NULL AS E&apos;\\0&apos;;" db-types="PostgreSQL"/>
     <sql-case id="copy_by_postgresql_source_test_case3" value="COPY x from stdin WITH DELIMITER AS &apos;:&apos; NULL AS E&apos;\\X&apos; ENCODING &apos;sql_ascii&apos;;" db-types="PostgreSQL"/>
@@ -7558,18 +7499,6 @@
     <sql-case id="low_alter_by_postgresql_source_test_case113" value="alter view v1 rename column a to x;" db-types="PostgreSQL"/>
     <sql-case id="low_cluster_by_postgresql_source_test_case1" value="cluster clstr_4 using cluster_sort;" db-types="PostgreSQL"/>
     <sql-case id="low_cluster_by_postgresql_source_test_case2" value="cluster clstr_temp using clstr_temp_pkey;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case1" value="comment on column atacc1.&quot;........pg.dropped.1........&quot; is &apos;testing&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case2" value="comment on column atacc1.a is &apos;testing&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case3" value="comment on constraint at_partitioned_0_id_name_key on at_partitioned_0 is &apos;child 0 constraint&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case4" value="comment on constraint at_partitioned_1_id_name_key on at_partitioned_1 is &apos;child 1 constraint&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case5" value="comment on constraint at_partitioned_id_name_key on at_partitioned is &apos;parent constraint&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case6" value="comment on constraint c1 on domain dcomptype is &apos;random commentary&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case7" value="comment on domain domaindroptest is &apos;About to drop this..&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case8" value="comment on event trigger regress_event_trigger is &apos;test comment&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case9" value="comment on index at_partitioned_0_id_name_key is &apos;child 0 index&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case10" value="comment on index at_partitioned_1_id_name_key is &apos;child 1 index&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case11" value="comment on index at_partitioned_id_name_key is &apos;parent index&apos;;" db-types="PostgreSQL"/>
-    <sql-case id="low_comment_by_postgresql_source_test_case12" value="comment on table event_trigger_fire1 is &apos;here is a comment&apos;;" db-types="PostgreSQL"/>
     <sql-case id="low_copy_by_postgresql_source_test_case1" value="copy (select * from test1) (t,id) to stdout;" db-types="PostgreSQL"/>
     <sql-case id="low_copy_by_postgresql_source_test_case2" value="copy (select * from test1) from stdin;" db-types="PostgreSQL"/>
     <sql-case id="low_copy_by_postgresql_source_test_case3" value="copy (select 1) to stdout\; copy (select 2) to stdout\; select 0\; select 3;" db-types="PostgreSQL"/>