From 0b1abeb5d654cabc79a803fa1d98edb0a36b9c47 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 19 Nov 2020 11:00:48 +0800 Subject: [PATCH] [TD-225] --- src/client/src/tscUtil.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index d4bdcd6ed9..4c2d25601f 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -220,13 +220,16 @@ bool tscIsPointInterpQuery(SQueryInfo* pQueryInfo) { } bool tscIsSecondStageQuery(SQueryInfo* pQueryInfo) { - size_t numOfOutput = tscNumOfFields(pQueryInfo); - size_t numOfExprs = tscSqlExprNumOfExprs(pQueryInfo); + STableMetaInfo* pTableMetaInfo = pQueryInfo->pTableMetaInfo[0]; + if (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) { + return false; + } - if (numOfOutput == numOfExprs) { + if (tscIsProjectionQuery(pQueryInfo)) { return false; } + size_t numOfOutput = tscNumOfFields(pQueryInfo); for(int32_t i = 0; i < numOfOutput; ++i) { SExprInfo* pExprInfo = tscFieldInfoGetInternalField(&pQueryInfo->fieldsInfo, i)->pArithExprInfo; if (pExprInfo != NULL) { @@ -309,14 +312,14 @@ void tscSetResRawPtr(SSqlRes* pRes, SQueryInfo* pQueryInfo) { assert(pInfo->pSqlExpr->param[1].nLen <= pInfo->field.bytes); for (int32_t k = 0; k < pRes->numOfRows; ++k) { - char* p = pRes->urow[i] + k * pInfo->field.bytes; + char* p = ((char**)pRes->urow)[i] + k * pInfo->field.bytes; memcpy(varDataVal(p), pInfo->pSqlExpr->param[1].pz, pInfo->pSqlExpr->param[1].nLen); varDataSetLen(p, pInfo->pSqlExpr->param[1].nLen); } } else { for (int32_t k = 0; k < pRes->numOfRows; ++k) { - char* p = pRes->urow[i] + k * pInfo->field.bytes; + char* p = ((char**)pRes->urow)[i] + k * pInfo->field.bytes; memcpy(p, &pInfo->pSqlExpr->param[1].i64Key, pInfo->field.bytes); } } -- GitLab