You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/09/05 01:24:10 UTC

[GitHub] [shardingsphere] peilinqian opened a new issue, #20780: "alter view t_broadcast_view rename to t_broadcast_view_new;" does not verify whether the new view is configured with sharding rules or

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

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   we find java version: java8, full_version=1.8.0_282
   ShardingSphere-5.1.3-SNAPSHOT
   Commit ID: dirty-635d9db1bc423ad1d55d6f986d71bc2b47acf922
   Commit Message: Fix RUL DistSQL execution failure in transaction(#19831) (#19834)
   Tag: 5.2.0
   Build time: 2022-09-01T18:55:02+0800
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ### Expected behavior
   alter view .. rename to ..,new view name is not configured with broadcast rule;alter failed
   ### Actual behavior
   alter view .. rename to ..,new view name is not configured with broadcast rule;alter succeeded
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   --create
   drop view if exists t_broadcast_view;
   drop view if exists t_broadcast_view_new;
   drop table if exists t_broadcast;
   create table t_broadcast(id int,c_id int,a int,b char(10));
   insert into t_broadcast 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,'');
   --create view;expect:succes
   alter sharding broadcast table rules (t_broadcast,t_broadcast_view);
   create view t_broadcast_view as select * from t_broadcast;
   select * from t_broadcast_view where id=4;
   --alter view .. rename to ..,new view name is not configured with broadcast rule;
   alter view t_broadcast_view rename to t_broadcast_view_new;
   --drop new view ;
   drop view t_broadcast_view_new; **--only one DataSource dropped**
   
   
   Background log
   ```
   [INFO ] 2022-09-05 09:17:31.253 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds1_0 ::: create view t_broadcast_view as select * from t_broadcast;
   [INFO ] 2022-09-05 09:17:31.253 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds1_1 ::: create view t_broadcast_view as select * from t_broadcast;
   [INFO ] 2022-09-05 09:17:31.302 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select * from t_broadcast_view where id=4;
   [INFO ] 2022-09-05 09:17:31.302 [Connection-2-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(super=SelectStatement(super=AbstractSQLStatement(parameterCount=0, parameterMarkerSegments=[], commentSegments=[]), projections=ProjectionsSegment(startIndex=7, stopIndex=7, projections=[ShorthandProjectionSegment(startIndex=7, stopIndex=7, owner=Optional.empty, alias=Optional.empty)], distinctRow=false), from=SimpleTableSegment(tableName=TableNameSegment(startIndex=14, stopIndex=29, identifier=IdentifierValue(value=t_broadcast_view, quoteCharacter=NONE)), owner=Optional.empty, alias=Optional.empty), where=Optional[WhereSegment(startIndex=31, stopIndex=40, expr=BinaryOperationExpression(startIndex=37, stopIndex=40, left=ColumnSegment(startIndex=37, stopIndex=38, identifier=IdentifierValue(value=id, quoteCharacter=NONE), owner=Optional.empty), right=LiteralExpressionSegment(startIndex=40, stopIndex=40, literals=4), operator==, text=id=4))], groupBy=Optional.empt
 y, having=Optional.empty, orderBy=Optional.empty, combines=[]), limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-09-05 09:17:31.302 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds1_0 ::: select * from t_broadcast_view where id=4;
   [INFO ] 2022-09-05 09:17:31.314 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Logic SQL: alter view t_broadcast_view rename to t_broadcast_view_new;
   [INFO ] 2022-09-05 09:17:31.314 [Connection-2-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussAlterViewStatement(super=AlterViewStatement(super=AbstractSQLStatement(parameterCount=0, parameterMarkerSegments=[], commentSegments=[]), view=SimpleTableSegment(tableName=TableNameSegment(startIndex=11, stopIndex=26, identifier=IdentifierValue(value=t_broadcast_view, quoteCharacter=NONE)), owner=Optional.empty, alias=Optional.empty)), renameView=Optional[SimpleTableSegment(tableName=TableNameSegment(startIndex=38, stopIndex=57, identifier=IdentifierValue(value=t_broadcast_view_new, quoteCharacter=NONE)), owner=Optional.empty, alias=Optional.empty)])
   [INFO ] 2022-09-05 09:17:31.314 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds1_0 ::: alter view t_broadcast_view rename to t_broadcast_view_new;
   [INFO ] 2022-09-05 09:17:31.314 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds1_1 ::: alter view t_broadcast_view rename to t_broadcast_view_new;
   [INFO ] 2022-09-05 09:17:34.012 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop view t_broadcast_view_new;
   [INFO ] 2022-09-05 09:17:34.012 [Connection-2-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropViewStatement(super=DropViewStatement(super=AbstractSQLStatement(parameterCount=0, parameterMarkerSegments=[], commentSegments=[]), views=[SimpleTableSegment(tableName=TableNameSegment(startIndex=10, stopIndex=29, identifier=IdentifierValue(value=t_broadcast_view_new, quoteCharacter=NONE)), owner=Optional.empty, alias=Optional.empty)]))
   [INFO ] 2022-09-05 09:17:34.012 [Connection-2-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds1_0 ::: drop view t_broadcast_view_new;
   ```
   
   
   ### 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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu closed issue #20780: "alter view t_broadcast_view rename to t_broadcast_view_new;" does not verify whether the new view is configured with sharding rules or

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #20780: "alter view t_broadcast_view rename to t_broadcast_view_new;" does not verify whether the new view is configured with sharding rules or 
URL: https://github.com/apache/shardingsphere/issues/20780


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org