[TD-2895] refactor

This commit is contained in:
Haojun Liao 2021-02-03 19:00:58 +08:00
parent 36c9ba0c9b
commit 0070e7f143
2 changed files with 9 additions and 2 deletions

View File

@ -3980,7 +3980,7 @@ void copyToOutputBuf(SQInfo *pQInfo, SResultRowInfo *pResultInfo) {
SGroupResInfo *pGroupResInfo = &pQInfo->groupResInfo;
assert(pQuery->rec.rows == 0 && pGroupResInfo->currentGroup <= pGroupResInfo->totalGroup);
if (pGroupResInfo->index >= taosArrayGetSize(pGroupResInfo->pRows)) {
if (!hasRemainData(pGroupResInfo)) {
return;
}
@ -4034,6 +4034,10 @@ bool hasNotReturnedResults(SQueryRuntimeEnv* pRuntimeEnv, SGroupResInfo* pGroupR
SQuery *pQuery = pRuntimeEnv->pQuery;
SFillInfo *pFillInfo = pRuntimeEnv->pFillInfo;
if (!Q_STATUS_EQUAL(pQuery->status, QUERY_COMPLETED)) {
return false;
}
if (pQuery->limit.limit > 0 && pQuery->rec.total >= pQuery->limit.limit) {
return false;
}
@ -5682,7 +5686,7 @@ static void tableIntervalProcess(SQInfo *pQInfo, STableQueryInfo* pTableInfo) {
if (pQuery->fillType == TSDB_FILL_NONE || pRuntimeEnv->resultRowInfo.size == 0 || isPointInterpoQuery(pQuery)) {
// all data scanned, the group by normal column can return
int32_t numOfClosed = numOfClosedResultRows(&pRuntimeEnv->resultRowInfo);
if (pQuery->limit.offset > numOfClosed) {
if (pQuery->limit.offset > numOfClosed || numOfClosed == 0) {
return;
}

View File

@ -334,6 +334,9 @@ sql insert into tm0 values(10000, 1) (20000, 2)(30000, 3) (40000, NULL) (50000,
#=============================tbase-1205
sql select count(*) from tm1 where ts<now and ts>= now -1d interval(1h) fill(NULL);
if $rows != 0 then
return -1
endi
print ===================>TD-1834
sql select * from tm0 where ts>11000 and ts< 20000 order by ts asc