[td-1067] fix bugs in lastrow query.
This commit is contained in:
parent
a21bc56722
commit
c5cfeee493
|
@ -5262,7 +5262,7 @@ static void stableQueryImpl(SQInfo *pQInfo) {
|
||||||
int64_t st = taosGetTimestampUs();
|
int64_t st = taosGetTimestampUs();
|
||||||
|
|
||||||
if (QUERY_IS_INTERVAL_QUERY(pQuery) ||
|
if (QUERY_IS_INTERVAL_QUERY(pQuery) ||
|
||||||
(isFixedOutputQuery(pRuntimeEnv) && (!isPointInterpoQuery(pQuery)) && !pRuntimeEnv->groupbyNormalCol)) {
|
(isFixedOutputQuery(pRuntimeEnv) && (!isPointInterpoQuery(pQuery)) && (!pRuntimeEnv->groupbyNormalCol))) {
|
||||||
multiTableQueryProcess(pQInfo);
|
multiTableQueryProcess(pQInfo);
|
||||||
} else {
|
} else {
|
||||||
assert((pQuery->checkBuffer == 1 && pQuery->intervalTime == 0) || isPointInterpoQuery(pQuery) ||
|
assert((pQuery->checkBuffer == 1 && pQuery->intervalTime == 0) || isPointInterpoQuery(pQuery) ||
|
||||||
|
|
|
@ -301,6 +301,9 @@ TsdbQueryHandleT tsdbQueryLastRow(TSDB_REPO_T *tsdb, STsdbQueryCond *pCond, STab
|
||||||
pCond->order = TSDB_ORDER_DESC;
|
pCond->order = TSDB_ORDER_DESC;
|
||||||
pCond->twindow = changeTableGroupByLastrow(groupList);
|
pCond->twindow = changeTableGroupByLastrow(groupList);
|
||||||
|
|
||||||
|
//descending order query, skey >= ekey
|
||||||
|
SWAP(pCond->twindow.skey, pCond->twindow.ekey, TSKEY);
|
||||||
|
|
||||||
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, groupList, qinfo);
|
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, groupList, qinfo);
|
||||||
return pQueryHandle;
|
return pQueryHandle;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue