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 e5c42b6  fix shadow spring namespace config (#7606)
e5c42b6 is described below

commit e5c42b6b117e0619d333bab5d951d5958e096e58
Author: xiaoyu <[email protected]>
AuthorDate: Fri Sep 25 17:55:56 2020 +0800

    fix shadow spring namespace config (#7606)
---
 .../resources/META-INF/application-encrypt-shadow-databases.xml  | 6 +-----
 .../application-primary-replica-replication-shadow-databases.xml | 9 ++-------
 .../src/main/resources/META-INF/application-shadow-databases.xml | 6 +-----
 .../resources/META-INF/application-sharding-shadow-databases.xml | 7 +------
 examples/src/resources/manual_schema.sql                         | 3 +++
 5 files changed, 8 insertions(+), 23 deletions(-)

diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-encrypt-shadow-databases.xml
 
b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-encrypt-shadow-databases.xml
index bd9cac8..0be5641 100644
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-encrypt-shadow-databases.xml
+++ 
b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-encrypt-shadow-databases.xml
@@ -52,11 +52,7 @@
         <property name="password" value=""/>
     </bean>
     
-    <shadow:rule id="shadowRule" column="shadow">
-        <shadow:mappings>
-            <shadow:mapping product-data-source-name="ds" 
shadow-data-source-name="shadow_ds"/>
-        </shadow:mappings>
-    </shadow:rule>
+    <shadow:rule id="shadowRule" column="shadow" sourceDataSourceNames="ds" 
shadowDataSourceNames="shadow_ds"/>
     
     <encrypt:encrypt-algorithm id="name_encryptor" type="AES">
         <props>
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-primary-replica-replication-shadow-databases.xml
 
b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-primary-replica-replication-shadow-databases.xml
index dfe9a96..15fd415 100644
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-primary-replica-replication-shadow-databases.xml
+++ 
b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-primary-replica-replication-shadow-databases.xml
@@ -66,13 +66,8 @@
         <property name="password" value=""/>
     </bean>
     
-    <shadow:rule id="shadowRule" column="shadow">
-        <shadow:mappings>
-            <shadow:mapping product-data-source-name="primary_ds" 
shadow-data-source-name="shadow_primary_ds" />
-            <shadow:mapping product-data-source-name="replica_ds" 
shadow-data-source-name="shadow_replica_ds" />
-        </shadow:mappings>
-    </shadow:rule>
-    
+    <shadow:rule id="shadowRule" column="shadow" 
sourceDataSourceNames="primary_ds,replica_ds" 
shadowDataSourceNames="shadow_primary_ds,shadow_replica_ds"/>
+
     <shardingsphere:data-source id="shadowDataSource" 
data-source-names="primary_ds,replica_ds,shadow_primary_ds,shadow_replica_ds" 
rule-refs="shadowRule,primaryReplicaReplicationRule">
         <props>
             <prop key="sql-show">true</prop>
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-shadow-databases.xml
 
b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-shadow-databases.xml
index 86bdbf6..55c7fef 100644
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-shadow-databases.xml
+++ 
b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-shadow-databases.xml
@@ -49,11 +49,7 @@
         <property name="password" value=""/>
     </bean>
 
-    <shadow:rule id="shadowRule" column="shadow">
-        <shadow:mappings>
-            <shadow:mapping product-data-source-name="ds" 
shadow-data-source-name="shadow_ds"/>
-        </shadow:mappings>
-    </shadow:rule>
+    <shadow:rule id="shadowRule" column="shadow" sourceDataSourceNames="ds" 
shadowDataSourceNames="shadow_ds"/>
 
     <shardingsphere:data-source id="shadowDataSource" 
data-source-names="ds,shadow_ds" rule-refs="shadowRule">
         <props>
diff --git 
a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-sharding-shadow-databases.xml
 
b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-sharding-shadow-databases.xml
index 62dc3d4..42a7033 100644
--- 
a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-sharding-shadow-databases.xml
+++ 
b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-spring-namespace-example/src/main/resources/META-INF/application-sharding-shadow-databases.xml
@@ -80,12 +80,7 @@
         </props>
     </sharding:sharding-algorithm>
 
-    <shadow:rule id="shadowRule" column="shadow">
-        <shadow:mappings>
-            <shadow:mapping product-data-source-name="ds_0" 
shadow-data-source-name="shadow_ds_0"/>
-            <shadow:mapping product-data-source-name="ds_1" 
shadow-data-source-name="shadow_ds_1"/>
-        </shadow:mappings>
-    </shadow:rule>
+    <shadow:rule id="shadowRule" column="shadow" 
sourceDataSourceNames="ds_0,ds_1" 
shadowDataSourceNames="shadow_ds_0,shadow_ds_1"/>
 
     <shardingsphere:data-source id="shardingShadowDataSource" 
data-source-names="ds_0,ds_1,shadow_ds_0,shadow_ds_1" 
rule-refs="shadowRule,shardingRule">
         <props>
diff --git a/examples/src/resources/manual_schema.sql 
b/examples/src/resources/manual_schema.sql
index 77a740c..b17f612 100644
--- a/examples/src/resources/manual_schema.sql
+++ b/examples/src/resources/manual_schema.sql
@@ -69,3 +69,6 @@ CREATE SCHEMA IF NOT EXISTS shadow_demo_ds;
 -- CREATE TABLE IF NOT EXISTS demo_primary_ds_1_replica_0.t_order_item_1 
(order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, 
user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
 -- CREATE TABLE IF NOT EXISTS demo_primary_ds_1_replica_1.t_order_item_0 
(order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, 
user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
 -- CREATE TABLE IF NOT EXISTS demo_primary_ds_1_replica_1.t_order_item_1 
(order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, 
user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
+
+-- CREATE TABLE IF NOT EXISTS demo_shadow_replica_ds.t_user (user_id INT NOT 
NULL AUTO_INCREMENT, user_name VARCHAR(200), user_name_plain VARCHAR(200), pwd 
VARCHAR(200), assisted_query_pwd VARCHAR(200), PRIMARY KEY (user_id));
+-- CREATE TABLE IF NOT EXISTS demo_replica_ds.t_user (user_id INT NOT NULL 
AUTO_INCREMENT, user_name VARCHAR(200), user_name_plain VARCHAR(200), pwd 
VARCHAR(200), assisted_query_pwd VARCHAR(200), PRIMARY KEY (user_id));

Reply via email to