Merge branch 'develop' into fix/TD-5578
This commit is contained in:
parent
bee2737b46
commit
cb1da4f1e0
|
@ -344,6 +344,7 @@ int32_t tscCreateTableMetaFromSTableMeta(STableMeta** pChild, const char* name,
|
||||||
STableMeta* tscTableMetaDup(STableMeta* pTableMeta);
|
STableMeta* tscTableMetaDup(STableMeta* pTableMeta);
|
||||||
SVgroupsInfo* tscVgroupsInfoDup(SVgroupsInfo* pVgroupsInfo);
|
SVgroupsInfo* tscVgroupsInfoDup(SVgroupsInfo* pVgroupsInfo);
|
||||||
|
|
||||||
|
int32_t tscGetTagFilterSerializeLen(SQueryInfo* pQueryInfo);
|
||||||
int32_t tscGetColFilterSerializeLen(SQueryInfo* pQueryInfo);
|
int32_t tscGetColFilterSerializeLen(SQueryInfo* pQueryInfo);
|
||||||
int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr, void* addr);
|
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);
|
void* createQInfoFromQueryNode(SQueryInfo* pQueryInfo, STableGroupInfo* pTableGroupInfo, SOperatorInfo* pOperator, char* sql, void* addr, int32_t stage, uint64_t qId);
|
||||||
|
|
|
@ -676,6 +676,8 @@ static int32_t tscEstimateQueryMsgSize(SSqlObj *pSql) {
|
||||||
|
|
||||||
int32_t srcColListSize = (int32_t)(taosArrayGetSize(pQueryInfo->colList) * sizeof(SColumnInfo));
|
int32_t srcColListSize = (int32_t)(taosArrayGetSize(pQueryInfo->colList) * sizeof(SColumnInfo));
|
||||||
int32_t srcColFilterSize = tscGetColFilterSerializeLen(pQueryInfo);
|
int32_t srcColFilterSize = tscGetColFilterSerializeLen(pQueryInfo);
|
||||||
|
int32_t srcTagFilterSize = tscGetTagFilterSerializeLen(pQueryInfo);
|
||||||
|
|
||||||
size_t numOfExprs = tscNumOfExprs(pQueryInfo);
|
size_t numOfExprs = tscNumOfExprs(pQueryInfo);
|
||||||
int32_t exprSize = (int32_t)(sizeof(SSqlExpr) * numOfExprs * 2);
|
int32_t exprSize = (int32_t)(sizeof(SSqlExpr) * numOfExprs * 2);
|
||||||
|
|
||||||
|
@ -696,8 +698,8 @@ static int32_t tscEstimateQueryMsgSize(SSqlObj *pSql) {
|
||||||
tableSerialize = totalTables * sizeof(STableIdInfo);
|
tableSerialize = totalTables * sizeof(STableIdInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
return MIN_QUERY_MSG_PKT_SIZE + minMsgSize() + sizeof(SQueryTableMsg) + srcColListSize + srcColFilterSize + exprSize + tsBufSize +
|
return MIN_QUERY_MSG_PKT_SIZE + minMsgSize() + sizeof(SQueryTableMsg) + srcColListSize + srcColFilterSize + srcTagFilterSize +
|
||||||
tableSerialize + sqlLen + 4096 + pQueryInfo->bufLen;
|
exprSize + tsBufSize + tableSerialize + sqlLen + 4096 + pQueryInfo->bufLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *doSerializeTableInfo(SQueryTableMsg *pQueryMsg, SSqlObj *pSql, STableMetaInfo *pTableMetaInfo, char *pMsg,
|
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);
|
SCond *pCond = tsGetSTableQueryCond(pTagCond, pTableMeta->id.uid);
|
||||||
if (pCond != NULL && pCond->cond != NULL) {
|
if (pCond != NULL && pCond->cond != NULL) {
|
||||||
pQueryMsg->tagCondLen = htons(pCond->len);
|
pQueryMsg->tagCondLen = htonl(pCond->len);
|
||||||
memcpy(pMsg, pCond->cond, pCond->len);
|
memcpy(pMsg, pCond->cond, pCond->len);
|
||||||
|
|
||||||
pMsg += pCond->len;
|
pMsg += pCond->len;
|
||||||
|
|
|
@ -4700,6 +4700,21 @@ int32_t tscGetColFilterSerializeLen(SQueryInfo* pQueryInfo) {
|
||||||
return len;
|
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) {
|
int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAttr, void* addr) {
|
||||||
memset(pQueryAttr, 0, sizeof(SQueryAttr));
|
memset(pQueryAttr, 0, sizeof(SQueryAttr));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue