From 0b2bf6fc72dc372ef05518758d0c8bf5d501c4ed Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 21 Nov 2022 20:45:07 +0800 Subject: [PATCH] fix: fix query message encode issue --- source/common/src/tmsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 5dfcb62fad..35900638dd 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -4666,7 +4666,7 @@ int32_t tSerializeSSubQueryMsg(void *buf, int32_t bufLen, SSubQueryMsg *pReq) { if (tEncodeU32(&encoder, pReq->sqlLen) < 0) return -1; if (tEncodeCStrWithLen(&encoder, pReq->sql, pReq->sqlLen) < 0) return -1; if (tEncodeU32(&encoder, pReq->msgLen) < 0) return -1; - if (tEncodeCStrWithLen(&encoder, pReq->msg, pReq->msgLen) < 0) return -1; + if (tEncodeBinary(&encoder, (uint8_t*)pReq->msg, pReq->msgLen) < 0) return -1; tEndEncode(&encoder); @@ -4706,7 +4706,7 @@ int32_t tDeserializeSSubQueryMsg(void *buf, int32_t bufLen, SSubQueryMsg *pReq) if (tDecodeU32(&decoder, &pReq->sqlLen) < 0) return -1; if (tDecodeCStrAlloc(&decoder, &pReq->sql) < 0) return -1; if (tDecodeU32(&decoder, &pReq->msgLen) < 0) return -1; - if (tDecodeCStrAlloc(&decoder, &pReq->msg) < 0) return -1; + if (tDecodeBinaryAlloc(&decoder, (void**)&pReq->msg, NULL) < 0) return -1; tEndDecode(&decoder);