You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/12/13 01:48:19 UTC

[shardingsphere] branch master updated: Add some integration test case for DistSQL RAL (#22835)

This is an automated email from the ASF dual-hosted git repository.

zhaojinchao 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 d95002486d6 Add some integration test case for DistSQL RAL (#22835)
d95002486d6 is described below

commit d95002486d6d19ea02b3d90ed5166e8fd503362f
Author: Zichao <57...@users.noreply.github.com>
AuthorDate: Tue Dec 13 14:48:12 2022 +1300

    Add some integration test case for DistSQL RAL (#22835)
---
 .../empty_rules/cluster/show_authority_rule.xml    | 25 ++++++++++++
 ...how_dist_variable_where_name_equal_sql_show.xml | 24 ++++++++++++
 .../empty_rules/cluster/show_dist_variables.xml    | 44 ++++++++++++++++++++++
 .../empty_rules/cluster/show_sql_parse_rule.xml    | 25 ++++++++++++
 .../show_status_from_readwrite_splitting_rules.xml | 25 ++++++++++++
 .../empty_rules/cluster/show_transaction_rule.xml  | 25 ++++++++++++
 .../empty_rules/standalone/show_authority_rule.xml | 25 ++++++++++++
 ...how_dist_variable_where_name_equal_sql_show.xml | 24 ++++++++++++
 .../empty_rules/standalone/show_dist_variables.xml | 44 ++++++++++++++++++++++
 .../empty_rules/standalone/show_sql_parse_rule.xml | 25 ++++++++++++
 .../show_status_from_readwrite_splitting_rules.xml | 25 ++++++++++++
 .../standalone/show_transaction_rule.xml           | 25 ++++++++++++
 .../cases/ral/ral-integration-test-cases.xml       | 24 ++++++++++++
 13 files changed, 360 insertions(+)

diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_authority_rule.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_authority_rule.xml
new file mode 100644
index 00000000000..8dabf0d7ff9
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_authority_rule.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="users" />
+        <column name="provider" />
+        <column name="props" />
+    </metadata>
+    <row values=" proxy@% | ALL_PERMITTED | " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_dist_variable_where_name_equal_sql_show.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_dist_variable_where_name_equal_sql_show.xml
new file mode 100644
index 00000000000..d8c26fb91d8
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_dist_variable_where_name_equal_sql_show.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="variable_name" />
+        <column name="variable_value" />
+    </metadata>
+    <row values=" sql_show | false " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_dist_variables.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_dist_variables.xml
new file mode 100644
index 00000000000..8aa91ace332
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_dist_variables.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="variable_name" />
+        <column name="variable_value" />
+    </metadata>
+    <row values=" sql_show | false " />
+    <row values=" sql_simple | false " />
+    <row values=" kernel_executor_size | 16 " />
+    <row values=" max_connections_size_per_query | 1 " />
+    <row values=" check_table_meta_data_enabled | false " />
+    <row values=" sql_federation_type | ADVANCED " />
+    <row values=" proxy_frontend_database_protocol_type | " />
+    <row values=" proxy_frontend_flush_threshold | 128 " />
+    <row values=" proxy_hint_enabled | true " />
+    <row values=" proxy_backend_query_fetch_size | -1 " />
+    <row values=" proxy_frontend_executor_size | 0 " />
+    <row values=" proxy_backend_executor_suitable | OLAP " />
+    <row values=" proxy_frontend_max_connections | 0 " />
+    <row values=" proxy_backend_driver_type | JDBC " />
+    <row values=" proxy_mysql_default_version | 5.7.22 " />
+    <row values=" proxy_default_port | 3307 " />
+    <row values=" proxy_netty_backlog | 1024 " />
+    <row values=" proxy_instance_type | Proxy " />
+    <row values=" agent_plugins_enabled | true" />
+    <row values=" cached_connections | 0 " />
+    <row values=" transaction_type | LOCAL " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_sql_parse_rule.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_sql_parse_rule.xml
new file mode 100644
index 00000000000..83631af6b92
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_sql_parse_rule.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="sql_comment_parse_enable" />
+        <column name="parse_tree_cache" />
+        <column name="sql_statement_cache" />
+    </metadata>
+    <row values=" true | initialCapacity: 128, maximumSize: 1024 | initialCapacity: 2000, maximumSize: 65535 " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_status_from_readwrite_splitting_rules.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_status_from_readwrite_splitting_rules.xml
new file mode 100644
index 00000000000..46c2c122272
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_status_from_readwrite_splitting_rules.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="storage_unit" />
+        <column name="status" />
+        <column name="delay_time(ms)" />
+    </metadata>
+    <row values=" read_ds_0 | enabled | 0 " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_transaction_rule.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_transaction_rule.xml
new file mode 100644
index 00000000000..90b8d516c4e
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/cluster/show_transaction_rule.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="default_type" />
+        <column name="provider_type" />
+        <column name="props" />
+    </metadata>
+    <row values=" LOCAL | | " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_authority_rule.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_authority_rule.xml
new file mode 100644
index 00000000000..8dabf0d7ff9
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_authority_rule.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="users" />
+        <column name="provider" />
+        <column name="props" />
+    </metadata>
+    <row values=" proxy@% | ALL_PERMITTED | " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_dist_variable_where_name_equal_sql_show.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_dist_variable_where_name_equal_sql_show.xml
new file mode 100644
index 00000000000..d8c26fb91d8
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_dist_variable_where_name_equal_sql_show.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="variable_name" />
+        <column name="variable_value" />
+    </metadata>
+    <row values=" sql_show | false " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_dist_variables.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_dist_variables.xml
new file mode 100644
index 00000000000..8aa91ace332
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_dist_variables.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="variable_name" />
+        <column name="variable_value" />
+    </metadata>
+    <row values=" sql_show | false " />
+    <row values=" sql_simple | false " />
+    <row values=" kernel_executor_size | 16 " />
+    <row values=" max_connections_size_per_query | 1 " />
+    <row values=" check_table_meta_data_enabled | false " />
+    <row values=" sql_federation_type | ADVANCED " />
+    <row values=" proxy_frontend_database_protocol_type | " />
+    <row values=" proxy_frontend_flush_threshold | 128 " />
+    <row values=" proxy_hint_enabled | true " />
+    <row values=" proxy_backend_query_fetch_size | -1 " />
+    <row values=" proxy_frontend_executor_size | 0 " />
+    <row values=" proxy_backend_executor_suitable | OLAP " />
+    <row values=" proxy_frontend_max_connections | 0 " />
+    <row values=" proxy_backend_driver_type | JDBC " />
+    <row values=" proxy_mysql_default_version | 5.7.22 " />
+    <row values=" proxy_default_port | 3307 " />
+    <row values=" proxy_netty_backlog | 1024 " />
+    <row values=" proxy_instance_type | Proxy " />
+    <row values=" agent_plugins_enabled | true" />
+    <row values=" cached_connections | 0 " />
+    <row values=" transaction_type | LOCAL " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_sql_parse_rule.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_sql_parse_rule.xml
new file mode 100644
index 00000000000..83631af6b92
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_sql_parse_rule.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="sql_comment_parse_enable" />
+        <column name="parse_tree_cache" />
+        <column name="sql_statement_cache" />
+    </metadata>
+    <row values=" true | initialCapacity: 128, maximumSize: 1024 | initialCapacity: 2000, maximumSize: 65535 " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_status_from_readwrite_splitting_rules.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_status_from_readwrite_splitting_rules.xml
new file mode 100644
index 00000000000..46c2c122272
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_status_from_readwrite_splitting_rules.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="storage_unit" />
+        <column name="status" />
+        <column name="delay_time(ms)" />
+    </metadata>
+    <row values=" read_ds_0 | enabled | 0 " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_transaction_rule.xml b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_transaction_rule.xml
new file mode 100644
index 00000000000..90b8d516c4e
--- /dev/null
+++ b/test/e2e/suite/src/test/resources/cases/ral/dataset/empty_rules/standalone/show_transaction_rule.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="default_type" />
+        <column name="provider_type" />
+        <column name="props" />
+    </metadata>
+    <row values=" LOCAL | | " />
+</dataset>
diff --git a/test/e2e/suite/src/test/resources/cases/ral/ral-integration-test-cases.xml b/test/e2e/suite/src/test/resources/cases/ral/ral-integration-test-cases.xml
index 6af54eaaa39..c578d796e7c 100644
--- a/test/e2e/suite/src/test/resources/cases/ral/ral-integration-test-cases.xml
+++ b/test/e2e/suite/src/test/resources/cases/ral/ral-integration-test-cases.xml
@@ -101,5 +101,29 @@
     <test-case sql="select * from shardingsphere.sharding_table_statistics;" db-types="MySQL,PostgreSQL,openGauss">
         <assertion expected-data-file="select_sharding_table_statistics.xml" />
     </test-case>
+
+    <test-case sql="SHOW AUTHORITY RULE;">
+        <assertion expected-data-file="show_authority_rule.xml" />
+    </test-case>
+
+    <test-case sql="SHOW TRANSACTION RULE;">
+        <assertion expected-data-file="show_transaction_rule.xml" />
+    </test-case>
+
+    <test-case sql="SHOW SQL_PARSER RULE;">
+        <assertion expected-data-file="show_sql_parse_rule.xml" />
+    </test-case>
+
+    <test-case sql="SHOW STATUS FROM READWRITE_SPLITTING RULES;">
+        <assertion expected-data-file="show_status_from_readwrite_splitting_rules.xml" />
+    </test-case>
+
+    <test-case sql="SHOW DIST VARIABLES;">
+        <assertion expected-data-file="show_dist_variables.xml" />
+    </test-case>
+
+    <test-case sql="SHOW DIST VARIABLE WHERE name = sql_show;">
+        <assertion expected-data-file="show_dist_variable_where_name_equal_sql_show.xml" />
+    </test-case>
 </integration-test-cases>