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

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new b3dc3a07a77 branch-3.0: [bugfix](qe) Fix query error in ssl mode 
#53134 (#55627)
b3dc3a07a77 is described below

commit b3dc3a07a770e821bf3f4d37583032cfc91da1e5
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Sep 4 10:44:08 2025 +0800

    branch-3.0: [bugfix](qe) Fix query error in ssl mode #53134 (#55627)
    
    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 aa640c57eb7..4a32fc8db13 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
@@ -327,12 +327,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]

Reply via email to