peilinqian opened a new issue, #20975:
URL: https://github.com/apache/shardingsphere/issues/20975

   ### Which version of ShardingSphere did you use?
   we find java version: java8, full_version=1.8.0_342, 
full_path=/home/peilq_sharding/bisheng-jdk1.8.0_342//bin/java
   ShardingSphere-5.2.1-SNAPSHOT
   Commit ID: dirty-f44e5d3c09a38139dbb2e1b0548816aa572ccc3c
   Commit Message: Release 5.2.0 and prepare for next development iteration 
(#20886)
   Branch: f44e5d3c09a38139dbb2e1b0548816aa572ccc3c
   Build time: 2022-09-13T11:31:41+0800
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   Rename the view for sharding view successfully
   ### Actual behavior
   Rename the view for sharding view failed
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   ```
   drop view if exists t_ssdb_tb_view;
   drop view if exists t_ssdb_tb_view_new;
   drop table if exists t_ssdb_tb;
   create table t_ssdb_tb(id int,c_id int,a int,b char(10));
   insert into t_ssdb_tb values 
(1,1,10,'test11'),(1,2,10,'Test12'),(1,2,null,'test12'),
   (2,1,20,'test21'),(2,2,20,'test22'),(2,3,null,'Test22'),
   (3,3,null,'test3'),(3,3,null,'test3'),(4,4,40,'test4'),(5,5,50,'Test5');
   
   create sharding binding table rules (t_ssdb_tb_view, 
t_ssdb_tb,t_ssdb_tb_view_new);
   create view t_ssdb_tb_view as select * from t_ssdb_tb;
   select * from t_ssdb_tb_view where id=4;
   alter view t_ssdb_tb_view rename to t_ssdb_tb_view_new;
   
   ```
   
   Background log
   ```
   [INFO ] 2022-09-14 17:11:22.075 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Logic SQL: alter view t_ssdb_tb_view rename to 
t_ssdb_tb_view_new;
   [INFO ] 2022-09-14 17:11:22.076 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - SQLStatement: 
OpenGaussAlterViewStatement(super=AlterViewStatement(super=AbstractSQLStatement(parameterCount=0,
 parameterMarkerSegments=[], commentSegments=[]), 
view=SimpleTableSegment(tableName=TableNameSegment(startIndex=11, stopIndex=24, 
identifier=IdentifierValue(value=t_ssdb_tb_view, quoteCharacter=NONE)), 
owner=Optional.empty, alias=Optional.empty)), 
renameView=Optional[SimpleTableSegment(tableName=TableNameSegment(startIndex=36,
 stopIndex=53, identifier=IdentifierValue(value=t_ssdb_tb_view_new, 
quoteCharacter=NONE)), owner=Optional.empty, alias=Optional.empty)])
   [INFO ] 2022-09-14 17:11:22.076 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: write_1 ::: alter view t_ssdb_tb_view_0 rename 
to t_ssdb_tb_view_new;
   [INFO ] 2022-09-14 17:11:22.076 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: write_1 ::: alter view t_ssdb_tb_view_1 rename 
to t_ssdb_tb_view_new;
   [INFO ] 2022-09-14 17:11:22.076 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: write_0 ::: alter view t_ssdb_tb_view_0 rename 
to t_ssdb_tb_view_new;
   [INFO ] 2022-09-14 17:11:22.076 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: write_0 ::: alter view t_ssdb_tb_view_1 rename 
to t_ssdb_tb_view_new;
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   
   rules:
   - !SHARDING
     tables:
       t_ssdb_tb:
         actualDataNodes: ds_${0..1}.t_ssdb_tb_${0..1}
         databaseStrategy:
           standard:
             shardingAlgorithmName: ds_database_inline
             shardingColumn: id
         tableStrategy:
           standard:
             shardingColumn: c_id
             shardingAlgorithmName: ts_t_ssdb_tb_inline
       t_ssdb_tb_view:
         actualDataNodes: ds_${0..1}.t_ssdb_tb_view_${0..1}
         databaseStrategy:
           standard:
             shardingAlgorithmName: ds_database_inline
             shardingColumn: id
         tableStrategy:
           standard:
             shardingColumn: c_id
             shardingAlgorithmName: ts_t_ssdb_tb_view_inline
       t_ssdb_tb_view_new:
         actualDataNodes: ds_${0..1}.t_ssdb_tb_view_new_${0..1}
         databaseStrategy:
           standard:
             shardingAlgorithmName: ds_database_inline
             shardingColumn: id
         tableStrategy:
           standard:
             shardingColumn: c_id
             shardingAlgorithmName: ts_t_ssdb_tb_view_new_inline
     defaultTableStrategy:
       none:
     defaultDatabaseStrategy:
       none:
     shardingAlgorithms:
       ds_database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${id % 2}
           allow-range-query-with-inline-sharding: true
       ts_t_ssdb_tb_inline:
         type: INLINE
         props:
           algorithm-expression: t_ssdb_tb_${c_id % 2}
           allow-range-query-with-inline-sharding: true
       ts_t_ssdb_tb_view_inline:
         type: INLINE
         props:
           algorithm-expression: t_ssdb_tb_view_${c_id % 2}
           allow-range-query-with-inline-sharding: true
       ts_t_ssdb_tb_view_new_inline:
         type: INLINE
         props:
           algorithm-expression: t_ssdb_tb_view_new_${c_id % 2}
           allow-range-query-with-inline-sharding: true
   
   


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