peilinqian opened a new issue, #18567: URL: https://github.com/apache/shardingsphere/issues/18567
## 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_181 ShardingSphere-5.1.3-SNAPSHOT Commit ID: 9cdbba7caebafc59be9842f7dd73aaad7721d12b Commit Message: Refactor RulesUsedResourceQueryResultSet (#18520) Branch: master Build time: 2022-06-22T19:07:02+0000 ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? ShardingSphere-Proxy ### Expected behavior Drop view of broadcast table,all data source‘s view are dropped ### Actual behavior Drop view of broadcast table,only one data source‘s view is dropped ### Reason analyze (If you can) ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. ``` create table t_broadcast(id int,c_id int,a int,b text); insert into t_broadcast values (1,1,10,'test1'),(2,2,20,'test2'), (3,3,10,'test3'),(4,4,40,'test4'),(5,5,50,'test5'); create view t_broadcast_view as select * from t_broadcast; drop view t_broadcast_view; drop table t_broadcast; ``` scene 1 ``` cursor_db=> create view t_broadcast_view as select * from t_broadcast; CREATE VIEW cursor_db=> drop view t_broadcast_view; DROP VIEW cursor_db=> drop table t_broadcast; DROP TABLE #############ds_0 broadcast table and view is not dropped; test_cursor=# \d List of relations Schema | Name | Type | Owner | Storage --------+------------------+-------+----------+---------------------------------- public | t_broadcast | table | tpccuser | {orientation=row,compression=no} public | t_broadcast_view | view | tpccuser | ######backend log [INFO ] 2022-06-24 16:15:05.054 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Logic SQL: create view t_broadcast_view as select * from t_broadcast; [INFO ] 2022-06-24 16:15:05.054 [Connection-20-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateViewStatement() [INFO ] 2022-06-24 16:15:05.054 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: create view t_broadcast_view as select * from t_broadcast; [INFO ] 2022-06-24 16:15:05.054 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: create view t_broadcast_view as select * from t_broadcast; [INFO ] 2022-06-24 16:15:05.061 [HikariPool-2 connection adder] o.o.core.v3.ConnectionFactoryImpl - [44079947-958b-431a-8f80-59373804791c] Try to connect. IP: 10.28.13.92:14000 [INFO ] 2022-06-24 16:15:05.108 [HikariPool-2 connection adder] o.o.core.v3.ConnectionFactoryImpl - [10.28.13.92:36002/10.28.13.92:14000] Connection is established. ID: 44079947-958b-431a-8f80-59373804791c [INFO ] 2022-06-24 16:15:05.110 [HikariPool-2 connection adder] o.o.core.v3.ConnectionFactoryImpl - Connect complete. ID: 44079947-958b-431a-8f80-59373804791c [INFO ] 2022-06-24 16:15:05.248 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop view t_broadcast_view; [INFO ] 2022-06-24 16:15:05.248 [Connection-20-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropViewStatement() [INFO ] 2022-06-24 16:15:05.248 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop view t_broadcast_view; [INFO ] 2022-06-24 16:15:07.372 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop table t_broadcast; [INFO ] 2022-06-24 16:15:07.372 [Connection-20-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropTableStatement(containsExistClause=false) [INFO ] 2022-06-24 16:15:07.372 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop table t_broadcast; [INFO ] 2022-06-24 16:15:07.372 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: drop table t_broadcast; [INFO ] 2022-06-24 16:26:07.216 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Logic SQL: /* ShardingSphere hint: dataSourceName=ds_0*/ select * from t_broadcast_view; [INFO ] 2022-06-24 16:26:07.216 [Connection-20-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty) [INFO ] 2022-06-24 16:26:07.216 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: /* ShardingSphere hint: dataSourceName=ds_0*/ select * from t_broadcast_view; [ERROR] 2022-06-24 16:26:07.216 [Connection-20-ThreadExecutor] o.o.core.v3.QueryExecutorImpl - IO Exception.recieved packetType:69last PacketType:-1connection info:10.28.13.92:53684/10.29.180.204:14000buffer : buffer is empty [INFO ] 2022-06-24 16:26:07.217 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [185f3a68-a4ef-4aec-9e7b-c16b195b7a92] Try to connect. IP: 10.29.180.204:14000 [INFO ] 2022-06-24 16:26:07.270 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [10.28.13.92:54662/10.29.180.204:14000] Connection is established. ID: 185f3a68-a4ef-4aec-9e7b-c16b195b7a92 [INFO ] 2022-06-24 16:26:07.273 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - Connect complete. ID: 185f3a68-a4ef-4aec-9e7b-c16b195b7a92 [INFO ] 2022-06-24 16:26:07.276 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [4480bbaa-a6f2-4eee-b572-90d44ffe6adf] Try to connect. IP: 10.29.180.204:14000 [INFO ] 2022-06-24 16:26:07.331 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [10.28.13.92:54664/10.29.180.204:14000] Connection is established. ID: 4480bbaa-a6f2-4eee-b572-90d44ffe6adf [INFO ] 2022-06-24 16:26:07.335 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - Connect complete. ID: 4480bbaa-a6f2-4eee-b572-90d44ffe6adf [INFO ] 2022-06-24 16:26:18.402 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Logic SQL: /* ShardingSphere hint: dataSourceName=ds_1*/ select * from t_broadcast_view; [INFO ] 2022-06-24 16:26:18.402 [Connection-20-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty) [INFO ] 2022-06-24 16:26:18.402 [Connection-20-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: /* ShardingSphere hint: dataSourceName=ds_1*/ select * from t_broadcast_view; [ERROR] 2022-06-24 16:26:18.407 [Connection-20-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: org.opengauss.util.PSQLException: [10.28.13.92:35596/10.28.13.92:14000] ERROR: relation "t_broadcast_view" does not exist on dn_6001 ``` scene 2 ``` cursor_db=> drop view t_broadcast_view ; DROP VIEW cursor_db=> drop table t_broadcast ; ERROR: cannot drop table t_broadcast because other objects depend on it DETAIL: view t_broadcast_view depends on table t_broadcast HINT: Use DROP ... CASCADE to drop the dependent objects too. ######backend log [INFO ] 2022-06-24 16:45:05.274 [Connection-4-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: drop view t_broadcast_view ; [INFO ] 2022-06-24 16:45:24.945 [Connection-4-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop table t_broadcast ; [INFO ] 2022-06-24 16:45:24.945 [Connection-4-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropTableStatement(containsExistClause=false) [INFO ] 2022-06-24 16:45:24.945 [Connection-4-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop table t_broadcast ; [INFO ] 2022-06-24 16:45:24.945 [Connection-4-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: drop table t_broadcast ; [ERROR] 2022-06-24 16:45:24.961 [Connection-4-ThreadExecutor] o.a.s.p.f.c.CommandExecutorTask - Exception occur: org.opengauss.util.PSQLException: [7.212.123.28:42440/10.28.13.92:14000] ERROR: cannot drop table t_broadcast because other objects depend on it Detail: view t_broadcast_view depends on table t_broadcast Hint: Use DROP ... CASCADE to drop the dependent objects too. ``` ### 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]
