[td-3662]
This commit is contained in:
parent
00c1a59abb
commit
ecfe8ecabb
|
@ -1159,7 +1159,7 @@ static void fillMultiRowsOfTagsVal(SQueryInfo *pQueryInfo, int32_t numOfRes, SLo
|
|||
memset(buf, 0, (size_t)maxBufSize);
|
||||
memcpy(buf, pCtx->pOutput, (size_t)pCtx->outputBytes);
|
||||
|
||||
for (int32_t i = 1; i < inc; ++i) {
|
||||
for (int32_t i = 0; i < inc; ++i) {
|
||||
pCtx->pOutput += pCtx->outputBytes;
|
||||
memcpy(pCtx->pOutput, buf, (size_t)pCtx->outputBytes);
|
||||
}
|
||||
|
@ -1449,6 +1449,11 @@ int32_t tscDoLocalMerge(SSqlObj *pSql) {
|
|||
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex);
|
||||
tFilePage *tmpBuffer = pLocalMerge->pTempBuffer;
|
||||
|
||||
int32_t remain = 1;
|
||||
if (tscIsTopbotQuery(pQueryInfo)) {
|
||||
remain = tscGetTopbotQueryParam(pQueryInfo);
|
||||
}
|
||||
|
||||
if (doHandleLastRemainData(pSql)) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
@ -1537,7 +1542,7 @@ int32_t tscDoLocalMerge(SSqlObj *pSql) {
|
|||
* if the previous group does NOT generate any result (pResBuf->num == 0),
|
||||
* continue to process results instead of return results.
|
||||
*/
|
||||
if ((!sameGroup && pResBuf->num > 0) || (pResBuf->num == pLocalMerge->resColModel->capacity)) {
|
||||
if ((!sameGroup && pResBuf->num > 0) || (pResBuf->num + remain >= pLocalMerge->resColModel->capacity)) {
|
||||
// does not belong to the same group
|
||||
bool notSkipped = genFinalResults(pSql, pLocalMerge, !sameGroup);
|
||||
|
||||
|
|
|
@ -162,6 +162,11 @@ endi
|
|||
#sql select top(c6, 3) from select_tags_mt0 interval(10a)
|
||||
#sql select top(c6, 3) from select_tags_mt0 interval(10a) group by tbname;
|
||||
|
||||
sql select top(c6, 10) from select_tags_mt0 interval(10a);
|
||||
if $rows != 12800 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select top(c1, 100), tbname, t1, t2 from select_tags_mt0;
|
||||
if $rows != 100 then
|
||||
return -1
|
||||
|
|
Loading…
Reference in New Issue