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

duanzhengqiang 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 ff785be  Rename PostgreSQLBinaryStatementRegistry (#10183)
ff785be is described below

commit ff785bee7b455e016ed5f5336a5b6f59e4d36dec
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Apr 24 22:56:31 2021 +0800

    Rename PostgreSQLBinaryStatementRegistry (#10183)
    
    * Add volatile for BackendConnection
    
    * Rename PostgreSQLBinaryStatementRegistry
    
    * Fix checkstyle
---
 ....java => PostgreSQLBinaryStatementRegistry.java} |  8 ++++----
 .../query/binary/bind/PostgreSQLComBindPacket.java  |  4 ++--
 .../command/PostgreSQLCommandPacketFactoryTest.java |  4 ++--
 ...a => PostgreSQLBinaryStatementRegistryTest.java} | 21 ++++++++++-----------
 .../binary/bind/PostgreSQLComBindPacketTest.java    |  7 ++++---
 .../jdbc/connection/BackendConnection.java          |  6 +++---
 .../postgresql/PostgreSQLFrontendEngine.java        |  4 ++--
 .../PostgreSQLAuthenticationEngine.java             |  4 ++--
 .../binary/bind/PostgreSQLComBindExecutor.java      |  3 +--
 .../binary/parse/PostgreSQLComParseExecutor.java    |  4 ++--
 .../postgresql/PostgreSQLFrontendEngineTest.java    |  4 ++--
 .../PostgreSQLAuthenticationEngineTest.java         |  4 ++--
 .../parse/PostgreSQLComParseExecutorTest.java       |  4 ++--
 13 files changed, 38 insertions(+), 39 deletions(-)

diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/BinaryStatementRegistry.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/PostgreSQLBinaryStatementRegistry.java
similarity index 88%
rename from 
shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/BinaryStatementRegistry.java
rename to 
shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/PostgreSQLBinaryStatementRegistry.java
index 287ee87..cd05f16 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/BinaryStatementRegistry.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/PostgreSQLBinaryStatementRegistry.java
@@ -24,12 +24,12 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
 /**
- * Binary statement registry.
+ * PostgreSQL binary prepared statement registry.
  */
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class BinaryStatementRegistry {
+public final class PostgreSQLBinaryStatementRegistry {
     
-    private static final BinaryStatementRegistry INSTANCE = new 
BinaryStatementRegistry();
+    private static final PostgreSQLBinaryStatementRegistry INSTANCE = new 
PostgreSQLBinaryStatementRegistry();
     
     private final ConcurrentMap<Integer, 
ConnectionScopeBinaryStatementRegistry> registries = new ConcurrentHashMap<>();
     
@@ -38,7 +38,7 @@ public final class BinaryStatementRegistry {
      *
      * @return instance of binary statement registry.
      */
-    public static BinaryStatementRegistry getInstance() {
+    public static PostgreSQLBinaryStatementRegistry getInstance() {
         return INSTANCE;
     }
     
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacket.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacket.java
index a93f386..4a7a498 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacket.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacket.java
@@ -20,7 +20,7 @@ package 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bi
 import lombok.Getter;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacket;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatement;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementParameterType;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.bind.protocol.PostgreSQLBinaryProtocolValue;
@@ -54,7 +54,7 @@ public final class PostgreSQLComBindPacket extends 
PostgreSQLCommandPacket {
         for (int i = 0; i < parameterFormatsLength; i++) {
             payload.readInt2();
         }
-        PostgreSQLBinaryStatement binaryStatement = 
BinaryStatementRegistry.getInstance().get(connectionId).getBinaryStatement(statementId);
+        PostgreSQLBinaryStatement binaryStatement = 
PostgreSQLBinaryStatementRegistry.getInstance().get(connectionId).getBinaryStatement(statementId);
         sql = null == binaryStatement ? null : binaryStatement.getSql();
         parameters = null == sql ? Collections.emptyList() : 
getParameters(payload, binaryStatement.getParameterTypes());
         int resultFormatsLength = payload.readInt2();
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/PostgreSQLCommandPacketFactoryTest.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/PostgreSQLCommandPacketFactoryTest.java
index a9e0075..1d97f95 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/PostgreSQLCommandPacketFactoryTest.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/PostgreSQLCommandPacketFactoryTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.db.protocol.postgresql.packet.command;
 
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.bind.PostgreSQLComBindPacket;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.describe.PostgreSQLComDescribePacket;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.execute.PostgreSQLComExecutePacket;
@@ -61,7 +61,7 @@ public final class PostgreSQLCommandPacketFactoryTest {
         when(payload.readStringNul()).thenReturn("stat-id");
         when(payload.readStringNul()).thenReturn("SELECT * FROM t_order");
         when(payload.readInt2()).thenReturn(0);
-        BinaryStatementRegistry.getInstance().register(1);
+        PostgreSQLBinaryStatementRegistry.getInstance().register(1);
         
assertThat(PostgreSQLCommandPacketFactory.newInstance(PostgreSQLCommandPacketType.BIND_COMMAND,
 payload, 1), instanceOf(PostgreSQLComBindPacket.class));
     }
     
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/BinaryStatementRegistryTest.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/PostgreSQLBinaryStatementRegistryTest.java
similarity index 70%
rename from 
shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/BinaryStatementRegistryTest.java
rename to 
shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/PostgreSQLBinaryStatementRegistryTest.java
index b0306f8..72d6785 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/BinaryStatementRegistryTest.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/PostgreSQLBinaryStatementRegistryTest.java
@@ -24,7 +24,7 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
 
-public final class BinaryStatementRegistryTest {
+public final class PostgreSQLBinaryStatementRegistryTest {
     
     private final String sql = "SELECT * FROM tbl WHERE id=?";
     
@@ -32,33 +32,32 @@ public final class BinaryStatementRegistryTest {
     
     @Before
     public void init() {
-        BinaryStatementRegistry.getInstance().register(1);
-        ConnectionScopeBinaryStatementRegistry statementRegistry = 
BinaryStatementRegistry.getInstance().get(1);
+        PostgreSQLBinaryStatementRegistry.getInstance().register(1);
+        ConnectionScopeBinaryStatementRegistry statementRegistry = 
PostgreSQLBinaryStatementRegistry.getInstance().get(1);
         statementRegistry.register(statementId, sql, 1, null);
     }
     
     @Test
     public void assertRegisterIfAbsent() {
-        BinaryStatementRegistry.getInstance().register(2);
-        ConnectionScopeBinaryStatementRegistry actual = 
BinaryStatementRegistry.getInstance().get(2);
+        PostgreSQLBinaryStatementRegistry.getInstance().register(2);
+        ConnectionScopeBinaryStatementRegistry actual = 
PostgreSQLBinaryStatementRegistry.getInstance().get(2);
         assertNull(actual.getBinaryStatement("stat-no-exist"));
     }
     
     @Test
     public void assertRegisterIfPresent() {
-        ConnectionScopeBinaryStatementRegistry statementRegistry = 
BinaryStatementRegistry.getInstance().get(1);
+        ConnectionScopeBinaryStatementRegistry statementRegistry = 
PostgreSQLBinaryStatementRegistry.getInstance().get(1);
         PostgreSQLBinaryStatement statement = 
statementRegistry.getBinaryStatement(statementId);
         assertThat(statement.getSql(), is(sql));
         assertThat(statement.getParameterCount(), is(1));
-        BinaryStatementRegistry.getInstance().register(1);
-        statement = 
BinaryStatementRegistry.getInstance().get(1).getBinaryStatement(statementId);
-        assertNull(statement);
+        PostgreSQLBinaryStatementRegistry.getInstance().register(1);
+        
assertNull(PostgreSQLBinaryStatementRegistry.getInstance().get(1).getBinaryStatement(statementId));
     }
     
     @Test
     public void assertUnregister() {
-        BinaryStatementRegistry.getInstance().unregister(1);
-        ConnectionScopeBinaryStatementRegistry actual = 
BinaryStatementRegistry.getInstance().get(1);
+        PostgreSQLBinaryStatementRegistry.getInstance().unregister(1);
+        ConnectionScopeBinaryStatementRegistry actual = 
PostgreSQLBinaryStatementRegistry.getInstance().get(1);
         assertNull(actual);
     }
 }
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacketTest.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacketTest.java
index ed6f992..2631960 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacketTest.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacketTest.java
@@ -19,7 +19,7 @@ package 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bi
 
 import 
org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLBinaryColumnType;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementParameterType;
 import 
org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
 import org.junit.Before;
@@ -47,7 +47,7 @@ public final class PostgreSQLComBindPacketTest {
         when(payload.readStringNul()).thenReturn("");
         when(payload.readStringNul()).thenReturn("sts-id");
         when(payload.readInt2()).thenReturn(1);
-        BinaryStatementRegistry.getInstance().register(1);
+        PostgreSQLBinaryStatementRegistry.getInstance().register(1);
     }
     
     @Test
@@ -56,7 +56,8 @@ public final class PostgreSQLComBindPacketTest {
         when(payload.readInt4()).thenReturn(1);
         when(payload.readInt8()).thenReturn(11L);
         String sql = "select * from order where id = ? ";
-        BinaryStatementRegistry.getInstance().get(1).register("sts-id", sql, 
1, Collections.singletonList(new 
PostgreSQLBinaryStatementParameterType(PostgreSQLBinaryColumnType.POSTGRESQL_TYPE_INT8)));
+        PostgreSQLBinaryStatementRegistry.getInstance().get(1).register(
+                "sts-id", sql, 1, Collections.singletonList(new 
PostgreSQLBinaryStatementParameterType(PostgreSQLBinaryColumnType.POSTGRESQL_TYPE_INT8)));
         PostgreSQLComBindPacket bindPacket = new 
PostgreSQLComBindPacket(payload, 1);
         bindPacket.write(payload);
         assertThat(bindPacket.getSql(), is(sql));
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnection.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnection.java
index 3dd6787..50a5bc3 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnection.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnection.java
@@ -64,13 +64,13 @@ public final class BackendConnection implements 
ExecutorJDBCManager {
     private volatile String schemaName;
     
     @Setter
-    private int connectionId;
+    private volatile int connectionId;
     
     @Setter
-    private Grantee grantee;
+    private volatile Grantee grantee;
     
     @Setter
-    private CalciteExecutor calciteExecutor;
+    private volatile CalciteExecutor calciteExecutor;
     
     private final Multimap<String, Connection> cachedConnections = 
LinkedHashMultimap.create();
     
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngine.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngine.java
index 88f03a8..46a9f81 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngine.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngine.java
@@ -21,7 +21,7 @@ import lombok.Getter;
 import org.apache.shardingsphere.db.protocol.codec.DatabasePacketCodecEngine;
 import 
org.apache.shardingsphere.db.protocol.postgresql.codec.PostgreSQLPacketCodecEngine;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.PostgreSQLPacket;
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
 import 
org.apache.shardingsphere.proxy.frontend.authentication.AuthenticationEngine;
 import org.apache.shardingsphere.proxy.frontend.command.CommandExecuteEngine;
@@ -46,7 +46,7 @@ public final class PostgreSQLFrontendEngine implements 
DatabaseProtocolFrontendE
     
     @Override
     public void release(final BackendConnection backendConnection) {
-        
BinaryStatementRegistry.getInstance().unregister(backendConnection.getConnectionId());
+        
PostgreSQLBinaryStatementRegistry.getInstance().unregister(backendConnection.getConnectionId());
     }
     
     @Override
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java
index bb0fccf..5091b34 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngine.java
@@ -21,7 +21,7 @@ import com.google.common.base.Strings;
 import io.netty.channel.ChannelHandlerContext;
 import org.apache.shardingsphere.db.protocol.payload.PacketPayload;
 import 
org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLErrorCode;
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.generic.PostgreSQLReadyForQueryPacket;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.handshake.PostgreSQLAuthenticationMD5PasswordPacket;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.handshake.PostgreSQLAuthenticationOKPacket;
@@ -58,7 +58,7 @@ public final class PostgreSQLAuthenticationEngine implements 
AuthenticationEngin
     @Override
     public int handshake(final ChannelHandlerContext context) {
         int result = ConnectionIdGenerator.getInstance().nextId();
-        BinaryStatementRegistry.getInstance().register(result);
+        PostgreSQLBinaryStatementRegistry.getInstance().register(result);
         return result;
     }
     
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
index 1c6cb53..e47af2b 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
@@ -72,8 +72,7 @@ public final class PostgreSQLComBindExecutor implements 
QueryCommandExecutor {
             ShardingSphereSQLParserEngine sqlStatementParserEngine = new 
ShardingSphereSQLParserEngine(DatabaseTypeRegistry.getTrunkDatabaseTypeName(
                     
ProxyContext.getInstance().getMetaDataContexts().getMetaData(backendConnection.getSchemaName()).getResource().getDatabaseType()));
             SQLStatement sqlStatement = 
sqlStatementParserEngine.parse(packet.getSql(), true);
-            databaseCommunicationEngine =
-                    
DatabaseCommunicationEngineFactory.getInstance().newBinaryProtocolInstance(sqlStatement,
 packet.getSql(), packet.getParameters(), backendConnection);
+            databaseCommunicationEngine = 
DatabaseCommunicationEngineFactory.getInstance().newBinaryProtocolInstance(sqlStatement,
 packet.getSql(), packet.getParameters(), backendConnection);
         } else {
             databaseCommunicationEngine = null;
         }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutor.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutor.java
index 9501979..17e1436 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutor.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutor.java
@@ -18,7 +18,7 @@
 package 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.binary.parse;
 
 import org.apache.shardingsphere.db.protocol.packet.DatabasePacket;
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.ConnectionScopeBinaryStatementRegistry;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse.PostgreSQLComParsePacket;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse.PostgreSQLParseCompletePacket;
@@ -46,7 +46,7 @@ public final class PostgreSQLComParseExecutor implements 
CommandExecutor {
     public PostgreSQLComParseExecutor(final PostgreSQLComParsePacket packet, 
final BackendConnection backendConnection) {
         this.packet = packet;
         schemaName = backendConnection.getSchemaName();
-        binaryStatementRegistry = 
BinaryStatementRegistry.getInstance().get(backendConnection.getConnectionId());
+        binaryStatementRegistry = 
PostgreSQLBinaryStatementRegistry.getInstance().get(backendConnection.getConnectionId());
     }
     
     @Override
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngineTest.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngineTest.java
index 80bcd70..b0a90ee 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngineTest.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngineTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.proxy.frontend.postgresql;
 
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
 import 
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
 import org.junit.Test;
@@ -42,7 +42,7 @@ public final class PostgreSQLFrontendEngineTest {
         BackendConnection backendConnection = mock(BackendConnection.class);
         int connectionId = 1;
         when(backendConnection.getConnectionId()).thenReturn(connectionId);
-        BinaryStatementRegistry registry = 
BinaryStatementRegistry.getInstance();
+        PostgreSQLBinaryStatementRegistry registry = 
PostgreSQLBinaryStatementRegistry.getInstance();
         registry.register(connectionId);
         assertNotNull(registry.get(connectionId));
         PostgreSQLFrontendEngine frontendEngine = new 
PostgreSQLFrontendEngine();
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
index e48a91e..ffd45f8 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/authentication/PostgreSQLAuthenticationEngineTest.java
@@ -23,7 +23,7 @@ import io.netty.buffer.UnpooledHeapByteBuf;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.SneakyThrows;
 import org.apache.shardingsphere.db.protocol.payload.PacketPayload;
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.handshake.PostgreSQLAuthenticationMD5PasswordPacket;
 import 
org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
 import 
org.apache.shardingsphere.infra.context.metadata.impl.StandardMetaDataContexts;
@@ -55,7 +55,7 @@ public final class PostgreSQLAuthenticationEngineTest {
     @Test
     public void assertHandshake() {
         int connectionId = new 
PostgreSQLAuthenticationEngine().handshake(mock(ChannelHandlerContext.class));
-        assertNotNull(BinaryStatementRegistry.getInstance().get(connectionId));
+        
assertNotNull(PostgreSQLBinaryStatementRegistry.getInstance().get(connectionId));
     }
     
     private ByteBuf createByteBuf(final int initialCapacity, final int 
maxCapacity) {
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutorTest.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutorTest.java
index 6bf2dd4..7db8446 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutorTest.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutorTest.java
@@ -17,7 +17,7 @@
 
 package 
org.apache.shardingsphere.proxy.frontend.postgresql.command.query.binary.parse;
 
-import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.BinaryStatementRegistry;
+import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementRegistry;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse.PostgreSQLComParsePacket;
 import 
org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse.PostgreSQLParseCompletePacket;
 import 
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
@@ -64,7 +64,7 @@ public final class PostgreSQLComParseExecutorTest {
         metaDataContexts.setAccessible(true);
         metaDataContexts.set(ProxyContext.getInstance(), new 
StandardMetaDataContexts(getMetaDataMap(), 
                 mock(ShardingSphereRuleMetaData.class), 
mock(ExecutorEngine.class), new ShardingSphereUsers(Collections.emptyList()), 
new ConfigurationProperties(new Properties())));
-        BinaryStatementRegistry.getInstance().register(1);
+        PostgreSQLBinaryStatementRegistry.getInstance().register(1);
         PostgreSQLComParseExecutor actual = new 
PostgreSQLComParseExecutor(parsePacket, backendConnection);
         assertThat(actual.execute().iterator().next(), 
instanceOf(PostgreSQLParseCompletePacket.class));
     }

Reply via email to