[TD-2163]<enhance>: add the version check for query message.
This commit is contained in:
parent
5894dded1d
commit
f55fce8217
|
@ -669,6 +669,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SQueryTableMsg *pQueryMsg = (SQueryTableMsg *)pCmd->payload;
|
SQueryTableMsg *pQueryMsg = (SQueryTableMsg *)pCmd->payload;
|
||||||
|
tstrncpy(pQueryMsg->version, version, tListLen(pQueryMsg->version));
|
||||||
|
|
||||||
int32_t numOfTags = (int32_t)taosArrayGetSize(pTableMetaInfo->tagColList);
|
int32_t numOfTags = (int32_t)taosArrayGetSize(pTableMetaInfo->tagColList);
|
||||||
|
|
||||||
|
@ -693,8 +694,8 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
pQueryMsg->interval.slidingUnit = pQueryInfo->interval.slidingUnit;
|
pQueryMsg->interval.slidingUnit = pQueryInfo->interval.slidingUnit;
|
||||||
pQueryMsg->interval.offsetUnit = pQueryInfo->interval.offsetUnit;
|
pQueryMsg->interval.offsetUnit = pQueryInfo->interval.offsetUnit;
|
||||||
pQueryMsg->numOfGroupCols = htons(pQueryInfo->groupbyExpr.numOfGroupCols);
|
pQueryMsg->numOfGroupCols = htons(pQueryInfo->groupbyExpr.numOfGroupCols);
|
||||||
pQueryMsg->numOfTags = htonl(numOfTags);
|
|
||||||
pQueryMsg->tagNameRelType = htons(pQueryInfo->tagCond.relType);
|
pQueryMsg->tagNameRelType = htons(pQueryInfo->tagCond.relType);
|
||||||
|
pQueryMsg->numOfTags = htonl(numOfTags);
|
||||||
pQueryMsg->queryType = htonl(pQueryInfo->type);
|
pQueryMsg->queryType = htonl(pQueryInfo->type);
|
||||||
|
|
||||||
size_t numOfOutput = tscSqlExprNumOfExprs(pQueryInfo);
|
size_t numOfOutput = tscSqlExprNumOfExprs(pQueryInfo);
|
||||||
|
|
|
@ -464,6 +464,8 @@ typedef struct STimeWindow {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
SMsgHead head;
|
SMsgHead head;
|
||||||
|
char version[TSDB_VERSION_LEN];
|
||||||
|
|
||||||
STimeWindow window;
|
STimeWindow window;
|
||||||
int32_t numOfTables;
|
int32_t numOfTables;
|
||||||
int16_t order;
|
int16_t order;
|
||||||
|
|
|
@ -5825,6 +5825,10 @@ static int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SArray **pTableIdList,
|
||||||
char **tagCond, char** tbnameCond, SColIndex **groupbyCols, SColumnInfo** tagCols) {
|
char **tagCond, char** tbnameCond, SColIndex **groupbyCols, SColumnInfo** tagCols) {
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
|
|
||||||
|
if (taosCheckVersion(pQueryMsg->version, version, 3) != 0) {
|
||||||
|
return TSDB_CODE_QRY_INVALID_MSG;
|
||||||
|
}
|
||||||
|
|
||||||
pQueryMsg->numOfTables = htonl(pQueryMsg->numOfTables);
|
pQueryMsg->numOfTables = htonl(pQueryMsg->numOfTables);
|
||||||
|
|
||||||
pQueryMsg->window.skey = htobe64(pQueryMsg->window.skey);
|
pQueryMsg->window.skey = htobe64(pQueryMsg->window.skey);
|
||||||
|
|
Loading…
Reference in New Issue