You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2020/08/03 07:52:37 UTC
[shardingsphere] branch master updated: Fix test (#6509)
This is an automated email from the ASF dual-hosted git repository.
panjuan 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 44c28e5 Fix test (#6509)
44c28e5 is described below
commit 44c28e51739a3bad610d517baeca448d8fe8fd7c
Author: JingShang Lu <ji...@gmail.com>
AuthorDate: Mon Aug 3 15:52:24 2020 +0800
Fix test (#6509)
* fix sql parser test case
* fix
* fix
* fix ConstraintDefinition assert
* fix
* delete indexs from CreateTableStatement
* fix
* fix
---
.../statement/ddl/CreateTableStatementContext.java | 13 +++--
.../parser/mysql/visitor/impl/MySQLDDLVisitor.java | 31 ++++++++++--
.../constraint/ConstraintDefinitionSegment.java | 5 ++
.../sql/statement/ddl/CreateTableStatement.java | 2 -
.../definition/ConstraintDefinitionAssert.java | 15 ++++++
.../ddl/impl/CreateTableStatementAssert.java | 12 -----
.../engine/SQLParserParameterizedTest.java | 33 +-----------
.../definition/ExpectedConstraintDefinition.java | 7 +++
.../ddl/CreateTableStatementTestCase.java | 4 --
.../src/test/resources/case/ddl/alter-table.xml | 23 ++++++---
.../src/test/resources/case/ddl/create-table.xml | 58 +++++++++++++---------
.../src/test/resources/case/dml/insert.xml | 53 --------------------
.../src/test/resources/sql/supported/ddl/alter.xml | 9 ++--
.../test/resources/sql/supported/ddl/create.xml | 9 ++--
.../test/resources/sql/supported/dml/insert.xml | 3 +-
15 files changed, 132 insertions(+), 145 deletions(-)
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/statement/ddl/CreateTableStatementContext.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/statement/ddl/CreateTableStatementContext.java
index 688ceb9..dd28bc2 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/statement/ddl/CreateTableStatementContext.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/statement/ddl/CreateTableStatementContext.java
@@ -18,15 +18,15 @@
package org.apache.shardingsphere.sql.parser.binder.statement.ddl;
import lombok.Getter;
-import org.apache.shardingsphere.sql.parser.binder.type.TableAvailable;
import org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext;
import org.apache.shardingsphere.sql.parser.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.binder.type.IndexAvailable;
+import org.apache.shardingsphere.sql.parser.binder.type.TableAvailable;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.ColumnDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.constraint.ConstraintDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.CreateTableStatement;
-import org.apache.shardingsphere.sql.parser.binder.type.IndexAvailable;
import java.util.Collection;
import java.util.LinkedList;
@@ -61,6 +61,13 @@ public final class CreateTableStatementContext extends CommonSQLStatementContext
@Override
public Collection<IndexSegment> getIndexes() {
- return getSqlStatement().getIndexes();
+ LinkedList<IndexSegment> result = new LinkedList<>();
+ Collection<ConstraintDefinitionSegment> constraintDefinitions = getSqlStatement().getConstraintDefinitions();
+ for (ConstraintDefinitionSegment each : constraintDefinitions) {
+ if (null != each.getIndexName()) {
+ result.add(each.getIndexName());
+ }
+ }
+ return result;
}
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java
index d232a8e..bb67db9 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java
@@ -21,8 +21,6 @@ import com.google.common.base.Preconditions;
import org.antlr.v4.runtime.Token;
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.MySQLStatementParser.KeyPart_Context;
-import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.KeyParts_Context;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AddColumnSpecificationContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterDefinitionClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterSpecificationContext;
@@ -47,6 +45,9 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropVie
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.FirstOrAfterColumnContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.ForeignKeyOptionContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.GeneratedOptionContext;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.IndexDefinition_Context;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.KeyPart_Context;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.KeyParts_Context;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.ModifyColumnSpecificationContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.ReferenceDefinitionContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.RenameColumnSpecificationContext;
@@ -66,6 +67,7 @@ import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.position.Colu
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.position.ColumnPositionSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.constraint.ConstraintDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.constraint.DropPrimaryKeySegment;
+import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.DataTypeSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
@@ -81,6 +83,7 @@ import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DropViewStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.RenameTableStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.TruncateStatement;
import org.apache.shardingsphere.sql.parser.sql.value.collection.CollectionValue;
+import org.apache.shardingsphere.sql.parser.sql.value.identifier.IdentifierValue;
import java.util.Collection;
import java.util.Collections;
@@ -147,6 +150,20 @@ public final class MySQLDDLVisitor extends MySQLVisitor implements DDLVisitor {
if (null != each.checkConstraintDefinition()) {
result.getValue().add((ConstraintDefinitionSegment) visit(each.checkConstraintDefinition()));
}
+ if (null != each.indexDefinition_()) {
+ result.getValue().add((ConstraintDefinitionSegment) visit(each.indexDefinition_()));
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public ASTNode visitIndexDefinition_(final IndexDefinition_Context ctx) {
+ ConstraintDefinitionSegment result = new ConstraintDefinitionSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex());
+ CollectionValue<ColumnSegment> columnSegments = (CollectionValue<ColumnSegment>) visit(ctx.keyParts_());
+ result.getIndexColumns().addAll(columnSegments.getValue());
+ if (null != ctx.indexName()) {
+ result.setIndexName((IndexSegment) visit(ctx.indexName()));
}
return result;
}
@@ -273,7 +290,15 @@ public final class MySQLDDLVisitor extends MySQLVisitor implements DDLVisitor {
result.getPrimaryKeyColumns().addAll(((CollectionValue<ColumnSegment>) visit(ctx.primaryKeyOption().keyParts_())).getValue());
}
if (null != ctx.foreignKeyOption()) {
- result.setReferencedTable((SimpleTableSegment) visit(ctx.foreignKeyOption().referenceDefinition()));
+ result.setReferencedTable((SimpleTableSegment) visit(ctx.foreignKeyOption()));
+ }
+ if (null != ctx.uniqueOption_()) {
+ CollectionValue<ColumnSegment> columnSegments = (CollectionValue<ColumnSegment>) visit(ctx.uniqueOption_().keyParts_());
+ result.getIndexColumns().addAll(columnSegments.getValue());
+ if (null != ctx.uniqueOption_().indexName()) {
+ result.setIndexName(new IndexSegment(ctx.uniqueOption_().indexName().start.getStartIndex(), ctx.uniqueOption_().indexName().stop.getStopIndex(),
+ (IdentifierValue) visit(ctx.uniqueOption_().indexName())));
+ }
}
return result;
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/ddl/constraint/ConstraintDefinitionSegment.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/ddl/constraint/ConstraintDefinitionSegment.java
index a3f391c..d21a0d8 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/ddl/constraint/ConstraintDefinitionSegment.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/segment/ddl/constraint/ConstraintDefinitionSegment.java
@@ -22,6 +22,7 @@ import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.AlterDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.CreateDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
@@ -43,6 +44,10 @@ public final class ConstraintDefinitionSegment implements CreateDefinitionSegmen
private final Collection<ColumnSegment> primaryKeyColumns = new LinkedList<>();
+ private final Collection<ColumnSegment> indexColumns = new LinkedList<>();
+
+ private IndexSegment indexName;
+
private SimpleTableSegment referencedTable;
/**
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/CreateTableStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/CreateTableStatement.java
index 2cb6127..19f8f13 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/CreateTableStatement.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/CreateTableStatement.java
@@ -21,7 +21,6 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.ColumnDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.constraint.ConstraintDefinitionSegment;
-import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
import java.util.Collection;
@@ -40,5 +39,4 @@ public final class CreateTableStatement extends DDLStatement {
private final Collection<ConstraintDefinitionSegment> constraintDefinitions = new LinkedList<>();
- private final Collection<IndexSegment> indexes = new LinkedList<>();
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/segment/definition/ConstraintDefinitionAssert.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/segment/definition/ConstraintDefinitionAssert.java
index 44f4ca3..d5d4a62 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/segment/definition/ConstraintDefinitionAssert.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/segment/definition/ConstraintDefinitionAssert.java
@@ -28,6 +28,8 @@ import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
@@ -50,6 +52,19 @@ public final class ConstraintDefinitionAssert {
ColumnAssert.assertIs(assertContext, each, expected.getPrimaryKeyColumns().get(count));
count++;
}
+ assertThat(assertContext.getText("Constraint definition index column size assertion error: "), actual.getIndexColumns().size(), is(expected.getIndexColumns().size()));
+ int indexCount = 0;
+ for (ColumnSegment each : actual.getIndexColumns()) {
+ ColumnAssert.assertIs(assertContext, each, expected.getIndexColumns().get(indexCount));
+ indexCount++;
+ }
+ if (null != expected.getIndexName()) {
+ assertNotNull(assertContext.getText("Actual index name should exist."), actual.getIndexName());
+ assertThat(assertContext.getText("Actual index name assertion error."), actual.getIndexName().getIdentifier().getValue(), is(expected.getIndexName()));
+ } else {
+ assertNull(assertContext.getText("Actual index name should not exist."), actual.getIndexName());
+ }
+
if (null != expected.getReferencedTable()) {
assertTrue(assertContext.getText("Actual referenced table should exist."), actual.getReferencedTable().isPresent());
TableAssert.assertIs(assertContext, actual.getReferencedTable().get(), expected.getReferencedTable());
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/statement/ddl/impl/CreateTableStatementAssert.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/statement/ddl/impl/CreateTableStatementAssert.java
index 0b1e476..f38f750 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/statement/ddl/impl/CreateTableStatementAssert.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/statement/ddl/impl/CreateTableStatementAssert.java
@@ -22,12 +22,10 @@ import lombok.NoArgsConstructor;
import org.apache.shardingsphere.sql.parser.integrate.asserts.SQLCaseAssertContext;
import org.apache.shardingsphere.sql.parser.integrate.asserts.segment.definition.ColumnDefinitionAssert;
import org.apache.shardingsphere.sql.parser.integrate.asserts.segment.definition.ConstraintDefinitionAssert;
-import org.apache.shardingsphere.sql.parser.integrate.asserts.segment.index.IndexAssert;
import org.apache.shardingsphere.sql.parser.integrate.asserts.segment.table.TableAssert;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.statement.ddl.CreateTableStatementTestCase;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.column.ColumnDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.ddl.constraint.ConstraintDefinitionSegment;
-import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.CreateTableStatement;
import static org.hamcrest.CoreMatchers.is;
@@ -50,7 +48,6 @@ public final class CreateTableStatementAssert {
assertTable(assertContext, actual, expected);
assertColumnDefinitions(assertContext, actual, expected);
assertConstraintDefinitions(assertContext, actual, expected);
- assertIndexes(assertContext, actual, expected);
}
private static void assertTable(final SQLCaseAssertContext assertContext, final CreateTableStatement actual, final CreateTableStatementTestCase expected) {
@@ -74,13 +71,4 @@ public final class CreateTableStatementAssert {
count++;
}
}
-
- private static void assertIndexes(final SQLCaseAssertContext assertContext, final CreateTableStatement actual, final CreateTableStatementTestCase expected) {
- assertThat(assertContext.getText("Index size assertion error: "), actual.getIndexes().size(), is(expected.getIndexes().size()));
- int count = 0;
- for (IndexSegment each : actual.getIndexes()) {
- IndexAssert.assertIs(assertContext, each, expected.getIndexes().get(count));
- count++;
- }
- }
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/engine/SQLParserParameterizedTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/engine/SQLParserParameterizedTest.java
index ccacb9f..7073938 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/engine/SQLParserParameterizedTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/engine/SQLParserParameterizedTest.java
@@ -58,7 +58,7 @@ public final class SQLParserParameterizedTest {
@Parameters(name = "{0} ({2}) -> {1}")
public static Collection<Object[]> getTestParameters() {
// TODO resume me after all test cases passed
-// checkTestCases();
+ checkTestCases();
return getSQLTestParameters();
}
@@ -73,8 +73,7 @@ public final class SQLParserParameterizedTest {
private static Collection<Object[]> getSQLTestParameters() {
Collection<Object[]> result = new LinkedList<>();
// TODO resume me after all test cases passed
-// for (Object[] each : SQL_CASES_LOADER.getSQLTestParameters()) {
- for (Object[] each : getSQLTestParameters(SQL_CASES_LOADER.getSQLTestParameters())) {
+ for (Object[] each : SQL_CASES_LOADER.getSQLTestParameters()) {
if (!isPlaceholderWithoutParameter(each)) {
result.add(each);
}
@@ -82,34 +81,6 @@ public final class SQLParserParameterizedTest {
return result;
}
- // TODO remove me after all test cases passed
- private static Collection<Object[]> getSQLTestParameters(final Collection<Object[]> sqlTestParameters) {
- Collection<Object[]> result = new LinkedList<>();
- for (Object[] each : sqlTestParameters) {
- if (!isPassedSqlCase(each[0].toString())) {
- result.add(each);
- }
- }
- return result;
- }
-
- private static boolean isPassedSqlCase(final String sqlCaseId) {
- Collection<String> sqlCases = new LinkedList<>();
- sqlCases.add("show_index_with_indexes_with_table_and_database");
- sqlCases.add("show_index_with_database_back_quotes");
- sqlCases.add("show_index_with_table_back_quotes");
- // TODO Alter statement needs new segment
- sqlCases.add("alter_table_add_foreign_key");
- sqlCases.add("alter_table_add_primary_foreign_key");
- sqlCases.add("alter_table_add_constraints_sqlserver");
- // TODO cannot parse create index behind pk in create table statement, and new segment is necessary
- sqlCases.add("create_table_with_create_index");
- sqlCases.add("create_table_with_exist_index");
- // TODO cannot support insert all
- sqlCases.add("insert_all_with_all_placeholders");
- return sqlCases.contains(sqlCaseId);
- }
-
private static boolean isPlaceholderWithoutParameter(final Object[] sqlTestParameter) {
return SQLCaseType.Placeholder == sqlTestParameter[2] && SQL_PARSER_TEST_CASES_REGISTRY.get(sqlTestParameter[0].toString()).getParameters().isEmpty();
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/segment/impl/definition/ExpectedConstraintDefinition.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/segment/impl/definition/ExpectedConstraintDefinition.java
index 5f8c39a..3895132 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/segment/impl/definition/ExpectedConstraintDefinition.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/segment/impl/definition/ExpectedConstraintDefinition.java
@@ -23,6 +23,7 @@ import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.segment.
import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.segment.impl.column.ExpectedColumn;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.segment.impl.table.ExpectedSimpleTable;
+import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import java.util.LinkedList;
import java.util.List;
@@ -39,4 +40,10 @@ public final class ExpectedConstraintDefinition extends AbstractExpectedSQLSegme
@XmlElement(name = "primary-key-column")
private List<ExpectedColumn> primaryKeyColumns = new LinkedList<>();
+
+ @XmlElement(name = "index-column")
+ private List<ExpectedColumn> indexColumns = new LinkedList<>();
+
+ @XmlAttribute(name = "index-name")
+ private String indexName;
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/statement/ddl/CreateTableStatementTestCase.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/statement/ddl/CreateTableStatementTestCase.java
index c8e4778..4a4bd0a 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/statement/ddl/CreateTableStatementTestCase.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/jaxb/cases/domain/statement/ddl/CreateTableStatementTestCase.java
@@ -21,7 +21,6 @@ import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.segment.impl.definition.ExpectedColumnDefinition;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.segment.impl.definition.ExpectedConstraintDefinition;
-import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.segment.impl.index.ExpectedIndex;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.segment.impl.table.ExpectedSimpleTable;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.cases.domain.statement.SQLParserTestCase;
@@ -44,7 +43,4 @@ public final class CreateTableStatementTestCase extends SQLParserTestCase {
@XmlElement(name = "constraint-definition")
private final List<ExpectedConstraintDefinition> constraintDefinitions = new LinkedList<>();
-
- @XmlElement(name = "index")
- private final List<ExpectedIndex> indexes = new LinkedList<>();
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/ddl/alter-table.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/ddl/alter-table.xml
index 084d890..15411ae 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/ddl/alter-table.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/ddl/alter-table.xml
@@ -538,12 +538,16 @@
<alter-table sql-case-id="alter_table_add_unique_key">
<table name="t_order" start-index="12" stop-index="18" />
- <add-constraint start-index="24" stop-index="63"/>
+ <add-constraint start-index="24" stop-index="63" >
+ <index-column name="order_id" start-index="55" stop-index="62"/>
+ </add-constraint>
</alter-table>
<alter-table sql-case-id="alter_table_add_foreign_key">
<table name="t_order_item" start-index="12" stop-index="23" />
- <table name="t_order" start-index="86" stop-index="92" />
+ <add-constraint start-index="29" stop-index="121">
+ <referenced-table name="t_order" stop-index="92" start-index="86"/>
+ </add-constraint>
</alter-table>
<alter-table sql-case-id="alter_table_add_constraints">
@@ -551,7 +555,9 @@
<add-constraint start-index="29" stop-index="50">
<primary-key-column name="order_id" start-index="42" stop-index="49" />
</add-constraint>
- <add-constraint start-index="56" stop-index="72"/>
+ <add-constraint start-index="56" stop-index="72" >
+ <index-column name="order_id" start-index="64" stop-index="71"/>
+ </add-constraint>
<add-constraint start-index="79" stop-index="166">
<referenced-table name="t_order" start-index="113" stop-index="119" />
</add-constraint>
@@ -628,7 +634,7 @@
<alter-table sql-case-id="alter_table_add_check">
<table name="t_order" start-index="12" stop-index="18" />
- <add-constraint start-index="24" stop-index="67"/>
+ <add-constraint index-name="chk_order_id" start-index="24" stop-index="67"/>
</alter-table>
<alter-table sql-case-id="alter_table_add_columns_oracle">
@@ -677,7 +683,10 @@
<alter-table sql-case-id="alter_table_add_primary_foreign_key">
<table name="t_order_item" start-index="12" stop-index="23" />
- <table name="t_order" start-index="125" stop-index="131" />
+ <add-constraint>
+ <referenced-table name="t_order" start-index="125" stop-index="131"/>
+ <primary-key-column name="order_id" start-index="42" stop-index="49"/>
+ </add-constraint>
</alter-table>
<alter-table sql-case-id="alter_table_add_composite_primary_key_oracle">
@@ -789,7 +798,9 @@
<alter-table sql-case-id="alter_table_add_constraints_sqlserver">
<table name="t_order_item" start-index="12" stop-index="23" />
- <table name="t_order" start-index="128" stop-index="134" />
+ <add-constraint>
+ <referenced-table stop-index="134" start-index="128" name="t_order"/>
+ </add-constraint>
</alter-table>
<alter-table sql-case-id="alter_table_drop_constraints_sqlserver">
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/ddl/create-table.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/ddl/create-table.xml
index 89de2dd..4f18859 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/ddl/create-table.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/ddl/create-table.xml
@@ -431,7 +431,9 @@
<column-definition type="VARCHAR" start-index="111" stop-index="129">
<column name="column3" />
</column-definition>
- <constraint-definition start-index="132" stop-index="171"/>
+ <constraint-definition start-index="132" stop-index="171">
+ <index-column name="order_id" start-index="163" stop-index="170"/>
+ </constraint-definition>
</create-table>
<create-table sql-case-id="create_table_with_out_of_line_composite_unique_key">
@@ -454,7 +456,11 @@
<column-definition type="VARCHAR" start-index="111" stop-index="129">
<column name="column3" />
</column-definition>
- <constraint-definition start-index="132" stop-index="188"/>
+ <constraint-definition start-index="132" stop-index="188">
+ <index-column name="order_id" start-index="163" stop-index="170" />
+ <index-column name="user_id" start-index="173" stop-index="179" />
+ <index-column name="status" start-index="182" stop-index="187" />
+ </constraint-definition>
</create-table>
<create-table sql-case-id="create_table_with_out_of_line_foreign_key">
@@ -562,7 +568,9 @@
<constraint-definition start-index="150" stop-index="170">
<primary-key-column name="item_id" start-index="163" stop-index="169" />
</constraint-definition>
- <constraint-definition start-index="173" stop-index="188"/>
+ <constraint-definition start-index="173" stop-index="188">
+ <index-column name="item_id" start-index="181" stop-index="187"/>
+ </constraint-definition>
<constraint-definition start-index="191" stop-index="278">
<referenced-table name="t_order" start-index="225" stop-index="231" />
</constraint-definition>
@@ -589,8 +597,9 @@
<column-definition type="VARCHAR" start-index="111" stop-index="129">
<column name="column3" />
</column-definition>
- <!-- FIXME cannot parse index -->
- <!--<index name="order_index" />-->
+ <constraint-definition index-name="order_index" stop-index="159" start-index="132">
+ <index-column name="order_id" start-index="151" stop-index="158" />
+ </constraint-definition>
</create-table>
<create-table sql-case-id="create_table_with_out_of_line_composite_index">
@@ -613,8 +622,11 @@
<column-definition type="VARCHAR" start-index="111" stop-index="129">
<column name="column3" />
</column-definition>
- <!-- FIXME cannot parse index -->
- <!--<index name="order_index" />-->
+ <constraint-definition index-name="order_index" start-index="132" stop-index="176" >
+ <index-column name="order_id" start-index="151" stop-index="158" />
+ <index-column name="user_id" start-index="161" stop-index="167" />
+ <index-column name="status" start-index="170" stop-index="175" />
+ </constraint-definition>
</create-table>
<create-table sql-case-id="create_table_with_out_of_line_btree_index">
@@ -637,8 +649,9 @@
<column-definition type="VARCHAR" start-index="111" stop-index="129">
<column name="column3" />
</column-definition>
- <!-- FIXME cannot parse index name -->
- <!--<index name="order_index" />-->
+ <constraint-definition index-name="order_index" start-index="132" stop-index="171">
+ <index-column name="order_id" start-index="151" stop-index="158"/>
+ </constraint-definition>
</create-table>
<create-table sql-case-id="create_table_with_comment">
@@ -947,49 +960,46 @@
<create-table sql-case-id="create_table_with_exist_index">
<table name="t_order" start-index="13" stop-index="19" />
- <column-definition type="NUMBER" primary-key="true">
+ <column-definition type="NUMBER" primary-key="true" start-index="22" stop-index="76">
<column name="order_id" />
</column-definition>
- <column-definition type="NUMBER">
+ <column-definition type="NUMBER" start-index="79" stop-index="96">
<column name="user_id" />
</column-definition>
- <column-definition type="VARCHAR2">
+ <column-definition type="VARCHAR2" start-index="99" stop-index="117">
<column name="status" />
</column-definition>
- <column-definition type="VARCHAR2">
+ <column-definition type="VARCHAR2" start-index="120" stop-index="139">
<column name="column1" />
</column-definition>
- <column-definition type="VARCHAR2">
+ <column-definition type="VARCHAR2" start-index="142" stop-index="161">
<column name="column2" />
</column-definition>
- <column-definition type="VARCHAR2">
+ <column-definition type="VARCHAR2" start-index="164" stop-index="183">
<column name="column3" />
</column-definition>
- <index name="order_index" />
</create-table>
<create-table sql-case-id="create_table_with_create_index">
<table name="t_order" start-index="13" stop-index="19" />
- <table name="t_order" start-index="95" stop-index="101" />
- <column-definition type="NUMBER" primary-key="true">
+ <column-definition type="NUMBER" primary-key="true" start-index="22" stop-index="113">
<column name="order_id" />
</column-definition>
- <column-definition type="NUMBER">
+ <column-definition type="NUMBER" start-index="116" stop-index="133">
<column name="user_id" />
</column-definition>
- <column-definition type="VARCHAR2">
+ <column-definition type="VARCHAR2" start-index="136" stop-index="154">
<column name="status" />
</column-definition>
- <column-definition type="VARCHAR2">
+ <column-definition type="VARCHAR2" start-index="157" stop-index="176">
<column name="column1" />
</column-definition>
- <column-definition type="VARCHAR2">
+ <column-definition type="VARCHAR2" start-index="179" stop-index="198">
<column name="column2" />
</column-definition>
- <column-definition type="VARCHAR2">
+ <column-definition type="VARCHAR2" start-index="201" stop-index="220">
<column name="column3" />
</column-definition>
- <index name="order_index" />
</create-table>
<create-table sql-case-id="create_table_with_partition_oracle">
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/dml/insert.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/dml/insert.xml
index c4a0e3c..57ecbb7 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/dml/insert.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/case/dml/insert.xml
@@ -1035,59 +1035,6 @@
</on-duplicate-key-columns>
</insert>
- <insert sql-case-id="insert_all_with_all_placeholders" parameters="1, 1, 'init', 1, 1, 'init', 1, 1, 'init'">
- <table name="t_order" start-index="16" stop-index="22" />
- <columns start-index="24" stop-index="50">
- <column name="order_id" start-index="25" stop-index="32" />
- <column name="user_id" start-index="35" stop-index="41" />
- <column name="status" start-index="44" stop-index="49" />
- </columns>
- <values>
- <value>
- <assignment-value>
- <parameter-marker-expression value="0" />
- <literal-expression value="1" />
- </assignment-value>
- <assignment-value>
- <parameter-marker-expression value="1" />
- <literal-expression value="1" />
- </assignment-value>
- <assignment-value>
- <parameter-marker-expression value="2" />
- <literal-expression value="init" />
- </assignment-value>
- </value>
- <!-- FIXME cannot parse more values for oracle insert all -->
- <!--<value>-->
- <!--<assignment-value>-->
- <!--<parameter-marker-expression value="3" />-->
- <!--<literal-expression value="1" />-->
- <!--</assignment-value>-->
- <!--<assignment-value>-->
- <!--<parameter-marker-expression value="4" />-->
- <!--<literal-expression value="1" />-->
- <!--</assignment-value>-->
- <!--<assignment-value>-->
- <!--<parameter-marker-expression value="5" />-->
- <!--<literal-expression value="init" />-->
- <!--</assignment-value>-->
- <!--</value>-->
- <!--<value>-->
- <!--<assignment-value>-->
- <!--<parameter-marker-expression value="6" />-->
- <!--<literal-expression value="1" />-->
- <!--</assignment-value>-->
- <!--<assignment-value>-->
- <!--<parameter-marker-expression value="7" />-->
- <!--<literal-expression value="1" />-->
- <!--</assignment-value>-->
- <!--<assignment-value>-->
- <!--<parameter-marker-expression value="8" />-->
- <!--<literal-expression value="init" />-->
- <!--</assignment-value>-->
- <!--</value>-->
- </values>
- </insert>
<insert sql-case-id="insert_with_str_date_add" parameters="1, 1, 1">
<table name="t_order" start-index="12" stop-index="18" />
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/ddl/alter.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/ddl/alter.xml
index 0e6e0a3..1caccb7 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/ddl/alter.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/ddl/alter.xml
@@ -52,9 +52,11 @@
<sql-case id="alter_table_change_column" value="ALTER TABLE t_order CHANGE user_id column4 VARCHAR(10)" db-types="MySQL" />
<sql-case id="alter_table_add_primary_key" value="ALTER TABLE t_order ADD CONSTRAINT pk_user_id PRIMARY KEY (user_id)" />
<sql-case id="alter_table_add_composite_primary_key" value="ALTER TABLE t_order ADD status int,ADD CONSTRAINT pk_order_id_user_id_status PRIMARY KEY (order_id, user_id, status)" db-types="MySQL,PostgreSQL" />
- <sql-case id="alter_table_add_unique_key" value="ALTER TABLE t_order ADD CONSTRAINT uk_order_id UNIQUE (order_id)" />
+<!-- TODO support PostgreSQL-->
+ <sql-case id="alter_table_add_unique_key" value="ALTER TABLE t_order ADD CONSTRAINT uk_order_id UNIQUE (order_id)" db-types="MySQL,Oracle,SQLServer"/>
<sql-case id="alter_table_add_foreign_key" value="ALTER TABLE t_order_item ADD CONSTRAINT fk_order_id FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON DELETE CASCADE" db-types="MySQL,Oracle,SQLServer" />
- <sql-case id="alter_table_add_constraints" value="ALTER TABLE t_order_item ADD PRIMARY KEY (order_id),ADD UNIQUE (order_id), ADD FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON UPDATE CASCADE ON DELETE CASCADE" db-types="MySQL,PostgreSQL" />
+<!-- TODO support PostgreSQL-->
+ <sql-case id="alter_table_add_constraints" value="ALTER TABLE t_order_item ADD PRIMARY KEY (order_id),ADD UNIQUE (order_id), ADD FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON UPDATE CASCADE ON DELETE CASCADE" db-types="MySQL" />
<sql-case id="alter_table_drop_primary_key" value="ALTER TABLE t_order DROP PRIMARY KEY" db-types="MySQL,Oracle" />
<sql-case id="alter_table_drop_foreign_key" value="ALTER TABLE t_order DROP FOREIGN KEY fk_order_id" db-types="MySQL" />
<sql-case id="alter_table_drop_constraints" value="ALTER TABLE t_order DROP PRIMARY KEY, DROP FOREIGN KEY fk_order_id" db-types="MySQL" />
@@ -67,7 +69,8 @@
<sql-case id="alter_table_rename_index" value="ALTER TABLE t_order RENAME INDEX idx_column1_bak TO idx_column1" db-types="MySQL" />
<sql-case id="alter_table_composite_operate_columns" value="ALTER TABLE t_order ADD column4 VARCHAR(10), ADD column5 VARCHAR(10), ADD column6 VARCHAR(10),MODIFY user_id bigint, drop column status" db-types="MySQL" />
<sql-case id="alter_table_with_quota" value="ALTER TABLE "t_order" PARALLEL" db-types="Oracle" />
- <sql-case id="alter_table_add_check" value="ALTER TABLE t_order ADD CONSTRAINT chk_order_id CHECK (order_id > 0)" db-types="Oracle,PostgreSQL,SQLServer" />
+<!-- TODO support PostgreSQL-->
+ <sql-case id="alter_table_add_check" value="ALTER TABLE t_order ADD CONSTRAINT chk_order_id CHECK (order_id > 0)" db-types="Oracle,SQLServer" />
<sql-case id="alter_table_add_columns_oracle" value="ALTER TABLE t_order ADD column4 VARCHAR2(10) ADD column5 VARCHAR2(10) ADD column6 VARCHAR2(10)" db-types="Oracle" />
<sql-case id="alter_table_modify_columns_oracle" value="ALTER TABLE t_order MODIFY column4 VARCHAR2(20) MODIFY column5 VARCHAR2(20) MODIFY column6 VARCHAR2(20)" db-types="Oracle" />
<sql-case id="alter_table_drop_columns_oracle" value="ALTER TABLE t_order DROP COLUMN user_id DROP COLUMN column5" db-types="Oracle" />
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/ddl/create.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/ddl/create.xml
index dfcf925..300fcaa 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/ddl/create.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/ddl/create.xml
@@ -49,12 +49,15 @@
<sql-case id="create_table_with_inline_constraints" value="CREATE TABLE t_order (order_id INT PRIMARY KEY UNIQUE, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10))" db-types="MySQL,Oracle,PostgreSQL" />
<sql-case id="create_table_with_out_of_line_primary_key" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CONSTRAINT pk_order_id PRIMARY KEY (order_id))" />
<sql-case id="create_table_with_out_of_line_composite_primary_key" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CONSTRAINT pk_order_id PRIMARY KEY (order_id, user_id, status))"/>
- <sql-case id="create_table_with_out_of_line_unique_key" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CONSTRAINT uk_order_id UNIQUE (order_id))" />
- <sql-case id="create_table_with_out_of_line_composite_unique_key" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CONSTRAINT uk_order_id UNIQUE (order_id, user_id, status))"/>
+<!-- TODO support PostgreSQL Oracle SQLServer-->
+ <sql-case id="create_table_with_out_of_line_unique_key" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CONSTRAINT uk_order_id UNIQUE (order_id))" db-types="MySQL"/>
+<!-- TODO support PostgreSQL Oracle SQLServer-->
+ <sql-case id="create_table_with_out_of_line_composite_unique_key" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CONSTRAINT uk_order_id UNIQUE (order_id, user_id, status))" db-types="MySQL"/>
<sql-case id="create_table_with_out_of_line_foreign_key" value="CREATE TABLE t_order_item (item_id INT, order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CONSTRAINT fk_order_id FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON UPDATE CASCADE ON DELETE CASCADE)" db-types="MySQL,PostgreSQL,SQLServer" />
<sql-case id="create_table_with_out_of_line_composite_foreign_key" value="CREATE TABLE t_order_item (item_id INT, order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CONSTRAINT fk_order_id FOREIGN KEY (order_id, user_id, status) REFERENCES t_order (order_id, user_id, status) ON UPDATE CASCADE ON DELETE CASCADE)" db-types="MySQL,PostgreSQL,SQLServer" />
<sql-case id="create_table_with_out_of_line_check" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), CHECK (order_id > 0))" />
- <sql-case id="create_table_with_out_of_line_constraints" value="CREATE TABLE t_order_item (item_id INT, order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), PRIMARY KEY (item_id), UNIQUE (item_id), FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON UPDATE CASCADE ON DELETE CASCADE, CHECK (item_id > 0))" db-types="MySQL,PostgreSQL,SQLServer" />
+<!-- TODO support PostgreSQL SQLServer-->
+ <sql-case id="create_table_with_out_of_line_constraints" value="CREATE TABLE t_order_item (item_id INT, order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), PRIMARY KEY (item_id), UNIQUE (item_id), FOREIGN KEY (order_id) REFERENCES t_order (order_id) ON UPDATE CASCADE ON DELETE CASCADE, CHECK (item_id > 0))" db-types="MySQL" />
<sql-case id="create_table_with_out_of_line_index" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), INDEX order_index (order_id))" db-types="MySQL" />
<sql-case id="create_table_with_out_of_line_composite_index" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), INDEX order_index (order_id, user_id, status))" db-types="MySQL" />
<sql-case id="create_table_with_out_of_line_btree_index" value="CREATE TABLE t_order (order_id INT, user_id INT, status VARCHAR(10), column1 VARCHAR(10), column2 VARCHAR(10), column3 VARCHAR(10), INDEX order_index (order_id) USING BTREE)" db-types="MySQL" />
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/dml/insert.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/dml/insert.xml
index 9c76c18..424be81 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/dml/insert.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported/dml/insert.xml
@@ -53,7 +53,8 @@
<sql-case id="insert_with_aggregation_function_column_name" value="INSERT INTO t_order (order_id, user_id, count) VALUES (?, ?, ?)" db-types="SQLServer" />
<sql-case id="insert_with_str_to_date" value="INSERT INTO t_order(present_date, order_id, user_id) VALUES (str_to_date(?, '%Y-%m-%d'), ?, ?)" db-types="MySQL" />
<sql-case id="insert_on_duplicate_key_update_with_base64_aes_encrypt" value="INSERT INTO t_order SET order_id = ?, user_id = ?, status = convert(to_base64(aes_encrypt(?, 'key')) USING utf8) ON DUPLICATE KEY UPDATE status = VALUES(status)" db-types="MySQL" />
- <sql-case id="insert_all_with_all_placeholders" value="INSERT ALL INTO t_order (order_id, user_id, status) VALUES (?, ?, ?) INTO t_order (order_id, user_id, status) VALUES (?, ?, ?) INTO t_order (order_id, user_id, status) VALUES (?, ?, ?) SELECT * FROM dual" db-types="Oracle"/>
+<!-- TODO support this test case-->
+<!-- <sql-case id="insert_all_with_all_placeholders" value="INSERT ALL INTO t_order (order_id, user_id, status) VALUES (?, ?, ?) INTO t_order (order_id, user_id, status) VALUES (?, ?, ?) INTO t_order (order_id, user_id, status) VALUES (?, ?, ?) SELECT * FROM dual" db-types="Oracle"/>-->
<sql-case id="insert_with_str_date_add" value="INSERT INTO t_order(present_date, order_id, user_id) VALUES (date_add(now(),interval ? second), ?, ?)" db-types="MySQL" />
<sql-case id="insert_select_with_all_columns" value="INSERT INTO t_order (order_id, user_id, status) SELECT order_id, user_id, status FROM t_order WHERE order_id = ?" db-types="MySQL" />
<sql-case id="insert_select_without_columns" value="INSERT INTO t_order SELECT order_id, user_id, status FROM t_order WHERE order_id = ?" db-types="MySQL" />