diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index bb103f23c6718c40ab9933c7ed84a73f3edb70fa..ffb2927cbdbd15023572912551dfcf3646b1e60e 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6101,8 +6101,10 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) { int32_t tmpLen = 0; tmpLen = sprintf(tmpBuf, "%s(uid:%" PRId64 ", %d)", aAggs[pExpr->functionId].aName, pExpr->uid, pExpr->colInfo.colId); + if (tmpLen + offset >= totalBufSize - 1) break; + offset += sprintf(str + offset, "%s", tmpBuf); if (i < size - 1) { @@ -6112,6 +6114,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) { assert(offset < totalBufSize); str[offset] = ']'; + assert(offset < totalBufSize); tscDebug("%p select clause:%s", pSql, str); } diff --git a/src/common/src/tvariant.c b/src/common/src/tvariant.c index fdfa933cdeb2be89c20a5e617c082ff28378701f..09c5c761637ee40ea22fc899d517389594c2c98d 100644 --- a/src/common/src/tvariant.c +++ b/src/common/src/tvariant.c @@ -399,6 +399,7 @@ static int32_t toNchar(tVariant *pVariant, char **pDest, int32_t *pDestSize) { pVariant->wpz = (wchar_t *)tmp; } else { int32_t output = 0; + bool ret = taosMbsToUcs4(pDst, nLen, *pDest, (nLen + 1) * TSDB_NCHAR_SIZE, &output); if (!ret) { return -1; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 261ba86bdae44eaf4c6ecb2e678ca1b6af99d33c..4978a27d4f415a95f70b60aa2fd1b419a786c2b8 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -3168,6 +3168,10 @@ void copyResToQueryResultBuf(SQInfo *pQInfo, SQuery *pQuery) { // all results in current group have been returned to client, try next group if (pGroupResInfo->index >= taosArrayGetSize(pGroupResInfo->pRows)) { // current results of group has been sent to client, try next group + pGroupResInfo->index = 0; + pGroupResInfo->rowId = 0; + taosArrayClear(pGroupResInfo->pRows); + if (mergeGroupResult(pQInfo) != TSDB_CODE_SUCCESS) { return; // failed to save data in the disk }