This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 190742fcda6 branch-3.1: [bugfix](qe) Fix query error in ssl mode
#53134 (#55628)
190742fcda6 is described below
commit 190742fcda6d97269a43a15aa4144a514edde500
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Sep 4 10:43:50 2025 +0800
branch-3.1: [bugfix](qe) Fix query error in ssl mode #53134 (#55628)
Cherry-picked from #53134
Co-authored-by: lw112 <[email protected]>
---
.../main/java/org/apache/doris/mysql/MysqlChannel.java | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java
b/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java
index 13da84e67c1..34494aa4296 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java
@@ -340,12 +340,20 @@ public class MysqlChannel implements BytesChannel {
readLen = readAll(result, false);
if (isSslMode && remainingBuffer.position() == 0 &&
result.hasRemaining()) {
byte[] header = result.array();
- int packetId = header[3] & 0xFF;
- if (packetId != sequenceId) {
- LOG.warn("receive packet sequence id[" + packetId() + "]
want to get[" + sequenceId + "]");
- throw new IOException("Bad packet sequence.");
+ int mysqlPacketLength = (header[0] & 0xFF) | ((header[1] &
0xFF) << 8) | ((header[2] & 0xFF) << 16);
+ if (result.position() >= 4 && mysqlPacketLength > 0 &&
mysqlPacketLength
+ <= MAX_PHYSICAL_PACKET_LENGTH) {
+ int packetId = header[3] & 0xFF;
+ if (packetId != sequenceId) {
+ LOG.warn("receive packet sequence id[" + packetId + "]
want to get[" + sequenceId + "]");
+ throw new IOException("Bad packet sequence.");
+ }
+ } else {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("SSL mode: skipping sequence check, packet
length: " + mysqlPacketLength
+ + ", buffer position: " + result.position());
+ }
}
- int mysqlPacketLength = (header[0] & 0xFF) | ((header[1] &
0XFF) << 8) | ((header[2] & 0XFF) << 16);
// remove mysql packet header
result.position(4);
result.compact();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]