You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/06/26 11:36:44 UTC

[shardingsphere] branch master updated: Fix sonar issue, remove unused field PG_ROLES (#26585)

This is an automated email from the ASF dual-hosted git repository.

zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b1cf198d4a Fix sonar issue, remove unused field PG_ROLES (#26585)
6b1cf198d4a is described below

commit 6b1cf198d4a2a2bdfcecd109e6bb7596e62cd1af
Author: Raigor <ra...@gmail.com>
AuthorDate: Mon Jun 26 19:36:37 2023 +0800

    Fix sonar issue, remove unused field PG_ROLES (#26585)
---
 .../database/impl/DataSourceGeneratedDatabaseConfigurationTest.java    | 3 ++-
 .../postgresql/handler/admin/PostgreSQLAdminExecutorCreator.java       | 2 --
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/impl/DataSourceGeneratedDatabaseConfigurationTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/impl/DataSourceGeneratedDatabaseConfigurationTest.java
index 6e81439e346..bca0417ff89 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/impl/DataSourceGeneratedDatabaseConfigurationTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/impl/DataSourceGeneratedDatabaseConfigurationTest.java
@@ -32,6 +32,7 @@ import java.util.Properties;
 
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
 class DataSourceGeneratedDatabaseConfigurationTest {
     
@@ -62,7 +63,7 @@ class DataSourceGeneratedDatabaseConfigurationTest {
         assertThat(poolStandardProps.get("maxLifetimeMilliseconds"), is(1000L));
         assertThat(poolStandardProps.get("maxPoolSize"), is(2));
         assertThat(poolStandardProps.get("minPoolSize"), is(1));
-        assertThat(poolStandardProps.get("readOnly"), is(false));
+        assertFalse((Boolean) poolStandardProps.get("readOnly"));
         Map<String, Object> connStandardProps = props.getConnectionPropertySynonyms().getStandardProperties();
         assertThat(connStandardProps.size(), is(3));
         assertThat(connStandardProps.get("url"), is("jdbc:mock://127.0.0.1/normal_db"));
diff --git a/proxy/backend/type/postgresql/src/main/java/org/apache/shardingsphere/proxy/backend/postgresql/handler/admin/PostgreSQLAdminExecutorCreator.java b/proxy/backend/type/postgresql/src/main/java/org/apache/shardingsphere/proxy/backend/postgresql/handler/admin/PostgreSQLAdminExecutorCreator.java
index 77774d592db..f984b511609 100644
--- a/proxy/backend/type/postgresql/src/main/java/org/apache/shardingsphere/proxy/backend/postgresql/handler/admin/PostgreSQLAdminExecutorCreator.java
+++ b/proxy/backend/type/postgresql/src/main/java/org/apache/shardingsphere/proxy/backend/postgresql/handler/admin/PostgreSQLAdminExecutorCreator.java
@@ -55,8 +55,6 @@ public final class PostgreSQLAdminExecutorCreator implements DatabaseAdminExecut
     
     private static final String PG_CLASS = "pg_class";
     
-    private static final String PG_ROLES = "pg_roles";
-    
     private static final String PG_PREFIX = "pg_";
     
     private static final String PG_NAMESPACE = "pg_namespace";