You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/02/16 06:26:40 UTC
[shardingsphere] branch master updated: Correct variable's name in PostgreSQL/openGauss protocol (#15436)
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 ca3e759 Correct variable's name in PostgreSQL/openGauss protocol (#15436)
ca3e759 is described below
commit ca3e759c243ea337fbf1ff343b88966553e2880b
Author: 吴伟杰 <wu...@apache.org>
AuthorDate: Wed Feb 16 14:25:31 2022 +0800
Correct variable's name in PostgreSQL/openGauss protocol (#15436)
---
.../db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java | 8 ++++----
.../db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
index 1a1b6e6..60f5aebd 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
@@ -49,19 +49,19 @@ public final class OpenGaussPacketCodecEngine implements DatabasePacketCodecEngi
private static final int PAYLOAD_LENGTH = 4;
- private boolean startupMessageReceived = true;
+ private boolean startupPhase = true;
private final List<ByteBuf> pendingMessages = new LinkedList<>();
@Override
public boolean isValidHeader(final int readableBytes) {
- return readableBytes >= (startupMessageReceived ? 0 : MESSAGE_TYPE_LENGTH) + PAYLOAD_LENGTH;
+ return readableBytes >= (startupPhase ? 0 : MESSAGE_TYPE_LENGTH) + PAYLOAD_LENGTH;
}
@Override
public void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out) {
while (isValidHeader(in.readableBytes())) {
- if (startupMessageReceived) {
+ if (startupPhase) {
handleStartupPhase(in, out);
return;
}
@@ -89,7 +89,7 @@ public final class OpenGaussPacketCodecEngine implements DatabasePacketCodecEngi
}
if (in.readableBytes() == in.getInt(readerIndex)) {
out.add(in.readRetainedSlice(in.readableBytes()));
- startupMessageReceived = false;
+ startupPhase = false;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
index 9317171..c601901 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
@@ -47,19 +47,19 @@ public final class PostgreSQLPacketCodecEngine implements DatabasePacketCodecEng
private static final int PAYLOAD_LENGTH = 4;
- private boolean startupMessageReceived = true;
+ private boolean startupPhase = true;
private final List<ByteBuf> pendingMessages = new LinkedList<>();
@Override
public boolean isValidHeader(final int readableBytes) {
- return readableBytes >= (startupMessageReceived ? 0 : MESSAGE_TYPE_LENGTH) + PAYLOAD_LENGTH;
+ return readableBytes >= (startupPhase ? 0 : MESSAGE_TYPE_LENGTH) + PAYLOAD_LENGTH;
}
@Override
public void decode(final ChannelHandlerContext context, final ByteBuf in, final List<Object> out) {
while (isValidHeader(in.readableBytes())) {
- if (startupMessageReceived) {
+ if (startupPhase) {
handleStartupPhase(in, out);
return;
}
@@ -87,7 +87,7 @@ public final class PostgreSQLPacketCodecEngine implements DatabasePacketCodecEng
}
if (in.readableBytes() == in.getInt(readerIndex)) {
out.add(in.readRetainedSlice(in.readableBytes()));
- startupMessageReceived = false;
+ startupPhase = false;
}
}