strongduanmu opened a new issue #13556:
URL: https://github.com/apache/shardingsphere/issues/13556


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   master branch
   
   After PR#13531 was merged, shadow provided the configuration of the logical 
data source name, which caused problems in the processing logic of the 
dataNode, and finally resulted in NPE when loading metadata.
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   
   Execute shadow example successfully
   
   ### Actual behavior
   
   NPE occurs
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   shadow-spring-boot-mybatis-example——application.properties
   
   ```properties
   #spring.profiles.active=shadow
   #spring.profiles.active=shadow-default-algorithm
   spring.profiles.active=shadow-readwrite-splitting
   #spring.profiles.active=shadow-sharding-databases
   #spring.profiles.active=shadow-encrypt
   
   spring.shardingsphere.props.sql-show=true
   spring.shardingsphere.props.sql-comment-parse-enabled=true
   
   mybatis.config-location=classpath:META-INF/mybatis-config.xml
   ```
   
   
shadow-spring-boot-mybatis-example——application-shadow-readwrite-splitting.properties
   
   ```properties
   
   
spring.shardingsphere.datasource.names=write-ds,read-ds,shadow-write-ds,shadow-read-ds
   
   
spring.shardingsphere.datasource.write-ds.jdbc-url=jdbc:mysql://localhost:3306/demo_write_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   
spring.shardingsphere.datasource.write-ds.type=com.zaxxer.hikari.HikariDataSource
   
spring.shardingsphere.datasource.write-ds.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.write-ds.username=root
   spring.shardingsphere.datasource.write-ds.password=123456
   
   
spring.shardingsphere.datasource.shadow-write-ds.jdbc-url=jdbc:mysql://localhost:3306/demo_shadow_write_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   
spring.shardingsphere.datasource.shadow-write-ds.type=com.zaxxer.hikari.HikariDataSource
   
spring.shardingsphere.datasource.shadow-write-ds.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.shadow-write-ds.username=root
   spring.shardingsphere.datasource.shadow-write-ds.password=123456
   
   
spring.shardingsphere.datasource.read-ds.jdbc-url=jdbc:mysql://localhost:3306/demo_write_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   
spring.shardingsphere.datasource.read-ds.type=com.zaxxer.hikari.HikariDataSource
   
spring.shardingsphere.datasource.read-ds.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.read-ds.username=root
   spring.shardingsphere.datasource.read-ds.password=123456
   
   
spring.shardingsphere.datasource.shadow-read-ds.jdbc-url=jdbc:mysql://localhost:3306/demo_shadow_write_ds?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   
spring.shardingsphere.datasource.shadow-read-ds.type=com.zaxxer.hikari.HikariDataSource
   
spring.shardingsphere.datasource.shadow-read-ds.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.shadow-read-ds.username=root
   spring.shardingsphere.datasource.shadow-read-ds.password=123456
   
   
spring.shardingsphere.rules.readwrite-splitting.load-balancers.round_robin.type=ROUND_ROBIN
   
   
spring.shardingsphere.rules.readwrite-splitting.data-sources.pr_ds.write-data-source-name=shadow-data-source-write
   
spring.shardingsphere.rules.readwrite-splitting.data-sources.pr_ds.read-data-source-names=shadow-data-source-read
   
spring.shardingsphere.rules.readwrite-splitting.data-sources.pr_ds.load-balancer-name=round_robin
   
   spring.shardingsphere.rules.shadow.enable=true
   
spring.shardingsphere.rules.shadow.data-sources.shadow-data-source-write.source-data-source-name=write-ds
   
spring.shardingsphere.rules.shadow.data-sources.shadow-data-source-write.shadow-data-source-name=shadow-write-ds
   
spring.shardingsphere.rules.shadow.data-sources.shadow-data-source-read.source-data-source-name=read-ds
   
spring.shardingsphere.rules.shadow.data-sources.shadow-data-source-read.shadow-data-source-name=shadow-read-ds
   
   
spring.shardingsphere.rules.shadow.tables.t_user.data-source-names=shadow-data-source-write,shadow-data-source-read
   
spring.shardingsphere.rules.shadow.tables.t_user.shadow-algorithm-names=user-id-insert-match-algorithm,user-id-delete-match-algorithm,user-id-select-match-algorithm,simple-hint-algorithm
   
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.type=REGEX_MATCH
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.operation=insert
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.column=user_type
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-insert-match-algorithm.props.regex=[1]
   
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-delete-match-algorithm.type=REGEX_MATCH
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-delete-match-algorithm.props.operation=delete
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-delete-match-algorithm.props.column=user_type
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-delete-match-algorithm.props.regex=[1]
   
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-select-match-algorithm.type=REGEX_MATCH
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-select-match-algorithm.props.operation=select
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-select-match-algorithm.props.column=user_type
   
spring.shardingsphere.rules.shadow.shadow-algorithms.user-id-select-match-algorithm.props.regex=[1]
   
   
spring.shardingsphere.rules.shadow.shadow-algorithms.simple-hint-algorithm.type=SIMPLE_HINT
   
spring.shardingsphere.rules.shadow.shadow-algorithms.simple-hint-algorithm.props.shadow=true
   
spring.shardingsphere.rules.shadow.shadow-algorithms.simple-hint-algorithm.props.foo=bar
   ```
   
   And then run ShadowSpringBootMybatisExample.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to