RaigorJiang opened a new pull request, #21093:
URL: https://github.com/apache/shardingsphere/pull/21093

   For #19102. 
   
   Check duplicate write resource & read resources when execute `CREATE 
READWRITE_SPLITTING RULE` and `ALTER READWRITE_SPLITTING RULE`
   
   Changes proposed in this pull request:
     - add check methods
     - add test cases
   
   
   ### Sample
   #### CREATE
   ```sql
   mysql> CREATE READWRITE_SPLITTING RULE ms_group_1(
       -> WRITE_RESOURCE=ds_3,
       -> READ_RESOURCES(ds_1),
       -> TYPE(NAME="random")
       -> );
   ERROR 1117 (C1117): Invalid readwrite splitting rule ms_group_1, error 
message is: Can not config duplicate read resource `ds_1` in database 
`sharding_db`.
   ```
   
   #### ALTER
   ```sql
   mysql> ALTER READWRITE_SPLITTING RULE ms_group_1(
       -> WRITE_RESOURCE=ds_0,
       -> READ_RESOURCES(ds_2),
       -> TYPE(NAME="random")
       -> );
   ERROR 1117 (C1117): Invalid readwrite splitting rule ms_group_1, error 
message is: Can not config duplicate write resource `ds_0` in database 
`sharding_db`.
   ```
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following 
options:
   - [x] My code follows the [code of 
conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) 
of this project.
   - [x] I have self-reviewed the commit code.
   - [x] I have triggered maven check: `mvn clean install -B -T2C -DskipTests 
-Dmaven.javadoc.skip=true -e`.
   - [x] I have made corresponding changes to the documentation.
   - [x] I have added corresponding unit tests for my changes.
   


-- 
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