From b7e91f047aa27f4494df008137dcbc7ce245d283 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Thu, 1 Apr 2021 14:25:30 +0800 Subject: [PATCH] rowsize issue --- src/query/src/qExecutor.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index ebf29e9bb8..9ba2978395 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6385,27 +6385,27 @@ SQInfo* createQInfoImpl(SQueryTableMsg* pQueryMsg, SSqlGroupbyExpr* pGroupbyExpr } } + for (int16_t col = 0; col < numOfOutput; ++col) { + assert(pExprs[col].bytes > 0); + pQuery->resultRowSize += pExprs[col].bytes; + + // keep the tag length + if (TSDB_COL_IS_TAG(pExprs[col].base.colInfo.flag)) { + pQuery->tagLen += pExprs[col].bytes; + } + } + if (pSecExprs != NULL) { + int32_t resultRowSize = 0; + // calculate the result row size for (int16_t col = 0; col < pQuery->numOfExpr2; ++col) { assert(pSecExprs[col].bytes > 0); - pQuery->resultRowSize += pSecExprs[col].bytes; - - // keep the tag length - if (TSDB_COL_IS_TAG(pSecExprs[col].base.colInfo.flag)) { - pQuery->tagLen += pSecExprs[col].bytes; - } + resultRowSize += pSecExprs[col].bytes; } - } else { - // calculate the result row size - for (int16_t col = 0; col < numOfOutput; ++col) { - assert(pExprs[col].bytes > 0); - pQuery->resultRowSize += pExprs[col].bytes; - // keep the tag length - if (TSDB_COL_IS_TAG(pExprs[col].base.colInfo.flag)) { - pQuery->tagLen += pExprs[col].bytes; - } + if (resultRowSize > pQuery->resultRowSize) { + pQuery->resultRowSize = resultRowSize; } } -- GitLab