You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2021/09/03 09:44:24 UTC

[shardingsphere] branch master updated: Add unit test for shardingsphere-infra-binder (#12163)

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 78bf744  Add unit test for shardingsphere-infra-binder (#12163)
78bf744 is described below

commit 78bf744a0e8e2ff8d695acc36192489768e8e64c
Author: Eden San <31...@users.noreply.github.com>
AuthorDate: Fri Sep 3 17:43:46 2021 +0800

    Add unit test for shardingsphere-infra-binder (#12163)
    
    * issue 10986. Optimize change history of ShardingSphere-JDBC Spring Namespace Configuration (Chinese).
    
    * Update content format.
    
    * Add unit test for shardingsphere-infra-binder(9/22).
    
    * Add unit test for shardingsphere-infra-binder(11/22), Class normative adjustment.
    
    * Change the parameter data in Class AlterViewStatementContextTest.
    
    * Add unit test for shardingsphere-infra-binder(22/22)
    
    * Class PrepareStatementContextTest normative adjustment.
    
    * Class normative adjustment.
    
    * Simplify the test class.
---
 .../dal/AnalyzeTableStatementContextTest.java      |  64 +++++++++++
 .../statement/dal/ExplainStatementContextTest.java |  57 ++++++++++
 .../dal/ShowColumnsStatementContextTest.java       |  54 +++++++++
 .../dal/ShowCreateTableStatementContextTest.java   |  48 ++++++++
 .../dal/ShowIndexStatementContextTest.java         |  48 ++++++++
 .../dcl/DenyUserStatementContextTest.java          |  48 ++++++++
 .../statement/dcl/GrantStatementContextTest.java   |  82 ++++++++++++++
 .../statement/dcl/RevokeStatementContextTest.java  |  82 ++++++++++++++
 .../ddl/AlterIndexStatementContextTest.java        |  65 +++++++++++
 .../ddl/AlterTableStatementContextTest.java        | 122 +++++++++++++++++++++
 .../ddl/AlterViewStatementContextTest.java         |  71 ++++++++++++
 .../ddl/CreateDatabaseStatementContextTest.java    |  51 +++++++++
 .../ddl/CreateFunctionStatementContextTest.java    |  54 +++++++++
 .../ddl/CreateIndexStatementContextTest.java       |  73 ++++++++++++
 .../ddl/CreateProcedureStatementContextTest.java   |  48 ++++++++
 .../ddl/CreateTableStatementContextTest.java       |  89 +++++++++++++++
 .../ddl/CreateViewStatementContextTest.java        |  54 +++++++++
 .../ddl/DropIndexStatementContextTest.java         |  77 +++++++++++++
 .../ddl/DropTableStatementContextTest.java         |  77 +++++++++++++
 .../ddl/DropViewStatementContextTest.java          |  57 ++++++++++
 .../statement/ddl/PrepareStatementContextTest.java | 101 +++++++++++++++++
 .../ddl/TruncateStatementContextTest.java          |  71 ++++++++++++
 22 files changed, 1493 insertions(+)

diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/AnalyzeTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/AnalyzeTableStatementContextTest.java
new file mode 100644
index 0000000..7e7a8aa
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/AnalyzeTableStatementContextTest.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.dal;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.AnalyzeTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLAnalyzeTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dal.PostgreSQLAnalyzeTableStatement;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class AnalyzeTableStatementContextTest {
+
+    @Test
+    public void assertMysqlNewInstance() {
+        assertNewInstance(mock(MySQLAnalyzeTableStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLAnalyzeTableStatement.class));
+    }
+
+    private void assertNewInstance(final AnalyzeTableStatement analyzeTableStatement) {
+        SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
+        List<SimpleTableSegment> tables = new LinkedList<>();
+        tables.add(table1);
+        tables.add(table2);
+        when(analyzeTableStatement.getTables()).thenReturn(tables);
+        AnalyzeTableStatementContext actual = new AnalyzeTableStatementContext(analyzeTableStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(analyzeTableStatement));
+        assertThat(actual.getAllTables().stream().map(a -> a.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Arrays.asList("tbl_1", "tbl_2")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ExplainStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ExplainStatementContextTest.java
new file mode 100644
index 0000000..025f694
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ExplainStatementContextTest.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.dal;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.ExplainStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLExplainStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dal.PostgreSQLExplainStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.Optional;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class ExplainStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLExplainStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLExplainStatement.class));
+    }
+
+    private void assertNewInstance(final ExplainStatement explainStatement) {
+        SQLStatement statement = () -> 0;
+        when(explainStatement.getStatement()).thenReturn(Optional.of(statement));
+        ExplainStatementContext actual = new ExplainStatementContext(explainStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(explainStatement));
+        assertThat(actual.getSqlStatement().getStatement().orElse(null), is(statement));
+        assertThat(actual.getAllTables(), is(Collections.emptyList()));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowColumnsStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowColumnsStatementContextTest.java
new file mode 100644
index 0000000..da93853
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowColumnsStatementContextTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.dal;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dal.FromSchemaSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowColumnsStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class ShowColumnsStatementContextTest {
+
+    @Test
+    public void assertNewInstance() {
+        MySQLShowColumnsStatement mySQLShowColumnsStatement = mock(MySQLShowColumnsStatement.class);
+        String tableName = "tbl_1";
+        SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue(tableName)));
+        FromSchemaSegment fromSchema = new FromSchemaSegment(0, 0);
+        when(mySQLShowColumnsStatement.getTable()).thenReturn(table);
+        when(mySQLShowColumnsStatement.getFromSchema()).thenReturn(Optional.of(fromSchema));
+        ShowColumnsStatementContext actual = new ShowColumnsStatementContext(mySQLShowColumnsStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(mySQLShowColumnsStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.singletonList(tableName)));
+        assertThat(actual.getRemoveSegments(), is(Collections.singletonList(fromSchema)));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowCreateTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowCreateTableStatementContextTest.java
new file mode 100644
index 0000000..3e766f6
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowCreateTableStatementContextTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.dal;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowCreateTableStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class ShowCreateTableStatementContextTest {
+
+    @Test
+    public void assertNewInstance() {
+        MySQLShowCreateTableStatement mySQLShowCreateTableStatement = mock(MySQLShowCreateTableStatement.class);
+        SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        when(mySQLShowCreateTableStatement.getTable()).thenReturn(table);
+        ShowCreateTableStatementContext actual = new ShowCreateTableStatementContext(mySQLShowCreateTableStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(mySQLShowCreateTableStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.singletonList("tbl_1")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowIndexStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowIndexStatementContextTest.java
new file mode 100644
index 0000000..853fedd
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowIndexStatementContextTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.dal;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowIndexStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class ShowIndexStatementContextTest {
+
+    @Test
+    public void assertNewInstance() {
+        MySQLShowIndexStatement mySQLShowIndexStatement = mock(MySQLShowIndexStatement.class);
+        SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        when(mySQLShowIndexStatement.getTable()).thenReturn(table);
+        ShowIndexStatementContext actual = new ShowIndexStatementContext(mySQLShowIndexStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(mySQLShowIndexStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.singletonList("tbl_1")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/DenyUserStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/DenyUserStatementContextTest.java
new file mode 100644
index 0000000..6cda5b1
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/DenyUserStatementContextTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.dcl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.dcl.SQLServerDenyUserStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class DenyUserStatementContextTest {
+
+    @Test
+    public void assertNewInstance() {
+        SQLServerDenyUserStatement sqlServerDenyUserStatement = mock(SQLServerDenyUserStatement.class);
+        SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        when(sqlServerDenyUserStatement.getTable()).thenReturn(table);
+        DenyUserStatementContext actual = new DenyUserStatementContext(sqlServerDenyUserStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(sqlServerDenyUserStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.singletonList("tbl_1")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/GrantStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/GrantStatementContextTest.java
new file mode 100644
index 0000000..fafb3cc
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/GrantStatementContextTest.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.dcl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dcl.GrantStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dcl.MySQLGrantStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.dcl.OracleGrantStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dcl.PostgreSQLGrantStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sql92.dcl.SQL92GrantStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.dcl.SQLServerGrantStatement;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class GrantStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLGrantStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLGrantStatement.class));
+    }
+
+    @Test
+    public void assertOracleNewInstance() {
+        assertNewInstance(mock(OracleGrantStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerGrantStatement.class));
+    }
+
+    @Test
+    public void assertSQL92NewInstance() {
+        assertNewInstance(mock(SQL92GrantStatement.class));
+    }
+
+    private void assertNewInstance(final GrantStatement grantStatement) {
+        SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
+        List<SimpleTableSegment> tables = new LinkedList<>();
+        tables.add(table1);
+        tables.add(table2);
+        when(grantStatement.getTables()).thenReturn(tables);
+        GrantStatementContext actual = new GrantStatementContext(grantStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(grantStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Arrays.asList("tbl_1", "tbl_2")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/RevokeStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/RevokeStatementContextTest.java
new file mode 100644
index 0000000..0c8d950
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/RevokeStatementContextTest.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.dcl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dcl.RevokeStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dcl.MySQLRevokeStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.dcl.OracleRevokeStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dcl.PostgreSQLRevokeStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sql92.dcl.SQL92RevokeStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.dcl.SQLServerRevokeStatement;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class RevokeStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLRevokeStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLRevokeStatement.class));
+    }
+
+    @Test
+    public void assertOracleNewInstance() {
+        assertNewInstance(mock(OracleRevokeStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerRevokeStatement.class));
+    }
+
+    @Test
+    public void assertSQL92NewInstance() {
+        assertNewInstance(mock(SQL92RevokeStatement.class));
+    }
+
+    private void assertNewInstance(final RevokeStatement revokeStatement) {
+        SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
+        List<SimpleTableSegment> tables = new LinkedList<>();
+        tables.add(table1);
+        tables.add(table2);
+        when(revokeStatement.getTables()).thenReturn(tables);
+        RevokeStatementContext actual = new RevokeStatementContext(revokeStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(revokeStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Arrays.asList("tbl_1", "tbl_2")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterIndexStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterIndexStatementContextTest.java
new file mode 100644
index 0000000..00b745e
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterIndexStatementContextTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.AlterIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl.OracleAlterIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerAlterIndexStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class AlterIndexStatementContextTest {
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLAlterIndexStatement.class));
+    }
+
+    @Test
+    public void assertOracleNewInstance() {
+        assertNewInstance(mock(OracleAlterIndexStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerAlterIndexStatement.class));
+    }
+
+    private void assertNewInstance(final AlterIndexStatement alterIndexStatement) {
+        IndexSegment indexSegment = new IndexSegment(0, 0, new IdentifierValue("index_1"));
+        when(alterIndexStatement.getIndex()).thenReturn(Optional.of(indexSegment));
+        AlterIndexStatementContext actual = new AlterIndexStatementContext(alterIndexStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(alterIndexStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.emptyList()));
+        assertThat(actual.getIndexes().stream().map(each -> each.getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.singletonList("index_1")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterTableStatementContextTest.java
new file mode 100644
index 0000000..62c62b5
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterTableStatementContextTest.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.ColumnDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.alter.AddColumnDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.alter.ModifyColumnDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.alter.AddConstraintDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.alter.DropConstraintDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.alter.ValidateConstraintDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.AlterTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLAlterTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl.OracleAlterTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sql92.ddl.SQL92AlterTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerAlterTableStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.Optional;
+import java.util.Collection;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class AlterTableStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLAlterTableStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLAlterTableStatement.class));
+    }
+
+    @Test
+    public void assertOracleNewInstance() {
+        assertNewInstance(mock(OracleAlterTableStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerAlterTableStatement.class));
+    }
+
+    @Test
+    public void assertSQL92NewInstance() {
+        assertNewInstance(mock(SQL92AlterTableStatement.class));
+    }
+
+    private void assertNewInstance(final AlterTableStatement alterTableStatement) {
+        SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        SimpleTableSegment renameTable = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("rename_tbl_1")));
+        when(alterTableStatement.getTable()).thenReturn(table);
+        when(alterTableStatement.getRenameTable()).thenReturn(Optional.of(renameTable));
+
+        Collection<SimpleTableSegment> referencedTables = Collections.singletonList(table);
+        ColumnDefinitionSegment columnDefinition = mock(ColumnDefinitionSegment.class);
+        when(columnDefinition.getReferencedTables()).thenReturn(referencedTables);
+        AddColumnDefinitionSegment addColumnDefinition = mock(AddColumnDefinitionSegment.class);
+        when(addColumnDefinition.getColumnDefinitions()).thenReturn(Collections.singletonList(columnDefinition));
+        when(alterTableStatement.getAddColumnDefinitions()).thenReturn(Collections.singletonList(addColumnDefinition));
+
+        ModifyColumnDefinitionSegment modifyColumnDefinition = mock(ModifyColumnDefinitionSegment.class);
+        when(modifyColumnDefinition.getColumnDefinition()).thenReturn(columnDefinition);
+        when(alterTableStatement.getModifyColumnDefinitions()).thenReturn(Collections.singletonList(modifyColumnDefinition));
+
+        ConstraintDefinitionSegment constraintDefinition = mock(ConstraintDefinitionSegment.class);
+        when(constraintDefinition.getReferencedTable()).thenReturn(Optional.of(table));
+        when(constraintDefinition.getIndexName()).thenReturn(Optional.of(new IndexSegment(0, 0, new IdentifierValue("index"))));
+        AddConstraintDefinitionSegment addConstraintDefinition = mock(AddConstraintDefinitionSegment.class);
+        when(addConstraintDefinition.getConstraintDefinition()).thenReturn(constraintDefinition);
+
+        ConstraintSegment constraint = new ConstraintSegment(0, 0, new IdentifierValue("constraint"));
+        when(addConstraintDefinition.getConstraintDefinition().getConstraintName()).thenReturn(Optional.of(constraint));
+        when(alterTableStatement.getAddConstraintDefinitions()).thenReturn(Collections.singletonList(addConstraintDefinition));
+        ValidateConstraintDefinitionSegment validateConstraintDefinition = mock(ValidateConstraintDefinitionSegment.class);
+        when(validateConstraintDefinition.getConstraintName()).thenReturn(constraint);
+        when(alterTableStatement.getValidateConstraintDefinitions()).thenReturn(Collections.singletonList(validateConstraintDefinition));
+        DropConstraintDefinitionSegment dropConstraintDefinition = mock(DropConstraintDefinitionSegment.class);
+        when(dropConstraintDefinition.getConstraintName()).thenReturn(constraint);
+        when(alterTableStatement.getDropConstraintDefinitions()).thenReturn(Collections.singletonList(dropConstraintDefinition));
+
+        AlterTableStatementContext actual = new AlterTableStatementContext(alterTableStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(alterTableStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()),
+                is(Arrays.asList("tbl_1", "rename_tbl_1", "tbl_1", "tbl_1", "tbl_1")));
+        assertThat(actual.getIndexes().stream().map(each -> each.getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.singletonList("index")));
+        assertThat(actual.getConstraints().stream().map(each -> each.getIdentifier().getValue()).collect(Collectors.toList()),
+                is(Arrays.asList("constraint", "constraint", "constraint")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterViewStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterViewStatementContextTest.java
new file mode 100644
index 0000000..d6e427b
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterViewStatementContextTest.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.AlterViewStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLAlterViewStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dml.MySQLSelectStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLAlterViewStatement;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Optional;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class AlterViewStatementContextTest {
+
+    private SimpleTableSegment view;
+
+    @Before
+    public void setUp() {
+        view = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("view")));
+    }
+
+    @Test
+    public void assertMySQLNewInstance() {
+        SelectStatement select = mock(MySQLSelectStatement.class);
+        when(select.getFrom()).thenReturn(view);
+        MySQLAlterViewStatement mySQLAlterViewStatement = mock(MySQLAlterViewStatement.class);
+        when(mySQLAlterViewStatement.getView()).thenReturn(view);
+        when(mySQLAlterViewStatement.getSelect()).thenReturn(Optional.of(select));
+        assertNewInstance(mySQLAlterViewStatement);
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        PostgreSQLAlterViewStatement postgreSQLAlterViewStatement = mock(PostgreSQLAlterViewStatement.class);
+        when(postgreSQLAlterViewStatement.getView()).thenReturn(view);
+        assertNewInstance(postgreSQLAlterViewStatement);
+    }
+
+    private void assertNewInstance(final AlterViewStatement alterViewStatement) {
+        AlterViewStatementContext actual = new AlterViewStatementContext(alterViewStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(alterViewStatement));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateDatabaseStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateDatabaseStatementContextTest.java
new file mode 100644
index 0000000..15fe091
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateDatabaseStatementContextTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateDatabaseStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLCreateDatabaseStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateDatabaseStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+
+public final class CreateDatabaseStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLCreateDatabaseStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLCreateDatabaseStatement.class));
+    }
+
+    private void assertNewInstance(final CreateDatabaseStatement createDatabaseStatement) {
+        CreateDatabaseStatementContext actual = new CreateDatabaseStatementContext(createDatabaseStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(createDatabaseStatement));
+        assertThat(actual.getTablesContext().getTableNames(), is(Collections.emptySet()));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateFunctionStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateFunctionStatementContextTest.java
new file mode 100644
index 0000000..f68098a
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateFunctionStatementContextTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateFunctionStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLCreateFunctionStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateFunctionStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerCreateFunctionStatement;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+
+public final class CreateFunctionStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLCreateFunctionStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLCreateFunctionStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerCreateFunctionStatement.class));
+    }
+
+    private void assertNewInstance(final CreateFunctionStatement createDatabaseStatement) {
+        CreateFunctionStatementContext actual = new CreateFunctionStatementContext(createDatabaseStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(createDatabaseStatement));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateIndexStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateIndexStatementContextTest.java
new file mode 100644
index 0000000..0fe3c5f
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateIndexStatementContextTest.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLCreateIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl.OracleCreateIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerCreateIndexStatement;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class CreateIndexStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLCreateIndexStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLCreateIndexStatement.class));
+    }
+
+    @Test
+    public void assertOracleSQLNewInstance() {
+        assertNewInstance(mock(OracleCreateIndexStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerSQLNewInstance() {
+        assertNewInstance(mock(SQLServerCreateIndexStatement.class));
+    }
+
+    private void assertNewInstance(final CreateIndexStatement createIndexStatement) {
+        CreateIndexStatementContext actual = new CreateIndexStatementContext(createIndexStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(createIndexStatement));
+        assertTrue(actual.isGeneratedIndex());
+        assertThat(actual.getAllTables(), is(Collections.emptyList()));
+        assertThat(actual.getIndexes(), is(Collections.emptyList()));
+        when(createIndexStatement.getIndex()).thenReturn(new IndexSegment(0, 0, new IdentifierValue("index_2")));
+        CreateIndexStatementContext actual2 = new CreateIndexStatementContext(createIndexStatement);
+        assertThat(actual2.getIndexes().stream().map(each -> each.getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.singletonList("index_2")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateProcedureStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateProcedureStatementContextTest.java
new file mode 100644
index 0000000..3bfc400
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateProcedureStatementContextTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateProcedureStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLCreateProcedureStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateProcedureStatement;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+
+public final class CreateProcedureStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLCreateProcedureStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLCreateProcedureStatement.class));
+    }
+
+    private void assertNewInstance(final CreateProcedureStatement createProcedureStatement) {
+        CreateProcedureStatementContext actual = new CreateProcedureStatementContext(createProcedureStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(createProcedureStatement));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateTableStatementContextTest.java
new file mode 100644
index 0000000..72acb0e
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateTableStatementContextTest.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.ColumnDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLCreateTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl.OracleCreateTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sql92.ddl.SQL92CreateTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerCreateTableStatement;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class CreateTableStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLCreateTableStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLCreateTableStatement.class));
+    }
+
+    @Test
+    public void assertOracleNewInstance() {
+        assertNewInstance(mock(OracleCreateTableStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerCreateTableStatement.class));
+    }
+
+    @Test
+    public void assertSQL92NewInstance() {
+        assertNewInstance(mock(SQL92CreateTableStatement.class));
+    }
+
+    private void assertNewInstance(final CreateTableStatement createTableStatement) {
+        CreateTableStatementContext actual = new CreateTableStatementContext(createTableStatement);
+        SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        when(createTableStatement.getTable()).thenReturn(table);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        ColumnDefinitionSegment columnDefinition = mock(ColumnDefinitionSegment.class);
+        when(columnDefinition.getReferencedTables()).thenReturn(Collections.singletonList(table));
+        when(createTableStatement.getColumnDefinitions()).thenReturn(Collections.singletonList(columnDefinition));
+        ConstraintDefinitionSegment constraintDefinition = mock(ConstraintDefinitionSegment.class);
+        when(constraintDefinition.getReferencedTable()).thenReturn(Optional.of(table));
+        when(createTableStatement.getConstraintDefinitions()).thenReturn(Collections.singletonList(constraintDefinition));
+        assertThat(actual.getSqlStatement(), is(createTableStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Arrays.asList("tbl_1", "tbl_1", "tbl_1")));
+        when(constraintDefinition.getIndexName()).thenReturn(Optional.of(new IndexSegment(0, 0, new IdentifierValue("index_1"))));
+        assertThat(actual.getIndexes().stream().map(each -> each.getIdentifier().getValue()).collect(Collectors.toList()), is(Collections.singletonList("index_1")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateViewStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateViewStatementContextTest.java
new file mode 100644
index 0000000..adaef06
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateViewStatementContextTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateViewStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLCreateViewStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLCreateViewStatement;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class CreateViewStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLCreateViewStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLCreateViewStatement.class));
+    }
+
+    private void assertNewInstance(final CreateViewStatement createViewStatement) {
+        SimpleTableSegment view = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("view")));
+        when(createViewStatement.getView()).thenReturn(view);
+        CreateViewStatementContext actual = new CreateViewStatementContext(createViewStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(createViewStatement));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropIndexStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropIndexStatementContextTest.java
new file mode 100644
index 0000000..ab584f3
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropIndexStatementContextTest.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLDropIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl.OracleDropIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerDropIndexStatement;
+import org.junit.Test;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Collections;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class DropIndexStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLDropIndexStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLDropIndexStatement.class));
+    }
+
+    @Test
+    public void assertOracleNewInstance() {
+        assertNewInstance(mock(OracleDropIndexStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerDropIndexStatement.class));
+    }
+
+    private void assertNewInstance(final DropIndexStatement dropIndexStatement) {
+        Collection<IndexSegment> indexes = new LinkedList<>();
+        IndexSegment index1 = new IndexSegment(0, 0, new IdentifierValue("idx_1"));
+        IndexSegment index2 = new IndexSegment(0, 0, new IdentifierValue("idx_2"));
+        indexes.add(index1);
+        indexes.add(index2);
+        when(dropIndexStatement.getIndexes()).thenReturn(indexes);
+        DropIndexStatementContext actual = new DropIndexStatementContext(dropIndexStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(dropIndexStatement));
+        assertThat(actual.getAllTables(), is(Collections.emptyList()));
+        assertThat(actual.getIndexes().stream().map(each -> each.getIdentifier().getValue()).collect(Collectors.toList()), is(Arrays.asList("idx_1", "idx_2")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropTableStatementContextTest.java
new file mode 100644
index 0000000..b55b58e
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropTableStatementContextTest.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLDropTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl.OracleDropTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sql92.ddl.SQL92DropTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerDropTableStatement;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class DropTableStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLDropTableStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLDropTableStatement.class));
+    }
+
+    @Test
+    public void assertOracleNewInstance() {
+        assertNewInstance(mock(OracleDropTableStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerDropTableStatement.class));
+    }
+
+    @Test
+    public void assertSQL92NewInstance() {
+        assertNewInstance(mock(SQL92DropTableStatement.class));
+    }
+
+    private void assertNewInstance(final DropTableStatement dropTableStatement) {
+        DropTableStatementContext actual = new DropTableStatementContext(dropTableStatement);
+        SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
+        when(dropTableStatement.getTables()).thenReturn(Arrays.asList(table1, table2));
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(dropTableStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Arrays.asList("tbl_1", "tbl_2")));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropViewStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropViewStatementContextTest.java
new file mode 100644
index 0000000..c81fa2a
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropViewStatementContextTest.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropViewStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLDropViewStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLDropViewStatement;
+import org.junit.Test;
+
+import java.util.Arrays;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class DropViewStatementContextTest {
+
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLDropViewStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLDropViewStatement.class));
+    }
+
+    private void assertNewInstance(final DropViewStatement dropViewStatement) {
+        SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
+        when(dropViewStatement.getViews()).thenReturn(Arrays.asList(table1, table2));
+        DropViewStatementContext actual = new DropViewStatementContext(dropViewStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(dropViewStatement));
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/PrepareStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/PrepareStatementContextTest.java
new file mode 100644
index 0000000..a88472b
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/PrepareStatementContextTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.ColumnAssignmentSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.SetAssignmentSegment;
+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.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.DeleteStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.UpdateStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLPrepareStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dml.PostgreSQLDeleteStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dml.PostgreSQLInsertStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dml.PostgreSQLSelectStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.dml.PostgreSQLUpdateStatement;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class PrepareStatementContextTest {
+
+    private ColumnSegment column;
+
+    private SimpleTableSegment table;
+
+    @Before
+    public void setUp() {
+        table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        column = new ColumnSegment(0, 0, new IdentifierValue("col_1"));
+    }
+
+    @Test
+    public void assertNewInstance() {
+        PostgreSQLPrepareStatement postgreSQLPrepare = mock(PostgreSQLPrepareStatement.class);
+        when(postgreSQLPrepare.getSelect()).thenReturn(Optional.of(getSelect()));
+        when(postgreSQLPrepare.getInsert()).thenReturn(Optional.of(getInsert()));
+        when(postgreSQLPrepare.getUpdate()).thenReturn(Optional.of(getUpdate()));
+        when(postgreSQLPrepare.getDelete()).thenReturn(Optional.of(getDelete()));
+        PrepareStatementContext actual = new PrepareStatementContext(postgreSQLPrepare);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(postgreSQLPrepare));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()),
+                is(Arrays.asList("tbl_1", "tbl_1", "tbl_1", "tbl_1")));
+    }
+
+    private SelectStatement getSelect() {
+        SelectStatement select = new PostgreSQLSelectStatement();
+        select.setFrom(table);
+        return select;
+    }
+
+    private InsertStatement getInsert() {
+        InsertStatement insert = new PostgreSQLInsertStatement();
+        insert.setTable(table);
+        return insert;
+    }
+
+    private UpdateStatement getUpdate() {
+        UpdateStatement update = new PostgreSQLUpdateStatement();
+        update.setTableSegment(table);
+        SetAssignmentSegment setAssignmentSegment = new SetAssignmentSegment(0, 0, Collections.singletonList(new ColumnAssignmentSegment(0, 0, Collections.singletonList(column), column)));
+        update.setSetAssignment(setAssignmentSegment);
+        return update;
+    }
+
+    private DeleteStatement getDelete() {
+        DeleteStatement delete = new PostgreSQLDeleteStatement();
+        delete.setTableSegment(table);
+        return delete;
+    }
+}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/TruncateStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/TruncateStatementContextTest.java
new file mode 100644
index 0000000..6cb6705
--- /dev/null
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/TruncateStatementContextTest.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.binder.statement.ddl;
+
+import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.TruncateStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLTruncateStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.ddl.OracleTruncateStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.postgresql.ddl.PostgreSQLTruncateStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.ddl.SQLServerTruncateStatement;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class TruncateStatementContextTest {
+    
+    @Test
+    public void assertMySQLNewInstance() {
+        assertNewInstance(mock(MySQLTruncateStatement.class));
+    }
+
+    @Test
+    public void assertPostgreSQLNewInstance() {
+        assertNewInstance(mock(PostgreSQLTruncateStatement.class));
+    }
+
+    @Test
+    public void assertOracleNewInstance() {
+        assertNewInstance(mock(OracleTruncateStatement.class));
+    }
+
+    @Test
+    public void assertSQLServerNewInstance() {
+        assertNewInstance(mock(SQLServerTruncateStatement.class));
+    }
+
+    private void assertNewInstance(final TruncateStatement truncateStatement) {
+        SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
+        SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
+        when(truncateStatement.getTables()).thenReturn(Arrays.asList(table1, table2));
+        TruncateStatementContext actual = new TruncateStatementContext(truncateStatement);
+        assertThat(actual, instanceOf(CommonSQLStatementContext.class));
+        assertThat(actual.getSqlStatement(), is(truncateStatement));
+        assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()), is(Arrays.asList("tbl_1", "tbl_2")));
+    }
+}