From 5bc82ffc3f96179921550c531b5290df5ce06413 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 2 Aug 2021 17:01:52 +0800 Subject: [PATCH 1/6] [TD-5578] the max length of like condition can be configured --- src/client/src/tscSQLParser.c | 2 +- src/common/inc/tglobal.h | 1 + src/common/src/tglobal.c | 13 +++++++++++++ src/util/inc/tcompare.h | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 819f1af4f0..c953b753a2 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -4401,7 +4401,7 @@ static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t tSqlExpr* pRight = pExpr->pRight; if (pExpr->tokenId == TK_LIKE) { - if (pRight->value.nLen > TSDB_PATTERN_STRING_MAX_LEN) { + if (pRight->value.nLen > tsMaxLikeStringLen) { return invalidOperationMsg(msgBuf, msg1); } diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 7290db6ec9..544482fd14 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -70,6 +70,7 @@ extern int8_t tsKeepOriginalColumnName; // client extern int32_t tsMaxSQLStringLen; +extern int32_t tsMaxLikeStringLen; extern int8_t tsTscEnableRecordSql; extern int32_t tsMaxNumOfOrderedResults; extern int32_t tsMinSlidingTime; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index a58303e9fc..98d524179d 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -25,6 +25,7 @@ #include "tutil.h" #include "tlocale.h" #include "ttimezone.h" +#include "tcompare.h" // cluster char tsFirst[TSDB_EP_LEN] = {0}; @@ -75,6 +76,7 @@ int32_t tsCompressMsgSize = -1; // client int32_t tsMaxSQLStringLen = TSDB_MAX_ALLOWED_SQL_LEN; +int32_t tsMaxLikeStringLen = TSDB_PATTERN_STRING_MAX_LEN; int8_t tsTscEnableRecordSql = 0; // the maximum number of results for projection query on super table that are returned from @@ -984,6 +986,16 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_BYTE; taosInitConfigOption(cfg); + cfg.option = "maxLikeLength"; + cfg.ptr = &tsMaxLikeStringLen; + cfg.valType = TAOS_CFG_VTYPE_INT32; + cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT | TSDB_CFG_CTYPE_B_SHOW; + cfg.minValue = 0; + cfg.maxValue = TSDB_MAX_ALLOWED_SQL_LEN; + cfg.ptrLength = 0; + cfg.unitType = TAOS_CFG_UTYPE_BYTE; + taosInitConfigOption(cfg); + cfg.option = "maxNumOfOrderedRes"; cfg.ptr = &tsMaxNumOfOrderedResults; cfg.valType = TAOS_CFG_VTYPE_INT32; @@ -1531,6 +1543,7 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); + assert(tsGlobalConfigNum <= TSDB_CFG_MAX_NUM); #ifdef TD_TSZ // lossy compress cfg.option = "lossyColumns"; diff --git a/src/util/inc/tcompare.h b/src/util/inc/tcompare.h index 612ce7ede0..fe46f00086 100644 --- a/src/util/inc/tcompare.h +++ b/src/util/inc/tcompare.h @@ -25,7 +25,7 @@ extern "C" { #define TSDB_PATTERN_MATCH 0 #define TSDB_PATTERN_NOMATCH 1 #define TSDB_PATTERN_NOWILDCARDMATCH 2 -#define TSDB_PATTERN_STRING_MAX_LEN 20 +#define TSDB_PATTERN_STRING_MAX_LEN 100 #define FLT_COMPAR_TOL_FACTOR 4 #define FLT_EQUAL(_x, _y) (fabs((_x) - (_y)) <= (FLT_COMPAR_TOL_FACTOR * FLT_EPSILON)) From 1c0cc17ea6d14e5006228741c4fe2a9415018236 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 2 Aug 2021 17:24:28 +0800 Subject: [PATCH 2/6] [TD-5578] the max length of like condition can be configured --- packaging/cfg/taos.cfg | 3 +++ src/client/inc/tscUtil.h | 1 - src/client/src/tscSQLParser.c | 6 ++++-- src/client/src/tscServer.c | 8 +++----- src/client/src/tscUtil.c | 15 --------------- src/inc/taosmsg.h | 2 +- src/query/src/qExecutor.c | 2 +- 7 files changed, 12 insertions(+), 25 deletions(-) diff --git a/packaging/cfg/taos.cfg b/packaging/cfg/taos.cfg index bbe6eae419..0e28d8b43c 100644 --- a/packaging/cfg/taos.cfg +++ b/packaging/cfg/taos.cfg @@ -144,6 +144,9 @@ keepColumnName 1 # max length of an SQL # maxSQLLength 65480 +# max length of like +# maxLikeLength 100 + # the maximum number of records allowed for super table time sorting # maxNumOfOrderedRes 100000 diff --git a/src/client/inc/tscUtil.h b/src/client/inc/tscUtil.h index 687d182bb6..a7c2862f51 100644 --- a/src/client/inc/tscUtil.h +++ b/src/client/inc/tscUtil.h @@ -344,7 +344,6 @@ int32_t tscCreateTableMetaFromSTableMeta(STableMeta* pChild, const char* name, v STableMeta* tscTableMetaDup(STableMeta* pTableMeta); SVgroupsInfo* tscVgroupsInfoDup(SVgroupsInfo* pVgroupsInfo); -int32_t tscGetTagFilterSerializeLen(SQueryInfo* pQueryInfo); int32_t tscGetColFilterSerializeLen(SQueryInfo* pQueryInfo); int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr, void* addr); void* createQInfoFromQueryNode(SQueryInfo* pQueryInfo, STableGroupInfo* pTableGroupInfo, SOperatorInfo* pOperator, char* sql, void* addr, int32_t stage, uint64_t qId); diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index c953b753a2..8bab4225b8 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -4394,7 +4394,7 @@ static int32_t validateNullExpr(tSqlExpr* pExpr, char* msgBuf) { // check for like expression static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t index, char* msgBuf) { - const char* msg1 = "wildcard string should be less than 20 characters"; + const char* msg1 = "wildcard string should be less than %d characters"; const char* msg2 = "illegal column name"; tSqlExpr* pLeft = pExpr->pLeft; @@ -4402,7 +4402,9 @@ static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t if (pExpr->tokenId == TK_LIKE) { if (pRight->value.nLen > tsMaxLikeStringLen) { - return invalidOperationMsg(msgBuf, msg1); + char tmp[64] = {0}; + sprintf(tmp, msg1, tsMaxLikeStringLen); + return invalidOperationMsg(msgBuf, tmp); } SSchema* pSchema = tscGetTableSchema(pTableMeta); diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index c951f24ae9..fdb1be9f4e 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -678,8 +678,6 @@ static int32_t tscEstimateQueryMsgSize(SSqlObj *pSql) { int32_t srcColListSize = (int32_t)(taosArrayGetSize(pQueryInfo->colList) * sizeof(SColumnInfo)); int32_t srcColFilterSize = tscGetColFilterSerializeLen(pQueryInfo); - int32_t srcTagFilterSize = tscGetTagFilterSerializeLen(pQueryInfo); - size_t numOfExprs = tscNumOfExprs(pQueryInfo); int32_t exprSize = (int32_t)(sizeof(SSqlExpr) * numOfExprs * 2); @@ -700,8 +698,8 @@ static int32_t tscEstimateQueryMsgSize(SSqlObj *pSql) { tableSerialize = totalTables * sizeof(STableIdInfo); } - return MIN_QUERY_MSG_PKT_SIZE + minMsgSize() + sizeof(SQueryTableMsg) + srcColListSize + srcColFilterSize + srcTagFilterSize + - exprSize + tsBufSize + tableSerialize + sqlLen + 4096 + pQueryInfo->bufLen; + return MIN_QUERY_MSG_PKT_SIZE + minMsgSize() + sizeof(SQueryTableMsg) + srcColListSize + srcColFilterSize + exprSize + tsBufSize + + tableSerialize + sqlLen + 4096 + pQueryInfo->bufLen; } static char *doSerializeTableInfo(SQueryTableMsg *pQueryMsg, SSqlObj *pSql, STableMetaInfo *pTableMetaInfo, char *pMsg, @@ -1037,7 +1035,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { SCond *pCond = tsGetSTableQueryCond(pTagCond, pTableMeta->id.uid); if (pCond != NULL && pCond->cond != NULL) { - pQueryMsg->tagCondLen = htonl(pCond->len); + pQueryMsg->tagCondLen = htons(pCond->len); memcpy(pMsg, pCond->cond, pCond->len); pMsg += pCond->len; diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 741b82e124..1736fa3259 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -4684,21 +4684,6 @@ int32_t tscGetColFilterSerializeLen(SQueryInfo* pQueryInfo) { return len; } -int32_t tscGetTagFilterSerializeLen(SQueryInfo* pQueryInfo) { - // serialize tag column query condition - if (pQueryInfo->tagCond.pCond != NULL && taosArrayGetSize(pQueryInfo->tagCond.pCond) > 0) { - STagCond* pTagCond = &pQueryInfo->tagCond; - - STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); - STableMeta * pTableMeta = pTableMetaInfo->pTableMeta; - SCond *pCond = tsGetSTableQueryCond(pTagCond, pTableMeta->id.uid); - if (pCond != NULL && pCond->cond != NULL) { - return pCond->len; - } - } - return 0; -} - int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr, void* addr) { memset(pQueryAttr, 0, sizeof(SQueryAttr)); diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 54ea17657a..fb5bbe6c2d 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -489,7 +489,7 @@ typedef struct { int16_t numOfCols; // the number of columns will be load from vnode SInterval interval; SSessionWindow sw; // session window - uint32_t tagCondLen; // tag length in current query + uint16_t tagCondLen; // tag length in current query uint32_t tbnameCondLen; // table name filter condition string length int16_t numOfGroupCols; // num of group by columns int16_t orderByIdx; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 36bfb1d442..3f6df2ec07 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6898,7 +6898,7 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) { pQueryMsg->numOfCols = htons(pQueryMsg->numOfCols); pQueryMsg->numOfOutput = htons(pQueryMsg->numOfOutput); pQueryMsg->numOfGroupCols = htons(pQueryMsg->numOfGroupCols); - pQueryMsg->tagCondLen = htonl(pQueryMsg->tagCondLen); + pQueryMsg->tagCondLen = htons(pQueryMsg->tagCondLen); pQueryMsg->tsBuf.tsOffset = htonl(pQueryMsg->tsBuf.tsOffset); pQueryMsg->tsBuf.tsLen = htonl(pQueryMsg->tsBuf.tsLen); pQueryMsg->tsBuf.tsNumOfBlocks = htonl(pQueryMsg->tsBuf.tsNumOfBlocks); From 472dc1336580dfe8b35ffdb97139c26ad7b19c71 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 3 Aug 2021 16:34:39 +0800 Subject: [PATCH 3/6] [TD-5650] fix test case --- tests/pytest/functions/showOfflineThresholdIs864000.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytest/functions/showOfflineThresholdIs864000.py b/tests/pytest/functions/showOfflineThresholdIs864000.py index a7a1c2bf3f..57d0b1921b 100644 --- a/tests/pytest/functions/showOfflineThresholdIs864000.py +++ b/tests/pytest/functions/showOfflineThresholdIs864000.py @@ -25,7 +25,7 @@ class TDTestCase: def run(self): tdSql.query("show variables") - tdSql.checkData(53, 1, 864000) + tdSql.checkData(54, 1, 864000) def stop(self): tdSql.close() From 349818c9b18ffb99f7253c43b5cd4cb927c95b25 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 4 Aug 2021 18:16:25 +0800 Subject: [PATCH 4/6] [TD-5578] the max length of wild cards can be configured --- packaging/cfg/taos.cfg | 4 ++-- src/client/src/tscSQLParser.c | 4 ++-- src/common/inc/tglobal.h | 2 +- src/common/src/tglobal.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packaging/cfg/taos.cfg b/packaging/cfg/taos.cfg index 0e28d8b43c..3ae4e9941e 100644 --- a/packaging/cfg/taos.cfg +++ b/packaging/cfg/taos.cfg @@ -144,8 +144,8 @@ keepColumnName 1 # max length of an SQL # maxSQLLength 65480 -# max length of like -# maxLikeLength 100 +# max length of WildCards +# maxWildCardsLength 100 # the maximum number of records allowed for super table time sorting # maxNumOfOrderedRes 100000 diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 8bab4225b8..573e8b8782 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -4401,9 +4401,9 @@ static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t tSqlExpr* pRight = pExpr->pRight; if (pExpr->tokenId == TK_LIKE) { - if (pRight->value.nLen > tsMaxLikeStringLen) { + if (pRight->value.nLen > tsMaxWildCardsLen) { char tmp[64] = {0}; - sprintf(tmp, msg1, tsMaxLikeStringLen); + sprintf(tmp, msg1, tsMaxWildCardsLen); return invalidOperationMsg(msgBuf, tmp); } diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 544482fd14..25d1c90ec5 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -70,7 +70,7 @@ extern int8_t tsKeepOriginalColumnName; // client extern int32_t tsMaxSQLStringLen; -extern int32_t tsMaxLikeStringLen; +extern int32_t tsMaxWildCardsLen; extern int8_t tsTscEnableRecordSql; extern int32_t tsMaxNumOfOrderedResults; extern int32_t tsMinSlidingTime; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 98d524179d..3c904dc034 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -76,7 +76,7 @@ int32_t tsCompressMsgSize = -1; // client int32_t tsMaxSQLStringLen = TSDB_MAX_ALLOWED_SQL_LEN; -int32_t tsMaxLikeStringLen = TSDB_PATTERN_STRING_MAX_LEN; +int32_t tsMaxWildCardsLen = TSDB_PATTERN_STRING_MAX_LEN; int8_t tsTscEnableRecordSql = 0; // the maximum number of results for projection query on super table that are returned from @@ -986,8 +986,8 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_BYTE; taosInitConfigOption(cfg); - cfg.option = "maxLikeLength"; - cfg.ptr = &tsMaxLikeStringLen; + cfg.option = "maxWildCardsLength"; + cfg.ptr = &tsMaxWildCardsLen; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT | TSDB_CFG_CTYPE_B_SHOW; cfg.minValue = 0; From cb1da4f1e05e37ebf2c43bafeb0a1b3991e515f7 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 5 Aug 2021 16:09:20 +0800 Subject: [PATCH 5/6] Merge branch 'develop' into fix/TD-5578 --- src/client/inc/tscUtil.h | 1 + src/client/src/tscServer.c | 8 +++++--- src/client/src/tscUtil.c | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/client/inc/tscUtil.h b/src/client/inc/tscUtil.h index 577ce2a0fd..b3674a7bf5 100644 --- a/src/client/inc/tscUtil.h +++ b/src/client/inc/tscUtil.h @@ -344,6 +344,7 @@ int32_t tscCreateTableMetaFromSTableMeta(STableMeta** pChild, const char* name, STableMeta* tscTableMetaDup(STableMeta* pTableMeta); SVgroupsInfo* tscVgroupsInfoDup(SVgroupsInfo* pVgroupsInfo); +int32_t tscGetTagFilterSerializeLen(SQueryInfo* pQueryInfo); int32_t tscGetColFilterSerializeLen(SQueryInfo* pQueryInfo); int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr, void* addr); void* createQInfoFromQueryNode(SQueryInfo* pQueryInfo, STableGroupInfo* pTableGroupInfo, SOperatorInfo* pOperator, char* sql, void* addr, int32_t stage, uint64_t qId); diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 9230b2bc68..3e8dfac1da 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -676,6 +676,8 @@ static int32_t tscEstimateQueryMsgSize(SSqlObj *pSql) { int32_t srcColListSize = (int32_t)(taosArrayGetSize(pQueryInfo->colList) * sizeof(SColumnInfo)); int32_t srcColFilterSize = tscGetColFilterSerializeLen(pQueryInfo); + int32_t srcTagFilterSize = tscGetTagFilterSerializeLen(pQueryInfo); + size_t numOfExprs = tscNumOfExprs(pQueryInfo); int32_t exprSize = (int32_t)(sizeof(SSqlExpr) * numOfExprs * 2); @@ -696,8 +698,8 @@ static int32_t tscEstimateQueryMsgSize(SSqlObj *pSql) { tableSerialize = totalTables * sizeof(STableIdInfo); } - return MIN_QUERY_MSG_PKT_SIZE + minMsgSize() + sizeof(SQueryTableMsg) + srcColListSize + srcColFilterSize + exprSize + tsBufSize + - tableSerialize + sqlLen + 4096 + pQueryInfo->bufLen; + return MIN_QUERY_MSG_PKT_SIZE + minMsgSize() + sizeof(SQueryTableMsg) + srcColListSize + srcColFilterSize + srcTagFilterSize + + exprSize + tsBufSize + tableSerialize + sqlLen + 4096 + pQueryInfo->bufLen; } static char *doSerializeTableInfo(SQueryTableMsg *pQueryMsg, SSqlObj *pSql, STableMetaInfo *pTableMetaInfo, char *pMsg, @@ -1033,7 +1035,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { SCond *pCond = tsGetSTableQueryCond(pTagCond, pTableMeta->id.uid); if (pCond != NULL && pCond->cond != NULL) { - pQueryMsg->tagCondLen = htons(pCond->len); + pQueryMsg->tagCondLen = htonl(pCond->len); memcpy(pMsg, pCond->cond, pCond->len); pMsg += pCond->len; diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 47783c30b6..5a724af7bf 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -4700,6 +4700,21 @@ int32_t tscGetColFilterSerializeLen(SQueryInfo* pQueryInfo) { return len; } +int32_t tscGetTagFilterSerializeLen(SQueryInfo* pQueryInfo) { + // serialize tag column query condition + if (pQueryInfo->tagCond.pCond != NULL && taosArrayGetSize(pQueryInfo->tagCond.pCond) > 0) { + STagCond* pTagCond = &pQueryInfo->tagCond; + + STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); + STableMeta * pTableMeta = pTableMetaInfo->pTableMeta; + SCond *pCond = tsGetSTableQueryCond(pTagCond, pTableMeta->id.uid); + if (pCond != NULL && pCond->cond != NULL) { + return pCond->len; + } + } + return 0; +} + int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr, void* addr) { memset(pQueryAttr, 0, sizeof(SQueryAttr)); From 865658d0f49b8b8ecb5366bb0b2e8979f3eee949 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 6 Aug 2021 09:33:19 +0800 Subject: [PATCH 6/6] [TD-5578] fixmerge error --- src/inc/taosmsg.h | 2 +- src/query/src/qExecutor.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 52162ea4b4..c2918cfdf7 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -489,7 +489,7 @@ typedef struct { int16_t numOfCols; // the number of columns will be load from vnode SInterval interval; SSessionWindow sw; // session window - uint16_t tagCondLen; // tag length in current query + uint32_t tagCondLen; // tag length in current query uint32_t tbnameCondLen; // table name filter condition string length int16_t numOfGroupCols; // num of group by columns int16_t orderByIdx; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 93a2535d56..5323b4306f 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6899,7 +6899,7 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) { pQueryMsg->numOfCols = htons(pQueryMsg->numOfCols); pQueryMsg->numOfOutput = htons(pQueryMsg->numOfOutput); pQueryMsg->numOfGroupCols = htons(pQueryMsg->numOfGroupCols); - pQueryMsg->tagCondLen = htons(pQueryMsg->tagCondLen); + pQueryMsg->tagCondLen = htonl(pQueryMsg->tagCondLen); pQueryMsg->tsBuf.tsOffset = htonl(pQueryMsg->tsBuf.tsOffset); pQueryMsg->tsBuf.tsLen = htonl(pQueryMsg->tsBuf.tsLen); pQueryMsg->tsBuf.tsNumOfBlocks = htonl(pQueryMsg->tsBuf.tsNumOfBlocks);