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

[shardingsphere] branch master updated: add rql cases (#12549)

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

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new b7fb317  add rql cases (#12549)
b7fb317 is described below

commit b7fb317f0915ff276053bcb3a75fee59aef764c1
Author: Jieker <ji...@163.com>
AuthorDate: Sat Sep 18 17:40:58 2021 +0800

    add rql cases (#12549)
    
    * add rql cases
    
    * adjust todo
---
 .../mysql/show_readwrite_splitting_rules.xml       | 37 ++++++++++++++++++++++
 .../mysql/show_encrypt_rule.xml                    | 28 ++++++++++++++++
 .../mysql/show_encrypt_rules.xml                   | 31 ++++++++++++++++++
 .../mysql/show_readwrite_splitting_rules.xml       | 37 ++++++++++++++++++++++
 .../dataset/encrypt/mysql/show_encrypt_rule.xml    | 28 ++++++++++++++++
 .../dataset/encrypt/mysql/show_encrypt_rules.xml   | 29 +++++++++++++++++
 .../mysql/show_readwrite_splitting_rules.xml       | 28 ++++++++++++++++
 .../mysql/show_discovery_rules.xml                 | 25 +++++++++++++++
 .../cases/rql/rql-integration-test-cases.xml       | 17 ++++++++++
 9 files changed, 260 insertions(+)

diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/mysql/show_readwrite_splitting_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/mysql/show_readwrite_splitting_rules.xml
new file mode 100644
index 0000000..82ffa54
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/mysql/show_readwrite_splitting_rules.xml
@@ -0,0 +1,37 @@
+<!--
+  ~ 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="name" />
+        <column name="auto_aware_data_source_name" />
+        <column name="write_data_source_name" />
+        <column name="read_data_source_names" />
+        <column name="load_balancer_type" />
+        <column name="load_balancer_props" />
+    </metadata>
+    <row values="pr_ds_0| null| write_ds_0| read_ds_0| ROUND_ROBIN| " />
+    <row values="pr_ds_1| null| write_ds_1| read_ds_1| ROUND_ROBIN| " />
+    <row values="pr_ds_2| null| write_ds_2| read_ds_2| ROUND_ROBIN| " />
+    <row values="pr_ds_3| null| write_ds_3| read_ds_3| ROUND_ROBIN| " />
+    <row values="pr_ds_4| null| write_ds_4| read_ds_4| ROUND_ROBIN| " />
+    <row values="pr_ds_5| null| write_ds_5| read_ds_5| ROUND_ROBIN| " />
+    <row values="pr_ds_6| null| write_ds_6| read_ds_6| ROUND_ROBIN| " />
+    <row values="pr_ds_7| null| write_ds_7| read_ds_7| ROUND_ROBIN| " />
+    <row values="pr_ds_8| null| write_ds_8| read_ds_8| ROUND_ROBIN| " />
+    <row values="pr_ds_9| null| write_ds_9| read_ds_9| ROUND_ROBIN| " />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_encrypt_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_encrypt_rule.xml
new file mode 100644
index 0000000..fe97e0a
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_encrypt_rule.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="table" />
+        <column name="logic_column" />
+        <column name="cipher_column" />
+        <column name="plain_column" />
+        <column name="encryptor_type" />
+        <column name="encryptor_props" />
+    </metadata>
+    <row values="t_user| pwd| pwd_cipher| pwd_plain| AES| aes-key-value=123456abc" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_encrypt_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_encrypt_rules.xml
new file mode 100644
index 0000000..34b34e7
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_encrypt_rules.xml
@@ -0,0 +1,31 @@
+<!--
+  ~ 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="table" />
+        <column name="logic_column" />
+        <column name="cipher_column" />
+        <column name="plain_column" />
+        <column name="encryptor_type" />
+        <column name="encryptor_props" />
+    </metadata>
+    <row values="t_user| pwd| pwd_cipher| pwd_plain| AES| aes-key-value=123456abc" />
+    <row values="t_user_details| number| number_cipher| number_plain| AES| aes-key-value=123456abc" />
+    <row values="t_user_encrypt_federate| pwd| cipher_pwd| plain_pwd| AES| aes-key-value=123456abc" />
+    <row values="t_user_encrypt_federate_sharding| pwd| cipher_pwd| plain_pwd| AES| aes-key-value=123456abc" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_readwrite_splitting_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_readwrite_splitting_rules.xml
new file mode 100644
index 0000000..04422bb
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_readwrite_splitting_rules.xml
@@ -0,0 +1,37 @@
+<!--
+  ~ 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="name" />
+        <column name="auto_aware_data_source_name" />
+        <column name="write_data_source_name" />
+        <column name="read_data_source_names" />
+        <column name="load_balancer_type" />
+        <column name="load_balancer_props" />
+    </metadata>
+    <row values="pr_ds_0| null| encrypt_write_ds_0| encrypt_read_ds_0| ROUND_ROBIN| " />
+    <row values="pr_ds_1| null| encrypt_write_ds_1| encrypt_read_ds_1| ROUND_ROBIN| " />
+    <row values="pr_ds_2| null| encrypt_write_ds_2| encrypt_read_ds_2| ROUND_ROBIN| " />
+    <row values="pr_ds_3| null| encrypt_write_ds_3| encrypt_read_ds_3| ROUND_ROBIN| " />
+    <row values="pr_ds_4| null| encrypt_write_ds_4| encrypt_read_ds_4| ROUND_ROBIN| " />
+    <row values="pr_ds_5| null| encrypt_write_ds_5| encrypt_read_ds_5| ROUND_ROBIN| " />
+    <row values="pr_ds_6| null| encrypt_write_ds_6| encrypt_read_ds_6| ROUND_ROBIN| " />
+    <row values="pr_ds_7| null| encrypt_write_ds_7| encrypt_read_ds_7| ROUND_ROBIN| " />
+    <row values="pr_ds_8| null| encrypt_write_ds_8| encrypt_read_ds_8| ROUND_ROBIN| " />
+    <row values="pr_ds_9| null| encrypt_write_ds_9| encrypt_read_ds_9| ROUND_ROBIN| " />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_encrypt_rule.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_encrypt_rule.xml
new file mode 100644
index 0000000..fe97e0a
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_encrypt_rule.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="table" />
+        <column name="logic_column" />
+        <column name="cipher_column" />
+        <column name="plain_column" />
+        <column name="encryptor_type" />
+        <column name="encryptor_props" />
+    </metadata>
+    <row values="t_user| pwd| pwd_cipher| pwd_plain| AES| aes-key-value=123456abc" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_encrypt_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_encrypt_rules.xml
new file mode 100644
index 0000000..b0f93c2
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_encrypt_rules.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="table" />
+        <column name="logic_column" />
+        <column name="cipher_column" />
+        <column name="plain_column" />
+        <column name="encryptor_type" />
+        <column name="encryptor_props" />
+    </metadata>
+    <row values="t_user| pwd| pwd_cipher| pwd_plain| AES| aes-key-value=123456abc" />
+    <row values="t_user_details| number| number_cipher| number_plain| AES| aes-key-value=123456abc" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/mysql/show_readwrite_splitting_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/mysql/show_readwrite_splitting_rules.xml
new file mode 100644
index 0000000..6aaf540
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/mysql/show_readwrite_splitting_rules.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="name" />
+        <column name="auto_aware_data_source_name" />
+        <column name="write_data_source_name" />
+        <column name="read_data_source_names" />
+        <column name="load_balancer_type" />
+        <column name="load_balancer_props" />
+    </metadata>
+    <row values="write-read-ds| null| write_ds| read_0,read_1| null| " />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_discovery_rules.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_discovery_rules.xml
new file mode 100644
index 0000000..caa88a0
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_discovery_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="name" />
+        <column name="dataSourceNames" />
+        <column name="discoverType" />
+        <column name="discoverProps" />
+    </metadata>
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
index ba9312a..bb49187 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
@@ -42,4 +42,21 @@
     <test-case sql="SHOW SHARDING BROADCAST TABLE RULES">
         <assertion expected-data-file="show_broadcast_rules.xml" />
     </test-case>
+
+    <test-case sql="SHOW READWRITE_SPLITTING RULES" scenario-types="dbtbl_with_readwrite_splitting,readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt">
+        <assertion expected-data-file="show_readwrite_splitting_rules.xml" />
+    </test-case>
+
+    <test-case sql="SHOW ENCRYPT RULES" scenario-types="dbtbl_with_readwrite_splitting_and_encrypt,encrypt">
+        <assertion expected-data-file="show_encrypt_rules.xml" />
+    </test-case>
+
+    <test-case sql="SHOW ENCRYPT TABLE RULE t_user" scenario-types="dbtbl_with_readwrite_splitting_and_encrypt,encrypt">
+        <assertion expected-data-file="show_encrypt_rule.xml" />
+    </test-case>
+
+    <!--TODO add db discovery tests-->
+    <test-case sql="SHOW DB_DISCOVERY RULES" scenario-types="sharding_governance">
+        <assertion expected-data-file="show_discovery_rules.xml" />
+    </test-case>
 </integration-test-cases>