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/06/20 03:25:11 UTC

[GitHub] [shardingsphere] tuichenchuxin commented on issue #18432: create view(Single Table,no shard configured),jdbc calls ss-proxy, probabilistic failure

tuichenchuxin commented on issue #18432:
URL: https://github.com/apache/shardingsphere/issues/18432#issuecomment-1159926540

   I tried times, but didn't get error.
   ```
       public static void main(String[] args) throws SQLException {
           Connection connection = DriverManager.getConnection("jdbc:opengauss://127.0.0.1:3307/sharding_db",
                   "sharding", "sharding");
           Statement stmt = null;
           stmt = connection.createStatement();
           int rc = stmt.executeUpdate(
                   "drop table if exists test cascade;drop view if exists test_view;CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10));");
           System.out.println("createresult = " + rc);
           int createview = stmt.executeUpdate("create view test_view as select aa,id2 from test where id>80");
           System.out.println("insertresult = " + createview);
           ResultSet resultSet = stmt.executeQuery("select * from test_view");
           if (resultSet.next()) {
               System.out.println(resultSet.getString(0) + resultSet.getString(1));
           } else {
               System.out.println("查询结果为空");
           }
           stmt.close();
           connection.close();
       }
   ```
   ```
   [INFO ] 2022-06-20 11:22:11.349 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select version()
   [INFO ] 2022-06-20 11:22:11.349 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:11.349 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select version()
   [INFO ] 2022-06-20 11:22:11.380 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select name, setting from pg_settings where name in ('connection_info')
   [INFO ] 2022-06-20 11:22:11.380 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:11.380 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select name, setting from pg_settings where name in ('connection_info')
   [INFO ] 2022-06-20 11:22:11.392 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.392 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSetStatement()
   [INFO ] 2022-06-20 11:22:11.392 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.392 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.398 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.398 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSetStatement()
   [INFO ] 2022-06-20 11:22:11.398 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: primary_ds ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:11.403 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select count(*) from pg_settings where name = 'support_batch_bind' and setting = 'on'
   [INFO ] 2022-06-20 11:22:11.403 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:11.403 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select count(*) from pg_settings where name = 'support_batch_bind' and setting = 'on'
   [INFO ] 2022-06-20 11:22:11.410 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop table if exists test cascade
   [INFO ] 2022-06-20 11:22:11.410 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropTableStatement(containsExistClause=true)
   [INFO ] 2022-06-20 11:22:11.410 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop table if exists test cascade
   [INFO ] 2022-06-20 11:22:11.430 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop view if exists test_view
   [INFO ] 2022-06-20 11:22:11.430 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropViewStatement()
   [INFO ] 2022-06-20 11:22:11.430 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop view if exists test_view
   [INFO ] 2022-06-20 11:22:11.439 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10))
   [INFO ] 2022-06-20 11:22:11.439 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateTableStatement(containsNotExistClause=false)
   [INFO ] 2022-06-20 11:22:11.439 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10))
   [INFO ] 2022-06-20 11:22:11.510 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: create view test_view as select aa,id2 from test where id>80
   [INFO ] 2022-06-20 11:22:11.510 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateViewStatement()
   [INFO ] 2022-06-20 11:22:11.510 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: create view test_view as select aa,id2 from test where id>80
   [INFO ] 2022-06-20 11:22:11.583 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select * from test_view
   [INFO ] 2022-06-20 11:22:11.583 [Connection-17-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:11.583 [Connection-17-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: select * from test_view
   [INFO ] 2022-06-20 11:22:28.867 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select version()
   [INFO ] 2022-06-20 11:22:28.867 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:28.867 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: select version()
   [INFO ] 2022-06-20 11:22:28.902 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select name, setting from pg_settings where name in ('connection_info')
   [INFO ] 2022-06-20 11:22:28.903 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:28.903 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select name, setting from pg_settings where name in ('connection_info')
   [INFO ] 2022-06-20 11:22:28.920 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.920 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSetStatement()
   [INFO ] 2022-06-20 11:22:28.920 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.920 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.923 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.923 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSetStatement()
   [INFO ] 2022-06-20 11:22:28.923 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: primary_ds ::: set connection_info = '{"driver_name":"JDBC","driver_version":"compiled at 2021-09-09-17:49:42 build b7288a0"}'
   [INFO ] 2022-06-20 11:22:28.928 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select count(*) from pg_settings where name = 'support_batch_bind' and setting = 'on'
   [INFO ] 2022-06-20 11:22:28.928 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:28.928 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select count(*) from pg_settings where name = 'support_batch_bind' and setting = 'on'
   [INFO ] 2022-06-20 11:22:28.934 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop table if exists test cascade
   [INFO ] 2022-06-20 11:22:28.934 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropTableStatement(containsExistClause=true)
   [INFO ] 2022-06-20 11:22:28.934 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop table if exists test cascade
   [INFO ] 2022-06-20 11:22:28.949 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: drop view if exists test_view
   [INFO ] 2022-06-20 11:22:28.949 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussDropViewStatement()
   [INFO ] 2022-06-20 11:22:28.949 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: drop view if exists test_view
   [INFO ] 2022-06-20 11:22:28.958 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10))
   [INFO ] 2022-06-20 11:22:28.958 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateTableStatement(containsNotExistClause=false)
   [INFO ] 2022-06-20 11:22:28.958 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: CREATE TABLE test(id int, aa varchar(10) ,id2 varchar(10))
   [INFO ] 2022-06-20 11:22:28.972 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [cd02b6f6-8a9d-40ef-87c9-fd115b4e2b5e] Try to connect. IP: 127.0.0.1:15432
   [INFO ] 2022-06-20 11:22:28.979 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [127.0.0.1:49180/127.0.0.1:15432] Connection is established. ID: cd02b6f6-8a9d-40ef-87c9-fd115b4e2b5e
   [INFO ] 2022-06-20 11:22:28.987 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - Connect complete. ID: cd02b6f6-8a9d-40ef-87c9-fd115b4e2b5e
   [INFO ] 2022-06-20 11:22:30.533 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: create view test_view as select aa,id2 from test where id>80
   [INFO ] 2022-06-20 11:22:30.533 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussCreateViewStatement()
   [INFO ] 2022-06-20 11:22:30.533 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: create view test_view as select aa,id2 from test where id>80
   [INFO ] 2022-06-20 11:22:30.546 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [68c222cc-b24a-47db-83b5-0cff090ddb42] Try to connect. IP: 127.0.0.1:15432
   [INFO ] 2022-06-20 11:22:30.553 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - [127.0.0.1:49181/127.0.0.1:15432] Connection is established. ID: 68c222cc-b24a-47db-83b5-0cff090ddb42
   [INFO ] 2022-06-20 11:22:30.563 [HikariPool-1 connection adder] o.o.core.v3.ConnectionFactoryImpl - Connect complete. ID: 68c222cc-b24a-47db-83b5-0cff090ddb42
   [INFO ] 2022-06-20 11:22:30.627 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select * from test_view
   [INFO ] 2022-06-20 11:22:30.628 [Connection-18-ThreadExecutor] ShardingSphere-SQL - SQLStatement: OpenGaussSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-06-20 11:22:30.628 [Connection-18-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from test_view
   
   ```


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