lanchengx opened a new issue #15623:
URL: https://github.com/apache/shardingsphere/issues/15623


   **Current status**: All DROP syntaxes in current DistSQL will prompt an 
exception when the deleted target does not exist.
   
   **Problem**: Not friendly enough when using script execution.
   
   **Improvement measures:** Add the keyword `IF EXISTS` to all drop syntaxes. 
If the keyword is included in the statement, it is not checked whether the 
target to be dropped exists.
   
   **Execution result:** if the target exists, drop it, even if it does not 
exist, no exception will be prompted
   
   **Example**
   
   > DROP RESOURCE IF EXISTS resource_0;
   > DROP SHARDING TABLE RULES IF EXISTS t_order;
   
   - [ ] `DROP RESOURCE IF EXISTS resource_0;`
   - [ ] `DROP SHARDING KEY GENERATOR IF EXISTS snowflake_key_generator;`
   - [ ] `DROP SHARDING ALGORITHM IF EXISTS t_order_hash_mod;`
   - [ ] `DROP SHARDING TABLE RULE IF EXISTS t_order;`
   - [ ] `DROP DEFAULT SHARDING DATABASE STRATEGY IF EXISTS;`
   - [ ] `DROP SHARDING BINDING TABLE RULES  IF EXISTS (t_order,t_order_item);`
   - [ ] `DROP SHARDING BROADCAST TABLE RULES  IF EXISTS t_b;`
   - [ ] `DROP SHARDING SCALING RULE IF EXISTS sharding_scaling;`
   - [ ] `DROP DEFAULT SINGLE TABLE RULE IF EXISTS`
   - [ ] `DROP READWRITE_SPLITTING RULE IF EXISTS ms_group_1;`
   - [ ] `DROP DB_DISCOVERY RULE IF EXISTS db_discovery_group_0;`
   - [ ] `DROP DB_DISCOVERY TYPE IF EXISTS db_discovery_group_0_mgr;`
   - [ ] `DROP DB_DISCOVERY HEARTBEAT IF EXISTS db_discovery_group_0_heartbeat;`
   - [ ] `DROP ENCRYPT RULE IF EXISTS t_encrypt,t_encrypt_2;`
   - [ ] `DROP SHADOW RULE IF EXISTS shadow_rule;`
   - [ ] `DROP SHADOW ALGORITHM IF EXISTS simple_note_algorithm;`
   
   


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