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 84d327b #6976, fix failure test cases of SQL92 parser test (#6981)
84d327b is described below
commit 84d327b66e1319a8f18343b65af247e651356973
Author: Zhang Yonglun <[email protected]>
AuthorDate: Fri Aug 21 21:51:35 2020 +0800
#6976, fix failure test cases of SQL92 parser test (#6981)
* #6976, fix failure test cases of SQL92 parser test
* #6976, fix create_table_with_out_of_line_check
* #6976, fix select_distinct_function
* #6976, fix insert_on_duplicate_key_update_with_placeholders,
update_with_case_when, update_with_where_calculation
---
.../src/main/antlr4/imports/sql92/DDLStatement.g4 | 6 +--
.../sql/parser/sql92/visitor/SQL92Visitor.java | 48 ++++++++++++++--------
.../parser/sql92/visitor/impl/SQL92DDLVisitor.java | 9 ++++
.../jaxb/sql/loader/SQLCasesLoader.java | 2 +-
.../resources/sql/supported/dcl/create-user.xml | 4 +-
.../main/resources/sql/supported/ddl/create.xml | 6 +--
.../main/resources/sql/supported/ddl/truncate.xml | 2 +-
.../sql/supported/dml/select-distinct.xml | 2 +-
8 files changed, 52 insertions(+), 27 deletions(-)
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DDLStatement.g4
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DDLStatement.g4
index d1b50df..f422fb3 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DDLStatement.g4
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/antlr4/imports/sql92/DDLStatement.g4
@@ -62,7 +62,7 @@ createDatabaseSpecification_
;
createDefinition
- : columnDefinition | constraintDefinition | checkConstraintDefinition_
+ : columnDefinition | constraintDefinition | checkConstraintDefinition
;
columnDefinition
@@ -74,13 +74,13 @@ dataTypeOption
| UNIQUE KEY?
| NOT? NULL
| collateClause_
- | checkConstraintDefinition_
+ | checkConstraintDefinition
| referenceDefinition
| DEFAULT (literals | expr)
| STRING_
;
-checkConstraintDefinition_
+checkConstraintDefinition
: (CONSTRAINT ignoredIdentifier_?)? CHECK expr
;
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/SQL92Visitor.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/SQL92Visitor.java
index 3fadcf4..1ea6e40 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/SQL92Visitor.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/SQL92Visitor.java
@@ -25,6 +25,7 @@ import org.antlr.v4.runtime.misc.Interval;
import org.antlr.v4.runtime.tree.TerminalNode;
import org.apache.shardingsphere.sql.parser.api.ASTNode;
import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementBaseVisitor;
+import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.IntervalExpressionContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AggregationFunctionContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.BitExprContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.BitValueLiteralsContext;
@@ -60,7 +61,6 @@ import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.Unreser
import org.apache.shardingsphere.sql.parser.sql.constant.AggregationType;
import org.apache.shardingsphere.sql.parser.sql.constant.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.predicate.PredicateBuilder;
-import org.apache.shardingsphere.sql.parser.sql.segment.SQLSegment;
import
org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
import
org.apache.shardingsphere.sql.parser.sql.segment.dml.expr.ExpressionSegment;
import
org.apache.shardingsphere.sql.parser.sql.segment.dml.expr.complex.CommonExpressionSegment;
@@ -248,7 +248,8 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
return new SubquerySegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), (SelectStatement) visit(ctx.subquery()));
}
//TODO deal with IS NOT? (TRUE | FALSE | UNKNOWN | NULL)
- return new CommonExpressionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
+ String text = ctx.start.getInputStream().getText(new
Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
+ return new CommonExpressionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), text);
}
private ASTNode createCompareSegment(final BooleanPrimaryContext ctx) {
@@ -262,19 +263,20 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
private ASTNode createPredicateRightValue(final BooleanPrimaryContext ctx)
{
if (null != ctx.subquery()) {
- new SubquerySegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), (SelectStatement) visit(ctx.subquery()));
+ return new SubquerySegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), (SelectStatement) visit(ctx.subquery()));
}
- SQLSegment rightValue = (SQLSegment) visit(ctx.predicate());
+ ASTNode rightValue = visit(ctx.predicate());
return createPredicateRightValue(ctx, rightValue);
}
- private ASTNode createPredicateRightValue(final BooleanPrimaryContext ctx,
final SQLSegment rightValue) {
+ private ASTNode createPredicateRightValue(final BooleanPrimaryContext ctx,
final ASTNode rightValue) {
if (rightValue instanceof ColumnSegment) {
return rightValue;
}
- return rightValue instanceof SubquerySegment ? new
PredicateCompareRightValue(((SubquerySegment) rightValue).getStartIndex(),
((SubquerySegment) rightValue).getStopIndex(),
+ return rightValue instanceof SubquerySegment ? new
PredicateCompareRightValue(ctx.subquery().start.getStartIndex(),
ctx.subquery().stop.getStopIndex(),
ctx.comparisonOperator().getText(), new
SubqueryExpressionSegment((SubquerySegment) rightValue))
- : new PredicateCompareRightValue(rightValue.getStartIndex(),
rightValue.getStopIndex(), ctx.comparisonOperator().getText(),
(ExpressionSegment) rightValue);
+ : new
PredicateCompareRightValue(ctx.predicate().start.getStartIndex(),
ctx.predicate().stop.getStopIndex(), ctx.comparisonOperator().getText(),
+ (ExpressionSegment) rightValue);
}
@Override
@@ -293,8 +295,10 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
private PredicateSegment createInSegment(final PredicateContext ctx) {
ColumnSegment column = (ColumnSegment) visit(ctx.bitExpr(0));
- return new PredicateSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), column, new
PredicateInRightValue(ctx.LP_().getSymbol().getStartIndex(),
- ctx.RP_().getSymbol().getStopIndex(),
getExpressionSegments(ctx)));
+ PredicateInRightValue predicateInRightValue = null != ctx.subquery() ?
new PredicateInRightValue(ctx.subquery().start.getStartIndex(),
ctx.subquery().stop.getStopIndex(),
+ getExpressionSegments(ctx))
+ : new
PredicateInRightValue(ctx.LP_().getSymbol().getStartIndex(),
ctx.RP_().getSymbol().getStopIndex(), getExpressionSegments(ctx));
+ return new PredicateSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), column, predicateInRightValue);
}
private Collection<ExpressionSegment> getExpressionSegments(final
PredicateContext ctx) {
@@ -330,7 +334,8 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
if (null != ctx.predicate()) {
visit(ctx.predicate());
}
- return new CommonExpressionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
+ String text = ctx.start.getInputStream().getText(new
Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
+ return new CommonExpressionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), text);
}
@Override
@@ -339,7 +344,8 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
return createExpressionSegment(visit(ctx.simpleExpr()), ctx);
}
visitRemainBitExpr(ctx);
- return new CommonExpressionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
+ String text = ctx.start.getInputStream().getText(new
Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
+ return new CommonExpressionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), text);
}
private ASTNode createExpressionSegment(final ASTNode astNode, final
ParserRuleContext context) {
@@ -359,7 +365,7 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
return new SubqueryExpressionSegment((SubquerySegment) astNode);
}
if (astNode instanceof OtherLiteralValue) {
- return new
CommonExpressionSegment(context.getStart().getStartIndex(),
context.getStop().getStopIndex(), context.getText());
+ return new
CommonExpressionSegment(context.getStart().getStartIndex(),
context.getStop().getStopIndex(), ((OtherLiteralValue) astNode).getValue());
}
return astNode;
}
@@ -390,6 +396,12 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
}
return new CommonExpressionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
}
+
+ @Override
+ public final ASTNode visitIntervalExpression(final
IntervalExpressionContext ctx) {
+ calculateParameterCount(Collections.singleton(ctx.expr()));
+ return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
+ }
@Override
public final ASTNode visitFunctionCall(final FunctionCallContext ctx) {
@@ -408,8 +420,9 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
@Override
public final ASTNode visitAggregationFunction(final
AggregationFunctionContext ctx) {
String aggregationType = ctx.aggregationFunctionName().getText();
+ String text = ctx.start.getInputStream().getText(new
Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
return AggregationType.isAggregationType(aggregationType)
- ? createAggregationSegment(ctx, aggregationType) : new
ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
+ ? createAggregationSegment(ctx, aggregationType) : new
ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), text);
}
private ASTNode createAggregationSegment(final AggregationFunctionContext
ctx, final String aggregationType) {
@@ -434,19 +447,22 @@ public abstract class SQL92Visitor extends
SQL92StatementBaseVisitor<ASTNode> {
if (null != ctx.castFunction()) {
return visit(ctx.castFunction());
}
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
+ String text = ctx.start.getInputStream().getText(new
Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
+ return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), text);
}
@Override
public final ASTNode visitCastFunction(final CastFunctionContext ctx) {
calculateParameterCount(Collections.singleton(ctx.expr()));
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
+ String text = ctx.start.getInputStream().getText(new
Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
+ return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), text);
}
@Override
public final ASTNode visitRegularFunction(final RegularFunctionContext
ctx) {
calculateParameterCount(ctx.expr());
- return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), ctx.getText());
+ String text = ctx.start.getInputStream().getText(new
Interval(ctx.start.getStartIndex(), ctx.stop.getStopIndex()));
+ return new ExpressionProjectionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex(), text);
}
@Override
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/impl/SQL92DDLVisitor.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/impl/SQL92DDLVisitor.java
index 29a8de7..5c3b7af 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/impl/SQL92DDLVisitor.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/impl/SQL92DDLVisitor.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.sql.parser.sql92.visitor.impl;
import org.apache.shardingsphere.sql.parser.api.ASTNode;
import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
+import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.CheckConstraintDefinitionContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AddColumnSpecificationContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AlterDefinitionClauseContext;
import
org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.AlterTableContext;
@@ -81,6 +82,9 @@ public final class SQL92DDLVisitor extends SQL92Visitor
implements DDLVisitor {
if (null != each.constraintDefinition()) {
result.getValue().add((ConstraintDefinitionSegment)
visit(each.constraintDefinition()));
}
+ if (null != each.checkConstraintDefinition()) {
+ result.getValue().add((ConstraintDefinitionSegment)
visit(each.checkConstraintDefinition()));
+ }
}
return result;
}
@@ -100,6 +104,11 @@ public final class SQL92DDLVisitor extends SQL92Visitor
implements DDLVisitor {
return result;
}
+ @Override
+ public ASTNode visitCheckConstraintDefinition(final
CheckConstraintDefinitionContext ctx) {
+ return new ConstraintDefinitionSegment(ctx.getStart().getStartIndex(),
ctx.getStop().getStopIndex());
+ }
+
private boolean isPrimaryKey(final ColumnDefinitionContext ctx) {
for (DataTypeOptionContext each : ctx.dataTypeOption()) {
if (null != each.primaryKey()) {
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java
index de3a76e..7470229 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java
@@ -161,7 +161,7 @@ public final class SQLCasesLoader {
}
private static Collection<String> getALlDatabaseTypes() {
- return Arrays.asList("H2", "MySQL", "PostgreSQL", "Oracle",
"SQLServer");
+ return Arrays.asList("H2", "MySQL", "PostgreSQL", "Oracle",
"SQLServer", "SQL92");
}
/**
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dcl/create-user.xml
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dcl/create-user.xml
index b5080c4..48b3ca6 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dcl/create-user.xml
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dcl/create-user.xml
@@ -37,10 +37,10 @@
<sql-case id="create_user_with_options" value="CREATE USER user1 DEFAULT
ROLE role1 MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 1 PASSWORD EXPIRE
DEFAULT PASSWORD HISTORY DEFAULT ACCOUNT LOCK" db-types="MySQL" />
<sql-case id="create_external_user" value="CREATE USER user1 IDENTIFIED
EXTERNALLY" db-types="Oracle" />
<sql-case id="create_global_user" value="CREATE USER user1 IDENTIFIED
GLOBALLY" db-types="Oracle" />
- <sql-case id="create_user_with_password" value="CREATE USER user1
IDENTIFIED BY RANDOM password default role role1" />
+ <sql-case id="create_user_with_password" value="CREATE USER user1
IDENTIFIED BY RANDOM password default role role1"
db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
<sql-case id="create_user_with_tablespace" value="CREATE USER user1
IDENTIFIED BY password DEFAULT TABLESPACE tablespace1" db-types="Oracle" />
<sql-case id="create_user_with_quota_option" value="CREATE USER user1
IDENTIFIED BY password QUOTA 1M ON tablespace1" db-types="Oracle" />
- <sql-case id="create_user_with_password_expire_lock" value="CREATE USER
user1 IDENTIFIED BY RANDOM password default role role1 PASSWORD EXPIRE ACCOUNT
LOCK" />
+ <sql-case id="create_user_with_password_expire_lock" value="CREATE USER
user1 IDENTIFIED BY RANDOM password default role role1 PASSWORD EXPIRE ACCOUNT
LOCK" db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
<sql-case id="create_user_only_with_name" value="CREATE USER user1"
db-types="PostgreSQL,SQLServer" />
<sql-case id="create_user_with_password_postgresql" value="CREATE USER
user1 WITH ENCRYPTED PASSWORD 'password'" db-types="PostgreSQL" />
<sql-case id="create_user_with_option_postgresql" value="CREATE USER user1
WITH SUPERUSER" db-types="PostgreSQL" />
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create.xml
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create.xml
index c8ad26e..8099633 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create.xml
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/create.xml
@@ -24,8 +24,8 @@
<sql-case id="create_global_temporary_table" value="CREATE GLOBAL
TEMPORARY TABLE t_temp_log(id int, status varchar(10))"
db-types="Oracle,PostgreSQL" />
<sql-case id="create_local_temp_table" value="CREATE LOCAL TEMP TABLE
t_temp_log(id int, status varchar(10))" db-types="PostgreSQL" />
<sql-case id="create_unlogged_table" value="CREATE UNLOGGED TABLE t_log(id
int, status varchar(10))" db-types="PostgreSQL" />
- <sql-case id="create_index" value="CREATE INDEX t_log_index ON t_log (id)"
/>
- <sql-case id="create_unique_index" value="CREATE UNIQUE INDEX t_log_index
ON t_log (id)" />
+ <sql-case id="create_index" value="CREATE INDEX t_log_index ON t_log (id)"
db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
+ <sql-case id="create_unique_index" value="CREATE UNIQUE INDEX t_log_index
ON t_log (id)" db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
<sql-case id="create_table_with_space" value=" CREATE TABLE
t_order_item (
item_id INT,
@@ -72,7 +72,7 @@
ON
t_order (order_id) " db-types="MySQL,SQLServer" />
<sql-case id="create_index_with_back_quota" value="CREATE INDEX
`order_index` ON `t_order` (`order_id`)" db-types="MySQL" />
- <sql-case id="create_composite_index" value="CREATE INDEX order_index ON
t_order (order_id, user_id, status)" />
+ <sql-case id="create_composite_index" value="CREATE INDEX order_index ON
t_order (order_id, user_id, status)"
db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
<sql-case id="create_btree_index" value="CREATE INDEX order_index ON
t_order USING BTREE (order_id)" db-types="PostgreSQL" />
<sql-case id="create_table_with_quota" value="CREATE TABLE
"t_order" ("order_id" NUMBER(10), "user_id"
NUMBER(10), "status" VARCHAR2(10), "column1" VARCHAR2(10),
"column2" VARCHAR2(10), "column3" VARCHAR2(10))"
db-types="Oracle" />
<sql-case id="create_table_with_column_on_null_default" value="CREATE
TABLE t_order (order_id NUMBER(10) DEFAULT ON NULL 0, user_id NUMBER(10),
status VARCHAR2(10), column1 VARCHAR2(10), column2 VARCHAR2(10), column3
VARCHAR2(10))" db-types="Oracle" />
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/truncate.xml
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/truncate.xml
index 94a4a45..ff878cd 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/truncate.xml
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/ddl/truncate.xml
@@ -17,7 +17,7 @@
-->
<sql-cases>
- <sql-case id="truncate_table" value="TRUNCATE TABLE t_log" />
+ <sql-case id="truncate_table" value="TRUNCATE TABLE t_log"
db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
<sql-case id="truncate_table_only" value="TRUNCATE TABLE ONLY t_log"
db-types="PostgreSQL" />
<sql-case id="truncate_table_with_space" value=" TRUNCATE TABLE
t_order " db-types="MySQL" />
diff --git
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dml/select-distinct.xml
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dml/select-distinct.xml
index 4f419fa..fe09dd6 100644
---
a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dml/select-distinct.xml
+++
b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/supported/dml/select-distinct.xml
@@ -38,7 +38,7 @@
<sql-case id="select_distinct_with_count_sum" value="SELECT COUNT(DISTINCT
order_id), SUM(DISTINCT order_id) FROM t_order WHERE order_id < 1100"
db-types="MySQL" />
<sql-case id="select_distinct_with_single_count_group_by" value="SELECT
order_id, COUNT(DISTINCT order_id) c FROM t_order WHERE order_id < 1100
GROUP BY order_id ORDER BY order_id" />
<sql-case id="select_distinct_with_count_group_by" value="SELECT
COUNT(DISTINCT order_id) c, order_id FROM t_order GROUP BY order_id ORDER BY
order_id" />
- <sql-case id="select_distinct_function" value="SELECT DISTINCT(item_id)
FROM t_order_item ORDER BY item_id" />
+ <sql-case id="select_distinct_function" value="SELECT DISTINCT(item_id)
FROM t_order_item ORDER BY item_id"
db-types="H2,MySQL,PostgreSQL,Oracle,SQLServer" />
<sql-case id="select_distinct_with_count_calculation" value="SELECT
COUNT(DISTINCT user_id + order_id) c FROM t_order WHERE order_id < 1100" />
<sql-case id="select_distinct_with_aggregation_functions" value="SELECT
SUM(DISTINCT order_id),count(DISTINCT order_id),count(order_id) FROM t_order
WHERE order_id < 1100" />
</sql-cases>