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 2021/02/20 03:41:06 UTC

[shardingsphere] branch master updated: add dql of encrypt (#9442)

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 f2644fc  add dql of encrypt (#9442)
f2644fc is described below

commit f2644fce641378a0a5020a43eb4db42063e2f9ca
Author: Jieker <ji...@163.com>
AuthorDate: Sat Feb 20 11:40:45 2021 +0800

    add dql of encrypt (#9442)
---
 .../cases/dql/dataset/encrypt/mysql/select_avg.xml |  23 +++++
 .../encrypt/mysql/select_group_by_with_avg.xml     |  43 ++++++++
 .../dql/dataset/encrypt/postgresql/select_avg.xml  |  23 +++++
 .../postgresql/select_count_tilde_concat.xml       |  23 +++++
 .../postgresql/select_group_by_with_avg.xml        |  43 ++++++++
 .../dataset/encrypt/select_alias_as_keyword.xml    |  23 +++++
 .../select_alias_as_single_quote_string.xml        |  62 ++++++++++++
 .../cases/dql/dataset/encrypt/select_avg.xml       |  23 +++++
 .../encrypt/select_between_with_single_table.xml   |  26 +++++
 .../select_comparison_symbol_with_single_table.xml |  26 +++++
 .../cases/dql/dataset/encrypt/select_count.xml     |  23 +++++
 .../dataset/encrypt/select_count_like_concat.xml   |  23 +++++
 .../encrypt/select_count_with_binding_tables.xml   |  23 +++++
 .../dql/dataset/encrypt/select_count_with_sub.xml  |  23 +++++
 .../select_count_with_sub_with_whitespace.xml      |  23 +++++
 .../dataset/encrypt/select_distinct_function.xml   | 102 +++++++++++++++++++
 .../dataset/encrypt/select_distinct_with_avg.xml   |  23 +++++
 .../dataset/encrypt/select_distinct_with_count.xml |  23 +++++
 .../select_distinct_with_count_calculation.xml     |  23 +++++
 .../select_distinct_with_count_group_by.xml        |  63 ++++++++++++
 .../encrypt/select_distinct_with_count_sum.xml     |  24 +++++
 .../encrypt/select_distinct_with_multi_column.xml  |  64 ++++++++++++
 ...distinct_with_multi_column_without_order_by.xml |  64 ++++++++++++
 .../encrypt/select_distinct_with_owner_column.xml  |  62 ++++++++++++
 ...distinct_with_owner_column_without_order_by.xml |  62 ++++++++++++
 .../encrypt/select_distinct_with_owner_star.xml    |  65 ++++++++++++
 ...t_distinct_with_owner_star_without_order_by.xml |  65 ++++++++++++
 .../encrypt/select_distinct_with_single_column.xml | 102 +++++++++++++++++++
 ...istinct_with_single_column_without_order_by.xml | 102 +++++++++++++++++++
 .../select_distinct_with_single_count_group_by.xml |  25 +++++
 .../dataset/encrypt/select_distinct_with_star.xml  |  61 ++++++++++++
 .../dataset/encrypt/select_distinct_with_sum.xml   |  23 +++++
 .../cases/dql/dataset/encrypt/select_encrypt.xml   |  27 +++++
 .../encrypt/select_equal_with_single_table.xml     |  25 +++++
 .../dataset/encrypt/select_for_broadcast_table.xml |  24 +++++
 .../dql/dataset/encrypt/select_for_left_join.xml   | 109 +++++++++++++++++++++
 .../dql/dataset/encrypt/select_for_update.xml      |  26 +++++
 .../select_full_route_with_binding_tables.xml      | 106 ++++++++++++++++++++
 .../dataset/encrypt/select_group_by_with_avg.xml   |  43 ++++++++
 .../dataset/encrypt/select_group_by_with_count.xml |  43 ++++++++
 ...ect_group_by_with_count_without_column_name.xml |  43 ++++++++
 .../encrypt/select_group_by_with_date_function.xml |  24 +++++
 .../select_group_by_with_key_word_alias.xml        |  43 ++++++++
 .../encrypt/select_group_by_with_keyword_alias.xml |  43 ++++++++
 .../dataset/encrypt/select_group_by_with_limit.xml |  23 +++++
 .../dataset/encrypt/select_group_by_with_max.xml   |  43 ++++++++
 .../dataset/encrypt/select_group_by_with_min.xml   |  43 ++++++++
 .../select_group_by_with_order_by_and_limit.xml    |  24 +++++
 .../encrypt/select_group_by_with_order_by_desc.xml |  43 ++++++++
 .../dataset/encrypt/select_group_by_with_sum.xml   |  43 ++++++++
 .../select_group_by_without_grouped_column.xml     |  24 +++++
 .../select_in_with_same_sharding_column.xml        |  25 +++++
 .../encrypt/select_in_with_single_table.xml        |  25 +++++
 .../dql/dataset/encrypt/select_inner_join.xml      |  28 ++++++
 .../dql/dataset/encrypt/select_join_encrypt.xml    |  44 +++++++++
 .../cases/dql/dataset/encrypt/select_max.xml       |  23 +++++
 .../cases/dql/dataset/encrypt/select_min.xml       |  23 +++++
 .../encrypt/select_not_equal_with_single_table.xml | 105 ++++++++++++++++++++
 .../encrypt/select_not_in_with_single_table.xml    | 105 ++++++++++++++++++++
 .../select_or_mix_and_for_complex_pattern.xml      |  26 +++++
 .../select_or_mix_and_for_simple_pattern.xml       |  26 +++++
 ...r_mix_and_with_binding_and_broadcast_tables.xml |  28 ++++++
 .../select_or_mix_and_with_binding_tables.xml      |  28 ++++++
 .../select_or_with_different_sharding_columns.xml  |  27 +++++
 .../select_or_with_none_sharding_columns.xml       |  64 ++++++++++++
 .../select_or_with_same_sharding_columns.xml       |  26 +++++
 .../encrypt/select_order_by_asc_and_index_desc.xml |  64 ++++++++++++
 .../encrypt/select_order_by_desc_and_index_asc.xml | 106 ++++++++++++++++++++
 .../select_order_by_with_alias_star_alias_name.xml |  64 ++++++++++++
 .../dataset/encrypt/select_order_by_with_date.xml  | 106 ++++++++++++++++++++
 .../select_order_by_with_multiple_stars.xml        |  68 +++++++++++++
 .../select_order_by_with_ordered_column.xml        |  62 ++++++++++++
 .../select_order_by_with_star_no_table_alias.xml   |  64 ++++++++++++
 .../select_order_by_with_star_table_alias.xml      |  64 ++++++++++++
 .../select_order_by_with_table_star_table_name.xml |  64 ++++++++++++
 ...order_by_with_table_star_without_table_name.xml | 109 +++++++++++++++++++++
 ..._pagination_with_diff_group_by_and_order_by.xml |  23 +++++
 ...elect_pagination_with_group_by_and_order_by.xml |  29 ++++++
 .../encrypt/select_pagination_with_offset.xml      |  28 ++++++
 .../select_pagination_with_offset_and_limit.xml    |  28 ++++++
 ...select_pagination_with_offset_and_row_count.xml |  28 ++++++
 .../select_pagination_with_offset_fetch.xml        |  44 +++++++++
 .../encrypt/select_pagination_with_row_count.xml   |  28 ++++++
 ...select_pagination_with_row_number_and_limit.xml |  28 ++++++
 ...elect_pagination_with_row_number_not_at_end.xml |  44 +++++++++
 .../select_pagination_with_top_and_limit.xml       |  28 ++++++
 .../select_sharding_route_with_binding_tables.xml  |  34 +++++++
 .../select_sharding_route_with_broadcast_table.xml |  30 ++++++
 .../encrypt/select_sub_query_with_group_by.xml     |  23 +++++
 .../select_sub_query_with_multiple_tables.xml      |  30 ++++++
 .../encrypt/select_sub_query_with_order_by.xml     |  23 +++++
 .../cases/dql/dataset/encrypt/select_sum.xml       |  23 +++++
 .../encrypt/select_with_case_expression.xml        |  27 +++++
 .../dataset/encrypt/select_with_date_function.xml  | 102 +++++++++++++++++++
 .../dql/dataset/encrypt/select_with_expression.xml |  62 ++++++++++++
 .../encrypt/select_with_force_index_join.xml       |  28 ++++++
 ...tem_alias_match_order_by_and_group_by_items.xml |  42 ++++++++
 .../dql/dataset/encrypt/select_with_regexp.xml     |  27 +++++
 98 files changed, 4315 insertions(+)

diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/mysql/select_avg.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/mysql/select_avg.xml
new file mode 100644
index 0000000..09ed1e3
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/mysql/select_avg.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id_avg" />
+    </metadata>
+    <row values="19.5000" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/mysql/select_group_by_with_avg.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/mysql/select_group_by_with_avg.xml
new file mode 100644
index 0000000..42155ad
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/mysql/select_group_by_with_avg.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_avg" />
+        <column name="user_id" />
+    </metadata>
+    <row values="1000.5000, 10" />
+    <row values="1100.5000, 11" />
+    <row values="1200.5000, 12" />
+    <row values="1300.5000, 13" />
+    <row values="1400.5000, 14" />
+    <row values="1500.5000, 15" />
+    <row values="1600.5000, 16" />
+    <row values="1700.5000, 17" />
+    <row values="1800.5000, 18" />
+    <row values="1900.5000, 19" />
+    <row values="2000.5000, 20" />
+    <row values="2100.5000, 21" />
+    <row values="2200.5000, 22" />
+    <row values="2300.5000, 23" />
+    <row values="2400.5000, 24" />
+    <row values="2500.5000, 25" />
+    <row values="2600.5000, 26" />
+    <row values="2700.5000, 27" />
+    <row values="2800.5000, 28" />
+    <row values="2900.5000, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_avg.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_avg.xml
new file mode 100644
index 0000000..392a96b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_avg.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id_avg" />
+    </metadata>
+    <row values="19.5000000000000000" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_count_tilde_concat.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_count_tilde_concat.xml
new file mode 100644
index 0000000..203f135
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_count_tilde_concat.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_count" />
+    </metadata>
+    <row values="4" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_group_by_with_avg.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_group_by_with_avg.xml
new file mode 100644
index 0000000..aca45cf
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/postgresql/select_group_by_with_avg.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_avg" />
+        <column name="user_id" />
+    </metadata>
+    <row values="1000.5000000000000000, 10" />
+    <row values="1100.5000000000000000, 11" />
+    <row values="1200.5000000000000000, 12" />
+    <row values="1300.5000000000000000, 13" />
+    <row values="1400.5000000000000000, 14" />
+    <row values="1500.5000000000000000, 15" />
+    <row values="1600.5000000000000000, 16" />
+    <row values="1700.5000000000000000, 17" />
+    <row values="1800.5000000000000000, 18" />
+    <row values="1900.5000000000000000, 19" />
+    <row values="2000.5000000000000000, 20" />
+    <row values="2100.5000000000000000, 21" />
+    <row values="2200.5000000000000000, 22" />
+    <row values="2300.5000000000000000, 23" />
+    <row values="2400.5000000000000000, 24" />
+    <row values="2500.5000000000000000, 25" />
+    <row values="2600.5000000000000000, 26" />
+    <row values="2700.5000000000000000, 27" />
+    <row values="2800.5000000000000000, 28" />
+    <row values="2900.5000000000000000, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_alias_as_keyword.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_alias_as_keyword.xml
new file mode 100644
index 0000000..3a6f279
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_alias_as_keyword.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="password" />
+    </metadata>
+    <row values="100001" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_alias_as_single_quote_string.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_alias_as_single_quote_string.xml
new file mode 100644
index 0000000..8ed9a25
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_alias_as_single_quote_string.xml
@@ -0,0 +1,62 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="status" />
+    </metadata>
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+    <row values="init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_avg.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_avg.xml
new file mode 100644
index 0000000..dc1016f
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_avg.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id_avg" />
+    </metadata>
+    <row values="19" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_between_with_single_table.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_between_with_single_table.xml
new file mode 100644
index 0000000..271171a
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_between_with_single_table.xml
@@ -0,0 +1,26 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_comparison_symbol_with_single_table.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_comparison_symbol_with_single_table.xml
new file mode 100644
index 0000000..271171a
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_comparison_symbol_with_single_table.xml
@@ -0,0 +1,26 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count.xml
new file mode 100644
index 0000000..079d25b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_count" />
+    </metadata>
+    <row values="40" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_like_concat.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_like_concat.xml
new file mode 100644
index 0000000..203f135
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_like_concat.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_count" />
+    </metadata>
+    <row values="4" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_binding_tables.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_binding_tables.xml
new file mode 100644
index 0000000..2284964
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_binding_tables.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="items_count" />
+    </metadata>
+    <row values="8" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_sub.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_sub.xml
new file mode 100644
index 0000000..079d25b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_sub.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_count" />
+    </metadata>
+    <row values="40" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_sub_with_whitespace.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_sub_with_whitespace.xml
new file mode 100644
index 0000000..079d25b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_count_with_sub_with_whitespace.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_count" />
+    </metadata>
+    <row values="40" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_function.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_function.xml
new file mode 100644
index 0000000..54c85b8
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_function.xml
@@ -0,0 +1,102 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+    </metadata>
+    <row values="100001" />
+    <row values="100002" />
+    <row values="100101" />
+    <row values="100102" />
+    <row values="110001" />
+    <row values="110002" />
+    <row values="110101" />
+    <row values="110102" />
+    <row values="120001" />
+    <row values="120002" />
+    <row values="120101" />
+    <row values="120102" />
+    <row values="130001" />
+    <row values="130002" />
+    <row values="130101" />
+    <row values="130102" />
+    <row values="140001" />
+    <row values="140002" />
+    <row values="140101" />
+    <row values="140102" />
+    <row values="150001" />
+    <row values="150002" />
+    <row values="150101" />
+    <row values="150102" />
+    <row values="160001" />
+    <row values="160002" />
+    <row values="160101" />
+    <row values="160102" />
+    <row values="170001" />
+    <row values="170002" />
+    <row values="170101" />
+    <row values="170102" />
+    <row values="180001" />
+    <row values="180002" />
+    <row values="180101" />
+    <row values="180102" />
+    <row values="190001" />
+    <row values="190002" />
+    <row values="190101" />
+    <row values="190102" />
+    <row values="200001" />
+    <row values="200002" />
+    <row values="200101" />
+    <row values="200102" />
+    <row values="210001" />
+    <row values="210002" />
+    <row values="210101" />
+    <row values="210102" />
+    <row values="220001" />
+    <row values="220002" />
+    <row values="220101" />
+    <row values="220102" />
+    <row values="230001" />
+    <row values="230002" />
+    <row values="230101" />
+    <row values="230102" />
+    <row values="240001" />
+    <row values="240002" />
+    <row values="240101" />
+    <row values="240102" />
+    <row values="250001" />
+    <row values="250002" />
+    <row values="250101" />
+    <row values="250102" />
+    <row values="260001" />
+    <row values="260002" />
+    <row values="260101" />
+    <row values="260102" />
+    <row values="270001" />
+    <row values="270002" />
+    <row values="270101" />
+    <row values="270102" />
+    <row values="280001" />
+    <row values="280002" />
+    <row values="280101" />
+    <row values="280102" />
+    <row values="290001" />
+    <row values="290002" />
+    <row values="290101" />
+    <row values="290102" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_avg.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_avg.xml
new file mode 100644
index 0000000..ad373fb
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_avg.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="avg(distinct order_id)" />
+    </metadata>
+    <row values="1000.5000" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count.xml
new file mode 100644
index 0000000..f241f1e
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="c" />
+    </metadata>
+    <row values="2" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_calculation.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_calculation.xml
new file mode 100644
index 0000000..f241f1e
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_calculation.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="c" />
+    </metadata>
+    <row values="2" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_group_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_group_by.xml
new file mode 100644
index 0000000..2c52036
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_group_by.xml
@@ -0,0 +1,63 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="c" />
+        <column name="order_id" />
+    </metadata>
+    <row values="1, 1000" />
+    <row values="1, 1001" />
+    <row values="1, 1100" />
+    <row values="1, 1101" />
+    <row values="1, 1200" />
+    <row values="1, 1201" />
+    <row values="1, 1300" />
+    <row values="1, 1301" />
+    <row values="1, 1400" />
+    <row values="1, 1401" />
+    <row values="1, 1500" />
+    <row values="1, 1501" />
+    <row values="1, 1600" />
+    <row values="1, 1601" />
+    <row values="1, 1700" />
+    <row values="1, 1701" />
+    <row values="1, 1800" />
+    <row values="1, 1801" />
+    <row values="1, 1900" />
+    <row values="1, 1901" />
+    <row values="1, 2000" />
+    <row values="1, 2001" />
+    <row values="1, 2100" />
+    <row values="1, 2101" />
+    <row values="1, 2200" />
+    <row values="1, 2201" />
+    <row values="1, 2300" />
+    <row values="1, 2301" />
+    <row values="1, 2400" />
+    <row values="1, 2401" />
+    <row values="1, 2500" />
+    <row values="1, 2501" />
+    <row values="1, 2600" />
+    <row values="1, 2601" />
+    <row values="1, 2700" />
+    <row values="1, 2701" />
+    <row values="1, 2800" />
+    <row values="1, 2801" />
+    <row values="1, 2900" />
+    <row values="1, 2901" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_sum.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_sum.xml
new file mode 100644
index 0000000..f096efa
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_count_sum.xml
@@ -0,0 +1,24 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="COUNT(DISTINCT order_id)" />
+        <column name="SUM(DISTINCT order_id)" />
+    </metadata>
+    <row values="2, 2001" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_multi_column.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_multi_column.xml
new file mode 100644
index 0000000..22fc2d9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_multi_column.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_multi_column_without_order_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_multi_column_without_order_by.xml
new file mode 100644
index 0000000..22fc2d9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_multi_column_without_order_by.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_column.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_column.xml
new file mode 100644
index 0000000..012d488
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_column.xml
@@ -0,0 +1,62 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+    </metadata>
+    <row values="1000" />
+    <row values="1001" />
+    <row values="1100" />
+    <row values="1101" />
+    <row values="1200" />
+    <row values="1201" />
+    <row values="1300" />
+    <row values="1301" />
+    <row values="1400" />
+    <row values="1401" />
+    <row values="1500" />
+    <row values="1501" />
+    <row values="1600" />
+    <row values="1601" />
+    <row values="1700" />
+    <row values="1701" />
+    <row values="1800" />
+    <row values="1801" />
+    <row values="1900" />
+    <row values="1901" />
+    <row values="2000" />
+    <row values="2001" />
+    <row values="2100" />
+    <row values="2101" />
+    <row values="2200" />
+    <row values="2201" />
+    <row values="2300" />
+    <row values="2301" />
+    <row values="2400" />
+    <row values="2401" />
+    <row values="2500" />
+    <row values="2501" />
+    <row values="2600" />
+    <row values="2601" />
+    <row values="2700" />
+    <row values="2701" />
+    <row values="2800" />
+    <row values="2801" />
+    <row values="2900" />
+    <row values="2901" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_column_without_order_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_column_without_order_by.xml
new file mode 100644
index 0000000..8f68615
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_column_without_order_by.xml
@@ -0,0 +1,62 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+    </metadata>
+    <row values="2401" />
+    <row values="1700" />
+    <row values="1701" />
+    <row values="1000" />
+    <row values="1001" />
+    <row values="2601" />
+    <row values="2600" />
+    <row values="1900" />
+    <row values="1901" />
+    <row values="1200" />
+    <row values="1201" />
+    <row values="2801" />
+    <row values="2800" />
+    <row values="2100" />
+    <row values="2101" />
+    <row values="1400" />
+    <row values="1401" />
+    <row values="2300" />
+    <row values="2301" />
+    <row values="1600" />
+    <row values="1601" />
+    <row values="2500" />
+    <row values="2501" />
+    <row values="1800" />
+    <row values="1801" />
+    <row values="1100" />
+    <row values="1101" />
+    <row values="2701" />
+    <row values="2700" />
+    <row values="2000" />
+    <row values="2001" />
+    <row values="1300" />
+    <row values="1301" />
+    <row values="2901" />
+    <row values="2900" />
+    <row values="2200" />
+    <row values="2201" />
+    <row values="1500" />
+    <row values="1501" />
+    <row values="2400" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_star.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_star.xml
new file mode 100644
index 0000000..d80468d
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_star.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="order_id" />
+    </metadata>
+    <row values="1000, 10, init, 1000" />
+    <row values="1001, 10, init, 1001" />
+    <row values="1100, 11, init, 1100" />
+    <row values="1101, 11, init, 1101" />
+    <row values="1200, 12, init, 1200" />
+    <row values="1201, 12, init, 1201" />
+    <row values="1300, 13, init, 1300" />
+    <row values="1301, 13, init, 1301" />
+    <row values="1400, 14, init, 1400" />
+    <row values="1401, 14, init, 1401" />
+    <row values="1500, 15, init, 1500" />
+    <row values="1501, 15, init, 1501" />
+    <row values="1600, 16, init, 1600" />
+    <row values="1601, 16, init, 1601" />
+    <row values="1700, 17, init, 1700" />
+    <row values="1701, 17, init, 1701" />
+    <row values="1800, 18, init, 1800" />
+    <row values="1801, 18, init, 1801" />
+    <row values="1900, 19, init, 1900" />
+    <row values="1901, 19, init, 1901" />
+    <row values="2000, 20, init, 2000" />
+    <row values="2001, 20, init, 2001" />
+    <row values="2100, 21, init, 2100" />
+    <row values="2101, 21, init, 2101" />
+    <row values="2200, 22, init, 2200" />
+    <row values="2201, 22, init, 2201" />
+    <row values="2300, 23, init, 2300" />
+    <row values="2301, 23, init, 2301" />
+    <row values="2400, 24, init, 2400" />
+    <row values="2401, 24, init, 2401" />
+    <row values="2500, 25, init, 2500" />
+    <row values="2501, 25, init, 2501" />
+    <row values="2600, 26, init, 2600" />
+    <row values="2601, 26, init, 2601" />
+    <row values="2700, 27, init, 2700" />
+    <row values="2701, 27, init, 2701" />
+    <row values="2800, 28, init, 2800" />
+    <row values="2801, 28, init, 2801" />
+    <row values="2900, 29, init, 2900" />
+    <row values="2901, 29, init, 2901" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_star_without_order_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_star_without_order_by.xml
new file mode 100644
index 0000000..e136455
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_owner_star_without_order_by.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="order_id" />
+    </metadata>
+    <row values="1001, 10, init, 1001" />
+    <row values="1101, 11, init, 1101" />
+    <row values="1201, 12, init, 1201" />
+    <row values="1301, 13, init, 1301" />
+    <row values="1401, 14, init, 1401" />
+    <row values="1501, 15, init, 1501" />
+    <row values="1601, 16, init, 1601" />
+    <row values="1701, 17, init, 1701" />
+    <row values="1801, 18, init, 1801" />
+    <row values="1901, 19, init, 1901" />
+    <row values="2001, 20, init, 2001" />
+    <row values="2101, 21, init, 2101" />
+    <row values="2201, 22, init, 2201" />
+    <row values="2301, 23, init, 2301" />
+    <row values="2401, 24, init, 2401" />
+    <row values="2501, 25, init, 2501" />
+    <row values="2601, 26, init, 2601" />
+    <row values="2701, 27, init, 2701" />
+    <row values="2801, 28, init, 2801" />
+    <row values="2901, 29, init, 2901" />
+    <row values="1000, 10, init, 1000" />
+    <row values="1100, 11, init, 1100" />
+    <row values="1200, 12, init, 1200" />
+    <row values="1300, 13, init, 1300" />
+    <row values="1400, 14, init, 1400" />
+    <row values="1500, 15, init, 1500" />
+    <row values="1600, 16, init, 1600" />
+    <row values="1700, 17, init, 1700" />
+    <row values="1800, 18, init, 1800" />
+    <row values="1900, 19, init, 1900" />
+    <row values="2000, 20, init, 2000" />
+    <row values="2100, 21, init, 2100" />
+    <row values="2200, 22, init, 2200" />
+    <row values="2300, 23, init, 2300" />
+    <row values="2400, 24, init, 2400" />
+    <row values="2500, 25, init, 2500" />
+    <row values="2600, 26, init, 2600" />
+    <row values="2700, 27, init, 2700" />
+    <row values="2800, 28, init, 2800" />
+    <row values="2900, 29, init, 2900" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_column.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_column.xml
new file mode 100644
index 0000000..54c85b8
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_column.xml
@@ -0,0 +1,102 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+    </metadata>
+    <row values="100001" />
+    <row values="100002" />
+    <row values="100101" />
+    <row values="100102" />
+    <row values="110001" />
+    <row values="110002" />
+    <row values="110101" />
+    <row values="110102" />
+    <row values="120001" />
+    <row values="120002" />
+    <row values="120101" />
+    <row values="120102" />
+    <row values="130001" />
+    <row values="130002" />
+    <row values="130101" />
+    <row values="130102" />
+    <row values="140001" />
+    <row values="140002" />
+    <row values="140101" />
+    <row values="140102" />
+    <row values="150001" />
+    <row values="150002" />
+    <row values="150101" />
+    <row values="150102" />
+    <row values="160001" />
+    <row values="160002" />
+    <row values="160101" />
+    <row values="160102" />
+    <row values="170001" />
+    <row values="170002" />
+    <row values="170101" />
+    <row values="170102" />
+    <row values="180001" />
+    <row values="180002" />
+    <row values="180101" />
+    <row values="180102" />
+    <row values="190001" />
+    <row values="190002" />
+    <row values="190101" />
+    <row values="190102" />
+    <row values="200001" />
+    <row values="200002" />
+    <row values="200101" />
+    <row values="200102" />
+    <row values="210001" />
+    <row values="210002" />
+    <row values="210101" />
+    <row values="210102" />
+    <row values="220001" />
+    <row values="220002" />
+    <row values="220101" />
+    <row values="220102" />
+    <row values="230001" />
+    <row values="230002" />
+    <row values="230101" />
+    <row values="230102" />
+    <row values="240001" />
+    <row values="240002" />
+    <row values="240101" />
+    <row values="240102" />
+    <row values="250001" />
+    <row values="250002" />
+    <row values="250101" />
+    <row values="250102" />
+    <row values="260001" />
+    <row values="260002" />
+    <row values="260101" />
+    <row values="260102" />
+    <row values="270001" />
+    <row values="270002" />
+    <row values="270101" />
+    <row values="270102" />
+    <row values="280001" />
+    <row values="280002" />
+    <row values="280101" />
+    <row values="280102" />
+    <row values="290001" />
+    <row values="290002" />
+    <row values="290101" />
+    <row values="290102" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_column_without_order_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_column_without_order_by.xml
new file mode 100644
index 0000000..54c85b8
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_column_without_order_by.xml
@@ -0,0 +1,102 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+    </metadata>
+    <row values="100001" />
+    <row values="100002" />
+    <row values="100101" />
+    <row values="100102" />
+    <row values="110001" />
+    <row values="110002" />
+    <row values="110101" />
+    <row values="110102" />
+    <row values="120001" />
+    <row values="120002" />
+    <row values="120101" />
+    <row values="120102" />
+    <row values="130001" />
+    <row values="130002" />
+    <row values="130101" />
+    <row values="130102" />
+    <row values="140001" />
+    <row values="140002" />
+    <row values="140101" />
+    <row values="140102" />
+    <row values="150001" />
+    <row values="150002" />
+    <row values="150101" />
+    <row values="150102" />
+    <row values="160001" />
+    <row values="160002" />
+    <row values="160101" />
+    <row values="160102" />
+    <row values="170001" />
+    <row values="170002" />
+    <row values="170101" />
+    <row values="170102" />
+    <row values="180001" />
+    <row values="180002" />
+    <row values="180101" />
+    <row values="180102" />
+    <row values="190001" />
+    <row values="190002" />
+    <row values="190101" />
+    <row values="190102" />
+    <row values="200001" />
+    <row values="200002" />
+    <row values="200101" />
+    <row values="200102" />
+    <row values="210001" />
+    <row values="210002" />
+    <row values="210101" />
+    <row values="210102" />
+    <row values="220001" />
+    <row values="220002" />
+    <row values="220101" />
+    <row values="220102" />
+    <row values="230001" />
+    <row values="230002" />
+    <row values="230101" />
+    <row values="230102" />
+    <row values="240001" />
+    <row values="240002" />
+    <row values="240101" />
+    <row values="240102" />
+    <row values="250001" />
+    <row values="250002" />
+    <row values="250101" />
+    <row values="250102" />
+    <row values="260001" />
+    <row values="260002" />
+    <row values="260101" />
+    <row values="260102" />
+    <row values="270001" />
+    <row values="270002" />
+    <row values="270101" />
+    <row values="270102" />
+    <row values="280001" />
+    <row values="280002" />
+    <row values="280101" />
+    <row values="280102" />
+    <row values="290001" />
+    <row values="290002" />
+    <row values="290101" />
+    <row values="290102" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_count_group_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_count_group_by.xml
new file mode 100644
index 0000000..e119001
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_single_count_group_by.xml
@@ -0,0 +1,25 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="c" />
+    </metadata>
+    <row values="1000, 1" />
+    <row values="1001, 1" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_star.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_star.xml
new file mode 100644
index 0000000..ea8a77c
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_star.xml
@@ -0,0 +1,61 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_sum.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_sum.xml
new file mode 100644
index 0000000..2234a3d
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_distinct_with_sum.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="s" />
+    </metadata>
+    <row values="2001" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_encrypt.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_encrypt.xml
new file mode 100644
index 0000000..996c92f
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_encrypt.xml
@@ -0,0 +1,27 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id" />
+        <column name="pwd" />
+    </metadata>
+    <row values="10, abc" />
+    <row values="11, def" />
+    <row values="12, hig" />
+    <row values="13, kli" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_equal_with_single_table.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_equal_with_single_table.xml
new file mode 100644
index 0000000..c932ff6
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_equal_with_single_table.xml
@@ -0,0 +1,25 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_broadcast_table.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_broadcast_table.xml
new file mode 100644
index 0000000..9185912
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_broadcast_table.xml
@@ -0,0 +1,24 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="id" />
+        <column name="status" />
+    </metadata>
+    <row values="1, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_left_join.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_left_join.xml
new file mode 100644
index 0000000..9e2a00f
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_left_join.xml
@@ -0,0 +1,109 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="1000, 10, init, 100001, 1000, 10, init, 2017-08-08" />
+    <row values="1000, 10, init, 100002, 1000, 10, init, 2017-08-08" />
+    <row values="1001, 10, init, 100101, 1001, 10, init, 2017-08-08" />
+    <row values="1001, 10, init, 100102, 1001, 10, init, 2017-08-08" />
+    <row values="1100, 11, init, 110001, 1100, 11, init, 2017-08-08" />
+    <row values="1100, 11, init, 110002, 1100, 11, init, 2017-08-08" />
+    <row values="1101, 11, init, 110101, 1101, 11, init, 2017-08-08" />
+    <row values="1101, 11, init, 110102, 1101, 11, init, 2017-08-08" />
+    <row values="1200, 12, init, 120001, 1200, 12, init, 2017-08-08" />
+    <row values="1200, 12, init, 120002, 1200, 12, init, 2017-08-08" />
+    <row values="1201, 12, init, 120101, 1201, 12, init, 2017-08-08" />
+    <row values="1201, 12, init, 120102, 1201, 12, init, 2017-08-08" />
+    <row values="1300, 13, init, 130001, 1300, 13, init, 2017-08-08" />
+    <row values="1300, 13, init, 130002, 1300, 13, init, 2017-08-08" />
+    <row values="1301, 13, init, 130101, 1301, 13, init, 2017-08-08" />
+    <row values="1301, 13, init, 130102, 1301, 13, init, 2017-08-08" />
+    <row values="1400, 14, init, 140001, 1400, 14, init, 2017-08-08" />
+    <row values="1400, 14, init, 140002, 1400, 14, init, 2017-08-08" />
+    <row values="1401, 14, init, 140101, 1401, 14, init, 2017-08-08" />
+    <row values="1401, 14, init, 140102, 1401, 14, init, 2017-08-08" />
+    <row values="1500, 15, init, 150001, 1500, 15, init, 2017-08-08" />
+    <row values="1500, 15, init, 150002, 1500, 15, init, 2017-08-08" />
+    <row values="1501, 15, init, 150101, 1501, 15, init, 2017-08-08" />
+    <row values="1501, 15, init, 150102, 1501, 15, init, 2017-08-08" />
+    <row values="1600, 16, init, 160001, 1600, 16, init, 2017-08-08" />
+    <row values="1600, 16, init, 160002, 1600, 16, init, 2017-08-08" />
+    <row values="1601, 16, init, 160101, 1601, 16, init, 2017-08-08" />
+    <row values="1601, 16, init, 160102, 1601, 16, init, 2017-08-08" />
+    <row values="1700, 17, init, 170001, 1700, 17, init, 2017-08-08" />
+    <row values="1700, 17, init, 170002, 1700, 17, init, 2017-08-08" />
+    <row values="1701, 17, init, 170101, 1701, 17, init, 2017-08-08" />
+    <row values="1701, 17, init, 170102, 1701, 17, init, 2017-08-08" />
+    <row values="1800, 18, init, 180001, 1800, 18, init, 2017-08-08" />
+    <row values="1800, 18, init, 180002, 1800, 18, init, 2017-08-08" />
+    <row values="1801, 18, init, 180101, 1801, 18, init, 2017-08-08" />
+    <row values="1801, 18, init, 180102, 1801, 18, init, 2017-08-08" />
+    <row values="1900, 19, init, 190001, 1900, 19, init, 2017-08-08" />
+    <row values="1900, 19, init, 190002, 1900, 19, init, 2017-08-08" />
+    <row values="1901, 19, init, 190101, 1901, 19, init, 2017-08-08" />
+    <row values="1901, 19, init, 190102, 1901, 19, init, 2017-08-08" />
+    <row values="2000, 20, init, 200001, 2000, 20, init, 2017-08-08" />
+    <row values="2000, 20, init, 200002, 2000, 20, init, 2017-08-08" />
+    <row values="2001, 20, init, 200101, 2001, 20, init, 2017-08-08" />
+    <row values="2001, 20, init, 200102, 2001, 20, init, 2017-08-08" />
+    <row values="2100, 21, init, 210001, 2100, 21, init, 2017-08-08" />
+    <row values="2100, 21, init, 210002, 2100, 21, init, 2017-08-08" />
+    <row values="2101, 21, init, 210101, 2101, 21, init, 2017-08-08" />
+    <row values="2101, 21, init, 210102, 2101, 21, init, 2017-08-08" />
+    <row values="2200, 22, init, 220001, 2200, 22, init, 2017-08-08" />
+    <row values="2200, 22, init, 220002, 2200, 22, init, 2017-08-08" />
+    <row values="2201, 22, init, 220101, 2201, 22, init, 2017-08-08" />
+    <row values="2201, 22, init, 220102, 2201, 22, init, 2017-08-08" />
+    <row values="2300, 23, init, 230001, 2300, 23, init, 2017-08-08" />
+    <row values="2300, 23, init, 230002, 2300, 23, init, 2017-08-08" />
+    <row values="2301, 23, init, 230101, 2301, 23, init, 2017-08-08" />
+    <row values="2301, 23, init, 230102, 2301, 23, init, 2017-08-08" />
+    <row values="2400, 24, init, 240001, 2400, 24, init, 2017-08-08" />
+    <row values="2400, 24, init, 240002, 2400, 24, init, 2017-08-08" />
+    <row values="2401, 24, init, 240101, 2401, 24, init, 2017-08-08" />
+    <row values="2401, 24, init, 240102, 2401, 24, init, 2017-08-08" />
+    <row values="2500, 25, init, 250001, 2500, 25, init, 2017-08-08" />
+    <row values="2500, 25, init, 250002, 2500, 25, init, 2017-08-08" />
+    <row values="2501, 25, init, 250101, 2501, 25, init, 2017-08-08" />
+    <row values="2501, 25, init, 250102, 2501, 25, init, 2017-08-08" />
+    <row values="2600, 26, init, 260001, 2600, 26, init, 2017-08-08" />
+    <row values="2600, 26, init, 260002, 2600, 26, init, 2017-08-08" />
+    <row values="2601, 26, init, 260101, 2601, 26, init, 2017-08-08" />
+    <row values="2601, 26, init, 260102, 2601, 26, init, 2017-08-08" />
+    <row values="2700, 27, init, 270001, 2700, 27, init, 2017-08-08" />
+    <row values="2700, 27, init, 270002, 2700, 27, init, 2017-08-08" />
+    <row values="2701, 27, init, 270101, 2701, 27, init, 2017-08-08" />
+    <row values="2701, 27, init, 270102, 2701, 27, init, 2017-08-08" />
+    <row values="2800, 28, init, 280001, 2800, 28, init, 2017-08-08" />
+    <row values="2800, 28, init, 280002, 2800, 28, init, 2017-08-08" />
+    <row values="2801, 28, init, 280101, 2801, 28, init, 2017-08-08" />
+    <row values="2801, 28, init, 280102, 2801, 28, init, 2017-08-08" />
+    <row values="2900, 29, init, 290001, 2900, 29, init, 2017-08-08" />
+    <row values="2900, 29, init, 290002, 2900, 29, init, 2017-08-08" />
+    <row values="2901, 29, init, 290101, 2901, 29, init, 2017-08-08" />
+    <row values="2901, 29, init, 290102, 2901, 29, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_update.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_update.xml
new file mode 100644
index 0000000..a21d9d1
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_for_update.xml
@@ -0,0 +1,26 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id"/>
+        <column name="user_id"/>
+        <column name="status"/>
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_full_route_with_binding_tables.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_full_route_with_binding_tables.xml
new file mode 100644
index 0000000..3ab6d68
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_full_route_with_binding_tables.xml
@@ -0,0 +1,106 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100001, 1000, 10, init, 2017-08-08" />
+    <row values="100002, 1000, 10, init, 2017-08-08" />
+    <row values="100101, 1001, 10, init, 2017-08-08" />
+    <row values="100102, 1001, 10, init, 2017-08-08" />
+    <row values="110001, 1100, 11, init, 2017-08-08" />
+    <row values="110002, 1100, 11, init, 2017-08-08" />
+    <row values="110101, 1101, 11, init, 2017-08-08" />
+    <row values="110102, 1101, 11, init, 2017-08-08" />
+    <row values="120001, 1200, 12, init, 2017-08-08" />
+    <row values="120002, 1200, 12, init, 2017-08-08" />
+    <row values="120101, 1201, 12, init, 2017-08-08" />
+    <row values="120102, 1201, 12, init, 2017-08-08" />
+    <row values="130001, 1300, 13, init, 2017-08-08" />
+    <row values="130002, 1300, 13, init, 2017-08-08" />
+    <row values="130101, 1301, 13, init, 2017-08-08" />
+    <row values="130102, 1301, 13, init, 2017-08-08" />
+    <row values="140001, 1400, 14, init, 2017-08-08" />
+    <row values="140002, 1400, 14, init, 2017-08-08" />
+    <row values="140101, 1401, 14, init, 2017-08-08" />
+    <row values="140102, 1401, 14, init, 2017-08-08" />
+    <row values="150001, 1500, 15, init, 2017-08-08" />
+    <row values="150002, 1500, 15, init, 2017-08-08" />
+    <row values="150101, 1501, 15, init, 2017-08-08" />
+    <row values="150102, 1501, 15, init, 2017-08-08" />
+    <row values="160001, 1600, 16, init, 2017-08-08" />
+    <row values="160002, 1600, 16, init, 2017-08-08" />
+    <row values="160101, 1601, 16, init, 2017-08-08" />
+    <row values="160102, 1601, 16, init, 2017-08-08" />
+    <row values="170001, 1700, 17, init, 2017-08-08" />
+    <row values="170002, 1700, 17, init, 2017-08-08" />
+    <row values="170101, 1701, 17, init, 2017-08-08" />
+    <row values="170102, 1701, 17, init, 2017-08-08" />
+    <row values="180001, 1800, 18, init, 2017-08-08" />
+    <row values="180002, 1800, 18, init, 2017-08-08" />
+    <row values="180101, 1801, 18, init, 2017-08-08" />
+    <row values="180102, 1801, 18, init, 2017-08-08" />
+    <row values="190001, 1900, 19, init, 2017-08-08" />
+    <row values="190002, 1900, 19, init, 2017-08-08" />
+    <row values="190101, 1901, 19, init, 2017-08-08" />
+    <row values="190102, 1901, 19, init, 2017-08-08" />
+    <row values="200001, 2000, 20, init, 2017-08-08" />
+    <row values="200002, 2000, 20, init, 2017-08-08" />
+    <row values="200101, 2001, 20, init, 2017-08-08" />
+    <row values="200102, 2001, 20, init, 2017-08-08" />
+    <row values="210001, 2100, 21, init, 2017-08-08" />
+    <row values="210002, 2100, 21, init, 2017-08-08" />
+    <row values="210101, 2101, 21, init, 2017-08-08" />
+    <row values="210102, 2101, 21, init, 2017-08-08" />
+    <row values="220001, 2200, 22, init, 2017-08-08" />
+    <row values="220002, 2200, 22, init, 2017-08-08" />
+    <row values="220101, 2201, 22, init, 2017-08-08" />
+    <row values="220102, 2201, 22, init, 2017-08-08" />
+    <row values="230001, 2300, 23, init, 2017-08-08" />
+    <row values="230002, 2300, 23, init, 2017-08-08" />
+    <row values="230101, 2301, 23, init, 2017-08-08" />
+    <row values="230102, 2301, 23, init, 2017-08-08" />
+    <row values="240001, 2400, 24, init, 2017-08-08" />
+    <row values="240002, 2400, 24, init, 2017-08-08" />
+    <row values="240101, 2401, 24, init, 2017-08-08" />
+    <row values="240102, 2401, 24, init, 2017-08-08" />
+    <row values="250001, 2500, 25, init, 2017-08-08" />
+    <row values="250002, 2500, 25, init, 2017-08-08" />
+    <row values="250101, 2501, 25, init, 2017-08-08" />
+    <row values="250102, 2501, 25, init, 2017-08-08" />
+    <row values="260001, 2600, 26, init, 2017-08-08" />
+    <row values="260002, 2600, 26, init, 2017-08-08" />
+    <row values="260101, 2601, 26, init, 2017-08-08" />
+    <row values="260102, 2601, 26, init, 2017-08-08" />
+    <row values="270001, 2700, 27, init, 2017-08-08" />
+    <row values="270002, 2700, 27, init, 2017-08-08" />
+    <row values="270101, 2701, 27, init, 2017-08-08" />
+    <row values="270102, 2701, 27, init, 2017-08-08" />
+    <row values="280001, 2800, 28, init, 2017-08-08" />
+    <row values="280002, 2800, 28, init, 2017-08-08" />
+    <row values="280101, 2801, 28, init, 2017-08-08" />
+    <row values="280102, 2801, 28, init, 2017-08-08" />
+    <row values="290001, 2900, 29, init, 2017-08-08" />
+    <row values="290002, 2900, 29, init, 2017-08-08" />
+    <row values="290101, 2901, 29, init, 2017-08-08" />
+    <row values="290102, 2901, 29, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_avg.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_avg.xml
new file mode 100644
index 0000000..8e22670
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_avg.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_avg" />
+        <column name="user_id" />
+    </metadata>
+    <row values="1000, 10" />
+    <row values="1100, 11" />
+    <row values="1200, 12" />
+    <row values="1300, 13" />
+    <row values="1400, 14" />
+    <row values="1500, 15" />
+    <row values="1600, 16" />
+    <row values="1700, 17" />
+    <row values="1800, 18" />
+    <row values="1900, 19" />
+    <row values="2000, 20" />
+    <row values="2100, 21" />
+    <row values="2200, 22" />
+    <row values="2300, 23" />
+    <row values="2400, 24" />
+    <row values="2500, 25" />
+    <row values="2600, 26" />
+    <row values="2700, 27" />
+    <row values="2800, 28" />
+    <row values="2900, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_count.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_count.xml
new file mode 100644
index 0000000..120c975
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_count.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_count" />
+        <column name="user_id" />
+    </metadata>
+    <row values="2, 10" />
+    <row values="2, 11" />
+    <row values="2, 12" />
+    <row values="2, 13" />
+    <row values="2, 14" />
+    <row values="2, 15" />
+    <row values="2, 16" />
+    <row values="2, 17" />
+    <row values="2, 18" />
+    <row values="2, 19" />
+    <row values="2, 20" />
+    <row values="2, 21" />
+    <row values="2, 22" />
+    <row values="2, 23" />
+    <row values="2, 24" />
+    <row values="2, 25" />
+    <row values="2, 26" />
+    <row values="2, 27" />
+    <row values="2, 28" />
+    <row values="2, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_count_without_column_name.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_count_without_column_name.xml
new file mode 100644
index 0000000..120c975
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_count_without_column_name.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_count" />
+        <column name="user_id" />
+    </metadata>
+    <row values="2, 10" />
+    <row values="2, 11" />
+    <row values="2, 12" />
+    <row values="2, 13" />
+    <row values="2, 14" />
+    <row values="2, 15" />
+    <row values="2, 16" />
+    <row values="2, 17" />
+    <row values="2, 18" />
+    <row values="2, 19" />
+    <row values="2, 20" />
+    <row values="2, 21" />
+    <row values="2, 22" />
+    <row values="2, 23" />
+    <row values="2, 24" />
+    <row values="2, 25" />
+    <row values="2, 26" />
+    <row values="2, 27" />
+    <row values="2, 28" />
+    <row values="2, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_date_function.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_date_function.xml
new file mode 100644
index 0000000..c59be32
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_date_function.xml
@@ -0,0 +1,24 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="creation_date" />
+        <column name="c_number" />
+    </metadata>
+    <row values="%y-%m-%d, 4" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_key_word_alias.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_key_word_alias.xml
new file mode 100644
index 0000000..2d9f6e2
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_key_word_alias.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_sum" />
+        <column name="key" />
+    </metadata>
+    <row values="2001, 10" />
+    <row values="2201, 11" />
+    <row values="2401, 12" />
+    <row values="2601, 13" />
+    <row values="2801, 14" />
+    <row values="3001, 15" />
+    <row values="3201, 16" />
+    <row values="3401, 17" />
+    <row values="3601, 18" />
+    <row values="3801, 19" />
+    <row values="4001, 20" />
+    <row values="4201, 21" />
+    <row values="4401, 22" />
+    <row values="4601, 23" />
+    <row values="4801, 24" />
+    <row values="5001, 25" />
+    <row values="5201, 26" />
+    <row values="5401, 27" />
+    <row values="5601, 28" />
+    <row values="5801, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_keyword_alias.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_keyword_alias.xml
new file mode 100644
index 0000000..2d9f6e2
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_keyword_alias.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_sum" />
+        <column name="key" />
+    </metadata>
+    <row values="2001, 10" />
+    <row values="2201, 11" />
+    <row values="2401, 12" />
+    <row values="2601, 13" />
+    <row values="2801, 14" />
+    <row values="3001, 15" />
+    <row values="3201, 16" />
+    <row values="3401, 17" />
+    <row values="3601, 18" />
+    <row values="3801, 19" />
+    <row values="4001, 20" />
+    <row values="4201, 21" />
+    <row values="4401, 22" />
+    <row values="4601, 23" />
+    <row values="4801, 24" />
+    <row values="5001, 25" />
+    <row values="5201, 26" />
+    <row values="5401, 27" />
+    <row values="5601, 28" />
+    <row values="5801, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_limit.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_limit.xml
new file mode 100644
index 0000000..30cd3db
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_limit.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id" />
+    </metadata>
+    <row values="10" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_max.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_max.xml
new file mode 100644
index 0000000..7dc6443
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_max.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="max_order_id" />
+        <column name="user_id" />
+    </metadata>
+    <row values="1001, 10" />
+    <row values="1101, 11" />
+    <row values="1201, 12" />
+    <row values="1301, 13" />
+    <row values="1401, 14" />
+    <row values="1501, 15" />
+    <row values="1601, 16" />
+    <row values="1701, 17" />
+    <row values="1801, 18" />
+    <row values="1901, 19" />
+    <row values="2001, 20" />
+    <row values="2101, 21" />
+    <row values="2201, 22" />
+    <row values="2301, 23" />
+    <row values="2401, 24" />
+    <row values="2501, 25" />
+    <row values="2601, 26" />
+    <row values="2701, 27" />
+    <row values="2801, 28" />
+    <row values="2901, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_min.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_min.xml
new file mode 100644
index 0000000..1469012
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_min.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="min_order_id" />
+        <column name="user_id" />
+    </metadata>
+    <row values="1000, 10" />
+    <row values="1100, 11" />
+    <row values="1200, 12" />
+    <row values="1300, 13" />
+    <row values="1400, 14" />
+    <row values="1500, 15" />
+    <row values="1600, 16" />
+    <row values="1700, 17" />
+    <row values="1800, 18" />
+    <row values="1900, 19" />
+    <row values="2000, 20" />
+    <row values="2100, 21" />
+    <row values="2200, 22" />
+    <row values="2300, 23" />
+    <row values="2400, 24" />
+    <row values="2500, 25" />
+    <row values="2600, 26" />
+    <row values="2700, 27" />
+    <row values="2800, 28" />
+    <row values="2900, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_order_by_and_limit.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_order_by_and_limit.xml
new file mode 100644
index 0000000..5af65bf
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_order_by_and_limit.xml
@@ -0,0 +1,24 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id" />
+        <column name="orders_sum" />
+    </metadata>
+    <row values="10, 2001" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_order_by_desc.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_order_by_desc.xml
new file mode 100644
index 0000000..03bfffd
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_order_by_desc.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_sum" />
+        <column name="user_id" />
+    </metadata>
+    <row values="5801, 29" />
+    <row values="5601, 28" />
+    <row values="5401, 27" />
+    <row values="5201, 26" />
+    <row values="5001, 25" />
+    <row values="4801, 24" />
+    <row values="4601, 23" />
+    <row values="4401, 22" />
+    <row values="4201, 21" />
+    <row values="4001, 20" />
+    <row values="3801, 19" />
+    <row values="3601, 18" />
+    <row values="3401, 17" />
+    <row values="3201, 16" />
+    <row values="3001, 15" />
+    <row values="2801, 14" />
+    <row values="2601, 13" />
+    <row values="2401, 12" />
+    <row values="2201, 11" />
+    <row values="2001, 10" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_sum.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_sum.xml
new file mode 100644
index 0000000..323ec53
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_with_sum.xml
@@ -0,0 +1,43 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_sum" />
+        <column name="user_id" />
+    </metadata>
+    <row values="2001, 10" />
+    <row values="2201, 11" />
+    <row values="2401, 12" />
+    <row values="2601, 13" />
+    <row values="2801, 14" />
+    <row values="3001, 15" />
+    <row values="3201, 16" />
+    <row values="3401, 17" />
+    <row values="3601, 18" />
+    <row values="3801, 19" />
+    <row values="4001, 20" />
+    <row values="4201, 21" />
+    <row values="4401, 22" />
+    <row values="4601, 23" />
+    <row values="4801, 24" />
+    <row values="5001, 25" />
+    <row values="5201, 26" />
+    <row values="5401, 27" />
+    <row values="5601, 28" />
+    <row values="5801, 29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_without_grouped_column.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_without_grouped_column.xml
new file mode 100644
index 0000000..cf77b81
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_group_by_without_grouped_column.xml
@@ -0,0 +1,24 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="items_count" />
+    </metadata>
+    <row values="4" />
+    <row values="4" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_in_with_same_sharding_column.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_in_with_same_sharding_column.xml
new file mode 100644
index 0000000..2601910
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_in_with_same_sharding_column.xml
@@ -0,0 +1,25 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1001, 10, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_in_with_single_table.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_in_with_single_table.xml
new file mode 100644
index 0000000..c932ff6
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_in_with_single_table.xml
@@ -0,0 +1,25 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_inner_join.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_inner_join.xml
new file mode 100644
index 0000000..81da80c
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_inner_join.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100001, 1000, 10, init, 2017-08-08" />
+    <row values="100002, 1000, 10, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_join_encrypt.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_join_encrypt.xml
new file mode 100644
index 0000000..5a8078e
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_join_encrypt.xml
@@ -0,0 +1,44 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id" />
+        <column name="pwd" />
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="10, abc, 100001, 1000, 10, init, 2017-08-08" />
+    <row values="10, abc, 100002, 1000, 10, init, 2017-08-08" />
+    <row values="10, abc, 100101, 1001, 10, init, 2017-08-08" />
+    <row values="10, abc, 100102, 1001, 10, init, 2017-08-08" />
+    <row values="11, def, 110001, 1100, 11, init, 2017-08-08" />
+    <row values="11, def, 110002, 1100, 11, init, 2017-08-08" />
+    <row values="11, def, 110101, 1101, 11, init, 2017-08-08" />
+    <row values="11, def, 110102, 1101, 11, init, 2017-08-08" />
+    <row values="12, hig, 120001, 1200, 12, init, 2017-08-08" />
+    <row values="12, hig, 120002, 1200, 12, init, 2017-08-08" />
+    <row values="12, hig, 120101, 1201, 12, init, 2017-08-08" />
+    <row values="12, hig, 120102, 1201, 12, init, 2017-08-08" />
+    <row values="13, hig, 130001, 1300, 13, init, 2017-08-08" />
+    <row values="13, hig, 130002, 1300, 13, init, 2017-08-08" />
+    <row values="13, hig, 130101, 1301, 13, init, 2017-08-08" />
+    <row values="13, hig, 130102, 1301, 13, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_max.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_max.xml
new file mode 100644
index 0000000..e2ba7c3
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_max.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="max_user_id" />
+    </metadata>
+    <row values="29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_min.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_min.xml
new file mode 100644
index 0000000..440694b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_min.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="min_user_id" />
+    </metadata>
+    <row values="10" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_not_equal_with_single_table.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_not_equal_with_single_table.xml
new file mode 100644
index 0000000..7da19ef
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_not_equal_with_single_table.xml
@@ -0,0 +1,105 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100002, 1000, 10, init, 2017-08-08" />
+    <row values="100101, 1001, 10, init, 2017-08-08" />
+    <row values="100102, 1001, 10, init, 2017-08-08" />
+    <row values="110001, 1100, 11, init, 2017-08-08" />
+    <row values="110002, 1100, 11, init, 2017-08-08" />
+    <row values="110101, 1101, 11, init, 2017-08-08" />
+    <row values="110102, 1101, 11, init, 2017-08-08" />
+    <row values="120001, 1200, 12, init, 2017-08-08" />
+    <row values="120002, 1200, 12, init, 2017-08-08" />
+    <row values="120101, 1201, 12, init, 2017-08-08" />
+    <row values="120102, 1201, 12, init, 2017-08-08" />
+    <row values="130001, 1300, 13, init, 2017-08-08" />
+    <row values="130002, 1300, 13, init, 2017-08-08" />
+    <row values="130101, 1301, 13, init, 2017-08-08" />
+    <row values="130102, 1301, 13, init, 2017-08-08" />
+    <row values="140001, 1400, 14, init, 2017-08-08" />
+    <row values="140002, 1400, 14, init, 2017-08-08" />
+    <row values="140101, 1401, 14, init, 2017-08-08" />
+    <row values="140102, 1401, 14, init, 2017-08-08" />
+    <row values="150001, 1500, 15, init, 2017-08-08" />
+    <row values="150002, 1500, 15, init, 2017-08-08" />
+    <row values="150101, 1501, 15, init, 2017-08-08" />
+    <row values="150102, 1501, 15, init, 2017-08-08" />
+    <row values="160001, 1600, 16, init, 2017-08-08" />
+    <row values="160002, 1600, 16, init, 2017-08-08" />
+    <row values="160101, 1601, 16, init, 2017-08-08" />
+    <row values="160102, 1601, 16, init, 2017-08-08" />
+    <row values="170001, 1700, 17, init, 2017-08-08" />
+    <row values="170002, 1700, 17, init, 2017-08-08" />
+    <row values="170101, 1701, 17, init, 2017-08-08" />
+    <row values="170102, 1701, 17, init, 2017-08-08" />
+    <row values="180001, 1800, 18, init, 2017-08-08" />
+    <row values="180002, 1800, 18, init, 2017-08-08" />
+    <row values="180101, 1801, 18, init, 2017-08-08" />
+    <row values="180102, 1801, 18, init, 2017-08-08" />
+    <row values="190001, 1900, 19, init, 2017-08-08" />
+    <row values="190002, 1900, 19, init, 2017-08-08" />
+    <row values="190101, 1901, 19, init, 2017-08-08" />
+    <row values="190102, 1901, 19, init, 2017-08-08" />
+    <row values="200001, 2000, 20, init, 2017-08-08" />
+    <row values="200002, 2000, 20, init, 2017-08-08" />
+    <row values="200101, 2001, 20, init, 2017-08-08" />
+    <row values="200102, 2001, 20, init, 2017-08-08" />
+    <row values="210001, 2100, 21, init, 2017-08-08" />
+    <row values="210002, 2100, 21, init, 2017-08-08" />
+    <row values="210101, 2101, 21, init, 2017-08-08" />
+    <row values="210102, 2101, 21, init, 2017-08-08" />
+    <row values="220001, 2200, 22, init, 2017-08-08" />
+    <row values="220002, 2200, 22, init, 2017-08-08" />
+    <row values="220101, 2201, 22, init, 2017-08-08" />
+    <row values="220102, 2201, 22, init, 2017-08-08" />
+    <row values="230001, 2300, 23, init, 2017-08-08" />
+    <row values="230002, 2300, 23, init, 2017-08-08" />
+    <row values="230101, 2301, 23, init, 2017-08-08" />
+    <row values="230102, 2301, 23, init, 2017-08-08" />
+    <row values="240001, 2400, 24, init, 2017-08-08" />
+    <row values="240002, 2400, 24, init, 2017-08-08" />
+    <row values="240101, 2401, 24, init, 2017-08-08" />
+    <row values="240102, 2401, 24, init, 2017-08-08" />
+    <row values="250001, 2500, 25, init, 2017-08-08" />
+    <row values="250002, 2500, 25, init, 2017-08-08" />
+    <row values="250101, 2501, 25, init, 2017-08-08" />
+    <row values="250102, 2501, 25, init, 2017-08-08" />
+    <row values="260001, 2600, 26, init, 2017-08-08" />
+    <row values="260002, 2600, 26, init, 2017-08-08" />
+    <row values="260101, 2601, 26, init, 2017-08-08" />
+    <row values="260102, 2601, 26, init, 2017-08-08" />
+    <row values="270001, 2700, 27, init, 2017-08-08" />
+    <row values="270002, 2700, 27, init, 2017-08-08" />
+    <row values="270101, 2701, 27, init, 2017-08-08" />
+    <row values="270102, 2701, 27, init, 2017-08-08" />
+    <row values="280001, 2800, 28, init, 2017-08-08" />
+    <row values="280002, 2800, 28, init, 2017-08-08" />
+    <row values="280101, 2801, 28, init, 2017-08-08" />
+    <row values="280102, 2801, 28, init, 2017-08-08" />
+    <row values="290001, 2900, 29, init, 2017-08-08" />
+    <row values="290002, 2900, 29, init, 2017-08-08" />
+    <row values="290101, 2901, 29, init, 2017-08-08" />
+    <row values="290102, 2901, 29, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_not_in_with_single_table.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_not_in_with_single_table.xml
new file mode 100644
index 0000000..7da19ef
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_not_in_with_single_table.xml
@@ -0,0 +1,105 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100002, 1000, 10, init, 2017-08-08" />
+    <row values="100101, 1001, 10, init, 2017-08-08" />
+    <row values="100102, 1001, 10, init, 2017-08-08" />
+    <row values="110001, 1100, 11, init, 2017-08-08" />
+    <row values="110002, 1100, 11, init, 2017-08-08" />
+    <row values="110101, 1101, 11, init, 2017-08-08" />
+    <row values="110102, 1101, 11, init, 2017-08-08" />
+    <row values="120001, 1200, 12, init, 2017-08-08" />
+    <row values="120002, 1200, 12, init, 2017-08-08" />
+    <row values="120101, 1201, 12, init, 2017-08-08" />
+    <row values="120102, 1201, 12, init, 2017-08-08" />
+    <row values="130001, 1300, 13, init, 2017-08-08" />
+    <row values="130002, 1300, 13, init, 2017-08-08" />
+    <row values="130101, 1301, 13, init, 2017-08-08" />
+    <row values="130102, 1301, 13, init, 2017-08-08" />
+    <row values="140001, 1400, 14, init, 2017-08-08" />
+    <row values="140002, 1400, 14, init, 2017-08-08" />
+    <row values="140101, 1401, 14, init, 2017-08-08" />
+    <row values="140102, 1401, 14, init, 2017-08-08" />
+    <row values="150001, 1500, 15, init, 2017-08-08" />
+    <row values="150002, 1500, 15, init, 2017-08-08" />
+    <row values="150101, 1501, 15, init, 2017-08-08" />
+    <row values="150102, 1501, 15, init, 2017-08-08" />
+    <row values="160001, 1600, 16, init, 2017-08-08" />
+    <row values="160002, 1600, 16, init, 2017-08-08" />
+    <row values="160101, 1601, 16, init, 2017-08-08" />
+    <row values="160102, 1601, 16, init, 2017-08-08" />
+    <row values="170001, 1700, 17, init, 2017-08-08" />
+    <row values="170002, 1700, 17, init, 2017-08-08" />
+    <row values="170101, 1701, 17, init, 2017-08-08" />
+    <row values="170102, 1701, 17, init, 2017-08-08" />
+    <row values="180001, 1800, 18, init, 2017-08-08" />
+    <row values="180002, 1800, 18, init, 2017-08-08" />
+    <row values="180101, 1801, 18, init, 2017-08-08" />
+    <row values="180102, 1801, 18, init, 2017-08-08" />
+    <row values="190001, 1900, 19, init, 2017-08-08" />
+    <row values="190002, 1900, 19, init, 2017-08-08" />
+    <row values="190101, 1901, 19, init, 2017-08-08" />
+    <row values="190102, 1901, 19, init, 2017-08-08" />
+    <row values="200001, 2000, 20, init, 2017-08-08" />
+    <row values="200002, 2000, 20, init, 2017-08-08" />
+    <row values="200101, 2001, 20, init, 2017-08-08" />
+    <row values="200102, 2001, 20, init, 2017-08-08" />
+    <row values="210001, 2100, 21, init, 2017-08-08" />
+    <row values="210002, 2100, 21, init, 2017-08-08" />
+    <row values="210101, 2101, 21, init, 2017-08-08" />
+    <row values="210102, 2101, 21, init, 2017-08-08" />
+    <row values="220001, 2200, 22, init, 2017-08-08" />
+    <row values="220002, 2200, 22, init, 2017-08-08" />
+    <row values="220101, 2201, 22, init, 2017-08-08" />
+    <row values="220102, 2201, 22, init, 2017-08-08" />
+    <row values="230001, 2300, 23, init, 2017-08-08" />
+    <row values="230002, 2300, 23, init, 2017-08-08" />
+    <row values="230101, 2301, 23, init, 2017-08-08" />
+    <row values="230102, 2301, 23, init, 2017-08-08" />
+    <row values="240001, 2400, 24, init, 2017-08-08" />
+    <row values="240002, 2400, 24, init, 2017-08-08" />
+    <row values="240101, 2401, 24, init, 2017-08-08" />
+    <row values="240102, 2401, 24, init, 2017-08-08" />
+    <row values="250001, 2500, 25, init, 2017-08-08" />
+    <row values="250002, 2500, 25, init, 2017-08-08" />
+    <row values="250101, 2501, 25, init, 2017-08-08" />
+    <row values="250102, 2501, 25, init, 2017-08-08" />
+    <row values="260001, 2600, 26, init, 2017-08-08" />
+    <row values="260002, 2600, 26, init, 2017-08-08" />
+    <row values="260101, 2601, 26, init, 2017-08-08" />
+    <row values="260102, 2601, 26, init, 2017-08-08" />
+    <row values="270001, 2700, 27, init, 2017-08-08" />
+    <row values="270002, 2700, 27, init, 2017-08-08" />
+    <row values="270101, 2701, 27, init, 2017-08-08" />
+    <row values="270102, 2701, 27, init, 2017-08-08" />
+    <row values="280001, 2800, 28, init, 2017-08-08" />
+    <row values="280002, 2800, 28, init, 2017-08-08" />
+    <row values="280101, 2801, 28, init, 2017-08-08" />
+    <row values="280102, 2801, 28, init, 2017-08-08" />
+    <row values="290001, 2900, 29, init, 2017-08-08" />
+    <row values="290002, 2900, 29, init, 2017-08-08" />
+    <row values="290101, 2901, 29, init, 2017-08-08" />
+    <row values="290102, 2901, 29, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_for_complex_pattern.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_for_complex_pattern.xml
new file mode 100644
index 0000000..a5abc21
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_for_complex_pattern.xml
@@ -0,0 +1,26 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1100, 11, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_for_simple_pattern.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_for_simple_pattern.xml
new file mode 100644
index 0000000..271171a
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_for_simple_pattern.xml
@@ -0,0 +1,26 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_with_binding_and_broadcast_tables.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_with_binding_and_broadcast_tables.xml
new file mode 100644
index 0000000..6f8f6ad
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_with_binding_and_broadcast_tables.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="110001, 1100, 11, init, 2017-08-08"/>
+    <row values="110002, 1100, 11, init, 2017-08-08"/>
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_with_binding_tables.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_with_binding_tables.xml
new file mode 100644
index 0000000..ae575d5
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_mix_and_with_binding_tables.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="110001, 1100, 11, init, 2017-08-08" />
+    <row values="110002, 1100, 11, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_different_sharding_columns.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_different_sharding_columns.xml
new file mode 100644
index 0000000..3c9aebf
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_different_sharding_columns.xml
@@ -0,0 +1,27 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_none_sharding_columns.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_none_sharding_columns.xml
new file mode 100644
index 0000000..22fc2d9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_none_sharding_columns.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_same_sharding_columns.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_same_sharding_columns.xml
new file mode 100644
index 0000000..2d0575a
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_or_with_same_sharding_columns.xml
@@ -0,0 +1,26 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_asc_and_index_desc.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_asc_and_index_desc.xml
new file mode 100644
index 0000000..22fc2d9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_asc_and_index_desc.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_desc_and_index_asc.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_desc_and_index_asc.xml
new file mode 100644
index 0000000..de39b75
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_desc_and_index_asc.xml
@@ -0,0 +1,106 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="290101, 2901, 29, init, 2017-08-08"/>
+    <row values="290102, 2901, 29, init, 2017-08-08"/>
+    <row values="290001, 2900, 29, init, 2017-08-08"/>
+    <row values="290002, 2900, 29, init, 2017-08-08"/>
+    <row values="280101, 2801, 28, init, 2017-08-08"/>
+    <row values="280102, 2801, 28, init, 2017-08-08"/>
+    <row values="280001, 2800, 28, init, 2017-08-08"/>
+    <row values="280002, 2800, 28, init, 2017-08-08"/>
+    <row values="270101, 2701, 27, init, 2017-08-08"/>
+    <row values="270102, 2701, 27, init, 2017-08-08"/>
+    <row values="270001, 2700, 27, init, 2017-08-08"/>
+    <row values="270002, 2700, 27, init, 2017-08-08"/>
+    <row values="260101, 2601, 26, init, 2017-08-08"/>
+    <row values="260102, 2601, 26, init, 2017-08-08"/>
+    <row values="260001, 2600, 26, init, 2017-08-08"/>
+    <row values="260002, 2600, 26, init, 2017-08-08"/>
+    <row values="250101, 2501, 25, init, 2017-08-08"/>
+    <row values="250102, 2501, 25, init, 2017-08-08"/>
+    <row values="250001, 2500, 25, init, 2017-08-08"/>
+    <row values="250002, 2500, 25, init, 2017-08-08"/>
+    <row values="240101, 2401, 24, init, 2017-08-08"/>
+    <row values="240102, 2401, 24, init, 2017-08-08"/>
+    <row values="240001, 2400, 24, init, 2017-08-08"/>
+    <row values="240002, 2400, 24, init, 2017-08-08"/>
+    <row values="230101, 2301, 23, init, 2017-08-08"/>
+    <row values="230102, 2301, 23, init, 2017-08-08"/>
+    <row values="230001, 2300, 23, init, 2017-08-08"/>
+    <row values="230002, 2300, 23, init, 2017-08-08"/>
+    <row values="220101, 2201, 22, init, 2017-08-08"/>
+    <row values="220102, 2201, 22, init, 2017-08-08"/>
+    <row values="220001, 2200, 22, init, 2017-08-08"/>
+    <row values="220002, 2200, 22, init, 2017-08-08"/>
+    <row values="210101, 2101, 21, init, 2017-08-08"/>
+    <row values="210102, 2101, 21, init, 2017-08-08"/>
+    <row values="210001, 2100, 21, init, 2017-08-08"/>
+    <row values="210002, 2100, 21, init, 2017-08-08"/>
+    <row values="200101, 2001, 20, init, 2017-08-08"/>
+    <row values="200102, 2001, 20, init, 2017-08-08"/>
+    <row values="200001, 2000, 20, init, 2017-08-08"/>
+    <row values="200002, 2000, 20, init, 2017-08-08"/>
+    <row values="190101, 1901, 19, init, 2017-08-08"/>
+    <row values="190102, 1901, 19, init, 2017-08-08"/>
+    <row values="190001, 1900, 19, init, 2017-08-08"/>
+    <row values="190002, 1900, 19, init, 2017-08-08"/>
+    <row values="180101, 1801, 18, init, 2017-08-08"/>
+    <row values="180102, 1801, 18, init, 2017-08-08"/>
+    <row values="180001, 1800, 18, init, 2017-08-08"/>
+    <row values="180002, 1800, 18, init, 2017-08-08"/>
+    <row values="170101, 1701, 17, init, 2017-08-08"/>
+    <row values="170102, 1701, 17, init, 2017-08-08"/>
+    <row values="170001, 1700, 17, init, 2017-08-08"/>
+    <row values="170002, 1700, 17, init, 2017-08-08"/>
+    <row values="160101, 1601, 16, init, 2017-08-08"/>
+    <row values="160102, 1601, 16, init, 2017-08-08"/>
+    <row values="160001, 1600, 16, init, 2017-08-08"/>
+    <row values="160002, 1600, 16, init, 2017-08-08"/>
+    <row values="150101, 1501, 15, init, 2017-08-08"/>
+    <row values="150102, 1501, 15, init, 2017-08-08"/>
+    <row values="150001, 1500, 15, init, 2017-08-08"/>
+    <row values="150002, 1500, 15, init, 2017-08-08"/>
+    <row values="140101, 1401, 14, init, 2017-08-08"/>
+    <row values="140102, 1401, 14, init, 2017-08-08"/>
+    <row values="140001, 1400, 14, init, 2017-08-08"/>
+    <row values="140002, 1400, 14, init, 2017-08-08"/>
+    <row values="130101, 1301, 13, init, 2017-08-08"/>
+    <row values="130102, 1301, 13, init, 2017-08-08"/>
+    <row values="130001, 1300, 13, init, 2017-08-08"/>
+    <row values="130002, 1300, 13, init, 2017-08-08"/>
+    <row values="120101, 1201, 12, init, 2017-08-08"/>
+    <row values="120102, 1201, 12, init, 2017-08-08"/>
+    <row values="120001, 1200, 12, init, 2017-08-08"/>
+    <row values="120002, 1200, 12, init, 2017-08-08"/>
+    <row values="110101, 1101, 11, init, 2017-08-08"/>
+    <row values="110102, 1101, 11, init, 2017-08-08"/>
+    <row values="110001, 1100, 11, init, 2017-08-08"/>
+    <row values="110002, 1100, 11, init, 2017-08-08"/>
+    <row values="100101, 1001, 10, init, 2017-08-08"/>
+    <row values="100102, 1001, 10, init, 2017-08-08"/>
+    <row values="100001, 1000, 10, init, 2017-08-08"/>
+    <row values="100002, 1000, 10, init, 2017-08-08"/>
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_alias_star_alias_name.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_alias_star_alias_name.xml
new file mode 100644
index 0000000..22fc2d9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_alias_star_alias_name.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_date.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_date.xml
new file mode 100644
index 0000000..de39b75
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_date.xml
@@ -0,0 +1,106 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="290101, 2901, 29, init, 2017-08-08"/>
+    <row values="290102, 2901, 29, init, 2017-08-08"/>
+    <row values="290001, 2900, 29, init, 2017-08-08"/>
+    <row values="290002, 2900, 29, init, 2017-08-08"/>
+    <row values="280101, 2801, 28, init, 2017-08-08"/>
+    <row values="280102, 2801, 28, init, 2017-08-08"/>
+    <row values="280001, 2800, 28, init, 2017-08-08"/>
+    <row values="280002, 2800, 28, init, 2017-08-08"/>
+    <row values="270101, 2701, 27, init, 2017-08-08"/>
+    <row values="270102, 2701, 27, init, 2017-08-08"/>
+    <row values="270001, 2700, 27, init, 2017-08-08"/>
+    <row values="270002, 2700, 27, init, 2017-08-08"/>
+    <row values="260101, 2601, 26, init, 2017-08-08"/>
+    <row values="260102, 2601, 26, init, 2017-08-08"/>
+    <row values="260001, 2600, 26, init, 2017-08-08"/>
+    <row values="260002, 2600, 26, init, 2017-08-08"/>
+    <row values="250101, 2501, 25, init, 2017-08-08"/>
+    <row values="250102, 2501, 25, init, 2017-08-08"/>
+    <row values="250001, 2500, 25, init, 2017-08-08"/>
+    <row values="250002, 2500, 25, init, 2017-08-08"/>
+    <row values="240101, 2401, 24, init, 2017-08-08"/>
+    <row values="240102, 2401, 24, init, 2017-08-08"/>
+    <row values="240001, 2400, 24, init, 2017-08-08"/>
+    <row values="240002, 2400, 24, init, 2017-08-08"/>
+    <row values="230101, 2301, 23, init, 2017-08-08"/>
+    <row values="230102, 2301, 23, init, 2017-08-08"/>
+    <row values="230001, 2300, 23, init, 2017-08-08"/>
+    <row values="230002, 2300, 23, init, 2017-08-08"/>
+    <row values="220101, 2201, 22, init, 2017-08-08"/>
+    <row values="220102, 2201, 22, init, 2017-08-08"/>
+    <row values="220001, 2200, 22, init, 2017-08-08"/>
+    <row values="220002, 2200, 22, init, 2017-08-08"/>
+    <row values="210101, 2101, 21, init, 2017-08-08"/>
+    <row values="210102, 2101, 21, init, 2017-08-08"/>
+    <row values="210001, 2100, 21, init, 2017-08-08"/>
+    <row values="210002, 2100, 21, init, 2017-08-08"/>
+    <row values="200101, 2001, 20, init, 2017-08-08"/>
+    <row values="200102, 2001, 20, init, 2017-08-08"/>
+    <row values="200001, 2000, 20, init, 2017-08-08"/>
+    <row values="200002, 2000, 20, init, 2017-08-08"/>
+    <row values="190101, 1901, 19, init, 2017-08-08"/>
+    <row values="190102, 1901, 19, init, 2017-08-08"/>
+    <row values="190001, 1900, 19, init, 2017-08-08"/>
+    <row values="190002, 1900, 19, init, 2017-08-08"/>
+    <row values="180101, 1801, 18, init, 2017-08-08"/>
+    <row values="180102, 1801, 18, init, 2017-08-08"/>
+    <row values="180001, 1800, 18, init, 2017-08-08"/>
+    <row values="180002, 1800, 18, init, 2017-08-08"/>
+    <row values="170101, 1701, 17, init, 2017-08-08"/>
+    <row values="170102, 1701, 17, init, 2017-08-08"/>
+    <row values="170001, 1700, 17, init, 2017-08-08"/>
+    <row values="170002, 1700, 17, init, 2017-08-08"/>
+    <row values="160101, 1601, 16, init, 2017-08-08"/>
+    <row values="160102, 1601, 16, init, 2017-08-08"/>
+    <row values="160001, 1600, 16, init, 2017-08-08"/>
+    <row values="160002, 1600, 16, init, 2017-08-08"/>
+    <row values="150101, 1501, 15, init, 2017-08-08"/>
+    <row values="150102, 1501, 15, init, 2017-08-08"/>
+    <row values="150001, 1500, 15, init, 2017-08-08"/>
+    <row values="150002, 1500, 15, init, 2017-08-08"/>
+    <row values="140101, 1401, 14, init, 2017-08-08"/>
+    <row values="140102, 1401, 14, init, 2017-08-08"/>
+    <row values="140001, 1400, 14, init, 2017-08-08"/>
+    <row values="140002, 1400, 14, init, 2017-08-08"/>
+    <row values="130101, 1301, 13, init, 2017-08-08"/>
+    <row values="130102, 1301, 13, init, 2017-08-08"/>
+    <row values="130001, 1300, 13, init, 2017-08-08"/>
+    <row values="130002, 1300, 13, init, 2017-08-08"/>
+    <row values="120101, 1201, 12, init, 2017-08-08"/>
+    <row values="120102, 1201, 12, init, 2017-08-08"/>
+    <row values="120001, 1200, 12, init, 2017-08-08"/>
+    <row values="120002, 1200, 12, init, 2017-08-08"/>
+    <row values="110101, 1101, 11, init, 2017-08-08"/>
+    <row values="110102, 1101, 11, init, 2017-08-08"/>
+    <row values="110001, 1100, 11, init, 2017-08-08"/>
+    <row values="110002, 1100, 11, init, 2017-08-08"/>
+    <row values="100101, 1001, 10, init, 2017-08-08"/>
+    <row values="100102, 1001, 10, init, 2017-08-08"/>
+    <row values="100001, 1000, 10, init, 2017-08-08"/>
+    <row values="100002, 1000, 10, init, 2017-08-08"/>
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_multiple_stars.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_multiple_stars.xml
new file mode 100644
index 0000000..436a69f
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_multiple_stars.xml
@@ -0,0 +1,68 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="order_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init, 1000, 1000, 10, init" />
+    <row values="1001, 10, init, 1001, 1001, 10, init" />
+    <row values="1100, 11, init, 1100, 1100, 11, init" />
+    <row values="1101, 11, init, 1101, 1101, 11, init" />
+    <row values="1200, 12, init, 1200, 1200, 12, init" />
+    <row values="1201, 12, init, 1201, 1201, 12, init" />
+    <row values="1300, 13, init, 1300, 1300, 13, init" />
+    <row values="1301, 13, init, 1301, 1301, 13, init" />
+    <row values="1400, 14, init, 1400, 1400, 14, init" />
+    <row values="1401, 14, init, 1401, 1401, 14, init" />
+    <row values="1500, 15, init, 1500, 1500, 15, init" />
+    <row values="1501, 15, init, 1501, 1501, 15, init" />
+    <row values="1600, 16, init, 1600, 1600, 16, init" />
+    <row values="1601, 16, init, 1601, 1601, 16, init" />
+    <row values="1700, 17, init, 1700, 1700, 17, init" />
+    <row values="1701, 17, init, 1701, 1701, 17, init" />
+    <row values="1800, 18, init, 1800, 1800, 18, init" />
+    <row values="1801, 18, init, 1801, 1801, 18, init" />
+    <row values="1900, 19, init, 1900, 1900, 19, init" />
+    <row values="1901, 19, init, 1901, 1901, 19, init" />
+    <row values="2000, 20, init, 2000, 2000, 20, init" />
+    <row values="2001, 20, init, 2001, 2001, 20, init" />
+    <row values="2100, 21, init, 2100, 2100, 21, init" />
+    <row values="2101, 21, init, 2101, 2101, 21, init" />
+    <row values="2200, 22, init, 2200, 2200, 22, init" />
+    <row values="2201, 22, init, 2201, 2201, 22, init" />
+    <row values="2300, 23, init, 2300, 2300, 23, init" />
+    <row values="2301, 23, init, 2301, 2301, 23, init" />
+    <row values="2400, 24, init, 2400, 2400, 24, init" />
+    <row values="2401, 24, init, 2401, 2401, 24, init" />
+    <row values="2500, 25, init, 2500, 2500, 25, init" />
+    <row values="2501, 25, init, 2501, 2501, 25, init" />
+    <row values="2600, 26, init, 2600, 2600, 26, init" />
+    <row values="2601, 26, init, 2601, 2601, 26, init" />
+    <row values="2700, 27, init, 2700, 2700, 27, init" />
+    <row values="2701, 27, init, 2701, 2701, 27, init" />
+    <row values="2800, 28, init, 2800, 2800, 28, init" />
+    <row values="2801, 28, init, 2801, 2801, 28, init" />
+    <row values="2900, 29, init, 2900, 2900, 29, init" />
+    <row values="2901, 29, init, 2901, 2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_ordered_column.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_ordered_column.xml
new file mode 100644
index 0000000..0d79952
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_ordered_column.xml
@@ -0,0 +1,62 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="gen_order_id_" />
+    </metadata>
+    <row values="1000" />
+    <row values="1001" />
+    <row values="1100" />
+    <row values="1101" />
+    <row values="1200" />
+    <row values="1201" />
+    <row values="1300" />
+    <row values="1301" />
+    <row values="1400" />
+    <row values="1401" />
+    <row values="1500" />
+    <row values="1501" />
+    <row values="1600" />
+    <row values="1601" />
+    <row values="1700" />
+    <row values="1701" />
+    <row values="1800" />
+    <row values="1801" />
+    <row values="1900" />
+    <row values="1901" />
+    <row values="2000" />
+    <row values="2001" />
+    <row values="2100" />
+    <row values="2101" />
+    <row values="2200" />
+    <row values="2201" />
+    <row values="2300" />
+    <row values="2301" />
+    <row values="2400" />
+    <row values="2401" />
+    <row values="2500" />
+    <row values="2501" />
+    <row values="2600" />
+    <row values="2601" />
+    <row values="2700" />
+    <row values="2701" />
+    <row values="2800" />
+    <row values="2801" />
+    <row values="2900" />
+    <row values="2901" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_star_no_table_alias.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_star_no_table_alias.xml
new file mode 100644
index 0000000..22fc2d9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_star_no_table_alias.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_star_table_alias.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_star_table_alias.xml
new file mode 100644
index 0000000..22fc2d9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_star_table_alias.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_table_star_table_name.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_table_star_table_name.xml
new file mode 100644
index 0000000..22fc2d9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_table_star_table_name.xml
@@ -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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+    <row values="2000, 20, init" />
+    <row values="2001, 20, init" />
+    <row values="2100, 21, init" />
+    <row values="2101, 21, init" />
+    <row values="2200, 22, init" />
+    <row values="2201, 22, init" />
+    <row values="2300, 23, init" />
+    <row values="2301, 23, init" />
+    <row values="2400, 24, init" />
+    <row values="2401, 24, init" />
+    <row values="2500, 25, init" />
+    <row values="2501, 25, init" />
+    <row values="2600, 26, init" />
+    <row values="2601, 26, init" />
+    <row values="2700, 27, init" />
+    <row values="2701, 27, init" />
+    <row values="2800, 28, init" />
+    <row values="2801, 28, init" />
+    <row values="2900, 29, init" />
+    <row values="2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_table_star_without_table_name.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_table_star_without_table_name.xml
new file mode 100644
index 0000000..cffd561
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_order_by_with_table_star_without_table_name.xml
@@ -0,0 +1,109 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="100001, 1000, 10, init, 2017-08-08, 1000, 10, init" />
+    <row values="100002, 1000, 10, init, 2017-08-08, 1000, 10, init" />
+    <row values="100101, 1001, 10, init, 2017-08-08, 1001, 10, init" />
+    <row values="100102, 1001, 10, init, 2017-08-08, 1001, 10, init" />
+    <row values="110001, 1100, 11, init, 2017-08-08, 1100, 11, init" />
+    <row values="110002, 1100, 11, init, 2017-08-08, 1100, 11, init" />
+    <row values="110101, 1101, 11, init, 2017-08-08, 1101, 11, init" />
+    <row values="110102, 1101, 11, init, 2017-08-08, 1101, 11, init" />
+    <row values="120001, 1200, 12, init, 2017-08-08, 1200, 12, init" />
+    <row values="120002, 1200, 12, init, 2017-08-08, 1200, 12, init" />
+    <row values="120101, 1201, 12, init, 2017-08-08, 1201, 12, init" />
+    <row values="120102, 1201, 12, init, 2017-08-08, 1201, 12, init" />
+    <row values="130001, 1300, 13, init, 2017-08-08, 1300, 13, init" />
+    <row values="130002, 1300, 13, init, 2017-08-08, 1300, 13, init" />
+    <row values="130101, 1301, 13, init, 2017-08-08, 1301, 13, init" />
+    <row values="130102, 1301, 13, init, 2017-08-08, 1301, 13, init" />
+    <row values="140001, 1400, 14, init, 2017-08-08, 1400, 14, init" />
+    <row values="140002, 1400, 14, init, 2017-08-08, 1400, 14, init" />
+    <row values="140101, 1401, 14, init, 2017-08-08, 1401, 14, init" />
+    <row values="140102, 1401, 14, init, 2017-08-08, 1401, 14, init" />
+    <row values="150001, 1500, 15, init, 2017-08-08, 1500, 15, init" />
+    <row values="150002, 1500, 15, init, 2017-08-08, 1500, 15, init" />
+    <row values="150101, 1501, 15, init, 2017-08-08, 1501, 15, init" />
+    <row values="150102, 1501, 15, init, 2017-08-08, 1501, 15, init" />
+    <row values="160001, 1600, 16, init, 2017-08-08, 1600, 16, init" />
+    <row values="160002, 1600, 16, init, 2017-08-08, 1600, 16, init" />
+    <row values="160101, 1601, 16, init, 2017-08-08, 1601, 16, init" />
+    <row values="160102, 1601, 16, init, 2017-08-08, 1601, 16, init" />
+    <row values="170001, 1700, 17, init, 2017-08-08, 1700, 17, init" />
+    <row values="170002, 1700, 17, init, 2017-08-08, 1700, 17, init" />
+    <row values="170101, 1701, 17, init, 2017-08-08, 1701, 17, init" />
+    <row values="170102, 1701, 17, init, 2017-08-08, 1701, 17, init" />
+    <row values="180001, 1800, 18, init, 2017-08-08, 1800, 18, init" />
+    <row values="180002, 1800, 18, init, 2017-08-08, 1800, 18, init" />
+    <row values="180101, 1801, 18, init, 2017-08-08, 1801, 18, init" />
+    <row values="180102, 1801, 18, init, 2017-08-08, 1801, 18, init" />
+    <row values="190001, 1900, 19, init, 2017-08-08, 1900, 19, init" />
+    <row values="190002, 1900, 19, init, 2017-08-08, 1900, 19, init" />
+    <row values="190101, 1901, 19, init, 2017-08-08, 1901, 19, init" />
+    <row values="190102, 1901, 19, init, 2017-08-08, 1901, 19, init" />
+    <row values="200001, 2000, 20, init, 2017-08-08, 2000, 20, init" />
+    <row values="200002, 2000, 20, init, 2017-08-08, 2000, 20, init" />
+    <row values="200101, 2001, 20, init, 2017-08-08, 2001, 20, init" />
+    <row values="200102, 2001, 20, init, 2017-08-08, 2001, 20, init" />
+    <row values="210001, 2100, 21, init, 2017-08-08, 2100, 21, init" />
+    <row values="210002, 2100, 21, init, 2017-08-08, 2100, 21, init" />
+    <row values="210101, 2101, 21, init, 2017-08-08, 2101, 21, init" />
+    <row values="210102, 2101, 21, init, 2017-08-08, 2101, 21, init" />
+    <row values="220001, 2200, 22, init, 2017-08-08, 2200, 22, init" />
+    <row values="220002, 2200, 22, init, 2017-08-08, 2200, 22, init" />
+    <row values="220101, 2201, 22, init, 2017-08-08, 2201, 22, init" />
+    <row values="220102, 2201, 22, init, 2017-08-08, 2201, 22, init" />
+    <row values="230001, 2300, 23, init, 2017-08-08, 2300, 23, init" />
+    <row values="230002, 2300, 23, init, 2017-08-08, 2300, 23, init" />
+    <row values="230101, 2301, 23, init, 2017-08-08, 2301, 23, init" />
+    <row values="230102, 2301, 23, init, 2017-08-08, 2301, 23, init" />
+    <row values="240001, 2400, 24, init, 2017-08-08, 2400, 24, init" />
+    <row values="240002, 2400, 24, init, 2017-08-08, 2400, 24, init" />
+    <row values="240101, 2401, 24, init, 2017-08-08, 2401, 24, init" />
+    <row values="240102, 2401, 24, init, 2017-08-08, 2401, 24, init" />
+    <row values="250001, 2500, 25, init, 2017-08-08, 2500, 25, init" />
+    <row values="250002, 2500, 25, init, 2017-08-08, 2500, 25, init" />
+    <row values="250101, 2501, 25, init, 2017-08-08, 2501, 25, init" />
+    <row values="250102, 2501, 25, init, 2017-08-08, 2501, 25, init" />
+    <row values="260001, 2600, 26, init, 2017-08-08, 2600, 26, init" />
+    <row values="260002, 2600, 26, init, 2017-08-08, 2600, 26, init" />
+    <row values="260101, 2601, 26, init, 2017-08-08, 2601, 26, init" />
+    <row values="260102, 2601, 26, init, 2017-08-08, 2601, 26, init" />
+    <row values="270001, 2700, 27, init, 2017-08-08, 2700, 27, init" />
+    <row values="270002, 2700, 27, init, 2017-08-08, 2700, 27, init" />
+    <row values="270101, 2701, 27, init, 2017-08-08, 2701, 27, init" />
+    <row values="270102, 2701, 27, init, 2017-08-08, 2701, 27, init" />
+    <row values="280001, 2800, 28, init, 2017-08-08, 2800, 28, init" />
+    <row values="280002, 2800, 28, init, 2017-08-08, 2800, 28, init" />
+    <row values="280101, 2801, 28, init, 2017-08-08, 2801, 28, init" />
+    <row values="280102, 2801, 28, init, 2017-08-08, 2801, 28, init" />
+    <row values="290001, 2900, 29, init, 2017-08-08, 2900, 29, init" />
+    <row values="290002, 2900, 29, init, 2017-08-08, 2900, 29, init" />
+    <row values="290101, 2901, 29, init, 2017-08-08, 2901, 29, init" />
+    <row values="290102, 2901, 29, init, 2017-08-08, 2901, 29, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_diff_group_by_and_order_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_diff_group_by_and_order_by.xml
new file mode 100644
index 0000000..30cd3db
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_diff_group_by_and_order_by.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id" />
+    </metadata>
+    <row values="10" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_group_by_and_order_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_group_by_and_order_by.xml
new file mode 100644
index 0000000..0209d69
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_group_by_and_order_by.xml
@@ -0,0 +1,29 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id" />
+    </metadata>
+    <row values="19" />
+    <row values="19" />
+    <row values="19" />
+    <row values="10" />
+    <row values="10" />
+    <row values="10" />
+    <row values="10" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset.xml
new file mode 100644
index 0000000..c61b565
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100002, 1000, 10, init, 2017-08-08" />
+    <row values="100001, 1000, 10, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_and_limit.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_and_limit.xml
new file mode 100644
index 0000000..6368682
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_and_limit.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="190002, 1900, 19, init, 2017-08-08" />
+    <row values="190001, 1900, 19, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_and_row_count.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_and_row_count.xml
new file mode 100644
index 0000000..6368682
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_and_row_count.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="190002, 1900, 19, init, 2017-08-08" />
+    <row values="190001, 1900, 19, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_fetch.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_fetch.xml
new file mode 100644
index 0000000..9669d6b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_offset_fetch.xml
@@ -0,0 +1,44 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_count.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_count.xml
new file mode 100644
index 0000000..aec5ec3
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_count.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="190102, 1901, 19, init, 2017-08-08" />
+    <row values="190101, 1901, 19, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_number_and_limit.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_number_and_limit.xml
new file mode 100644
index 0000000..39b65c7
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_number_and_limit.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="190102, 1901, 1, 19, init, 2017-08-08" />
+    <row values="190101, 1901, 2, 19, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_number_not_at_end.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_number_not_at_end.xml
new file mode 100644
index 0000000..9669d6b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_row_number_not_at_end.xml
@@ -0,0 +1,44 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+    </metadata>
+    <row values="1000, 10, init" />
+    <row values="1001, 10, init" />
+    <row values="1100, 11, init" />
+    <row values="1101, 11, init" />
+    <row values="1200, 12, init" />
+    <row values="1201, 12, init" />
+    <row values="1300, 13, init" />
+    <row values="1301, 13, init" />
+    <row values="1400, 14, init" />
+    <row values="1401, 14, init" />
+    <row values="1500, 15, init" />
+    <row values="1501, 15, init" />
+    <row values="1600, 16, init" />
+    <row values="1601, 16, init" />
+    <row values="1700, 17, init" />
+    <row values="1701, 17, init" />
+    <row values="1800, 18, init" />
+    <row values="1801, 18, init" />
+    <row values="1900, 19, init" />
+    <row values="1901, 19, init" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_top_and_limit.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_top_and_limit.xml
new file mode 100644
index 0000000..39b65c7
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_pagination_with_top_and_limit.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="190102, 1901, 1, 19, init, 2017-08-08" />
+    <row values="190101, 1901, 2, 19, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sharding_route_with_binding_tables.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sharding_route_with_binding_tables.xml
new file mode 100644
index 0000000..2b8dcfa
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sharding_route_with_binding_tables.xml
@@ -0,0 +1,34 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100001, 1000, 10, init, 2017-08-08" />
+    <row values="100002, 1000, 10, init, 2017-08-08" />
+    <row values="100101, 1001, 10, init, 2017-08-08" />
+    <row values="100102, 1001, 10, init, 2017-08-08" />
+    <row values="110001, 1100, 11, init, 2017-08-08" />
+    <row values="110002, 1100, 11, init, 2017-08-08" />
+    <row values="110101, 1101, 11, init, 2017-08-08" />
+    <row values="110102, 1101, 11, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sharding_route_with_broadcast_table.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sharding_route_with_broadcast_table.xml
new file mode 100644
index 0000000..c65ac38
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sharding_route_with_broadcast_table.xml
@@ -0,0 +1,30 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100101, 1001, 10, init, 2017-08-08" />
+    <row values="100102, 1001, 10, init, 2017-08-08" />
+    <row values="110001, 1100, 11, init, 2017-08-08" />
+    <row values="110002, 1100, 11, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_group_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_group_by.xml
new file mode 100644
index 0000000..51a7e2b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_group_by.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_items_count" />
+    </metadata>
+    <row values="40" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_multiple_tables.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_multiple_tables.xml
new file mode 100644
index 0000000..c227af7
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_multiple_tables.xml
@@ -0,0 +1,30 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100000, 1000, 10, init, 2017-08-08" />
+    <row values="100001, 1000, 10, init, 2017-08-08" />
+    <row values="100100, 1001, 10, init, 2017-08-08" />
+    <row values="100101, 1001, 10, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_order_by.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_order_by.xml
new file mode 100644
index 0000000..079d25b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sub_query_with_order_by.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="orders_count" />
+    </metadata>
+    <row values="40" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sum.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sum.xml
new file mode 100644
index 0000000..2e98392
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_sum.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="user_id_sum" />
+    </metadata>
+    <row values="780" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_case_expression.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_case_expression.xml
new file mode 100644
index 0000000..49297cb
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_case_expression.xml
@@ -0,0 +1,27 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="item_id" />
+        <column name="stateName" />
+    </metadata>
+    <row values="1000,10,init,100001,已启用" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_date_function.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_date_function.xml
new file mode 100644
index 0000000..c1b0e0a
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_date_function.xml
@@ -0,0 +1,102 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="creation_date" />
+    </metadata>
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+    <row values="2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_expression.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_expression.xml
new file mode 100644
index 0000000..cb94d7f
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_expression.xml
@@ -0,0 +1,62 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="exp" />
+    </metadata>
+    <row values="1002" />
+    <row values="1003" />
+    <row values="1102" />
+    <row values="1103" />
+    <row values="1202" />
+    <row values="1203" />
+    <row values="1302" />
+    <row values="1303" />
+    <row values="1402" />
+    <row values="1403" />
+    <row values="1502" />
+    <row values="1503" />
+    <row values="1602" />
+    <row values="1603" />
+    <row values="1702" />
+    <row values="1703" />
+    <row values="1802" />
+    <row values="1803" />
+    <row values="1902" />
+    <row values="1903" />
+    <row values="2002" />
+    <row values="2003" />
+    <row values="2102" />
+    <row values="2103" />
+    <row values="2202" />
+    <row values="2203" />
+    <row values="2302" />
+    <row values="2303" />
+    <row values="2402" />
+    <row values="2403" />
+    <row values="2502" />
+    <row values="2503" />
+    <row values="2602" />
+    <row values="2603" />
+    <row values="2702" />
+    <row values="2703" />
+    <row values="2802" />
+    <row values="2803" />
+    <row values="2902" />
+    <row values="2903" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_force_index_join.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_force_index_join.xml
new file mode 100644
index 0000000..81da80c
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_force_index_join.xml
@@ -0,0 +1,28 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100001, 1000, 10, init, 2017-08-08" />
+    <row values="100002, 1000, 10, init, 2017-08-08" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_item_alias_match_order_by_and_group_by_items.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_item_alias_match_order_by_and_group_by_items.xml
new file mode 100644
index 0000000..bf96512
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_item_alias_match_order_by_and_group_by_items.xml
@@ -0,0 +1,42 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="uid" />
+    </metadata>
+    <row values="10" />
+    <row values="11" />
+    <row values="12" />
+    <row values="13" />
+    <row values="14" />
+    <row values="15" />
+    <row values="16" />
+    <row values="17" />
+    <row values="18" />
+    <row values="19" />
+    <row values="20" />
+    <row values="21" />
+    <row values="22" />
+    <row values="23" />
+    <row values="24" />
+    <row values="25" />
+    <row values="26" />
+    <row values="27" />
+    <row values="28" />
+    <row values="29" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_regexp.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_regexp.xml
new file mode 100644
index 0000000..b257dc9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/dql/dataset/encrypt/select_with_regexp.xml
@@ -0,0 +1,27 @@
+<!--
+  ~ 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.
+  -->
+
+<dataset>
+    <metadata>
+        <column name="item_id" />
+        <column name="order_id" />
+        <column name="user_id" />
+        <column name="status" />
+        <column name="creation_date" />
+    </metadata>
+    <row values="100001, 1000, 10, init, 2017-08-08" />
+</dataset>