[td-1290]
This commit is contained in:
parent
fb1178c452
commit
88ba66dd8b
|
@ -105,7 +105,10 @@ int64_t taosGetIntervalStartTimestamp(int64_t startTime, int64_t slidingTime, in
|
||||||
return startTime;
|
return startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t start = ((startTime - intervalTime) / slidingTime + 1) * slidingTime;
|
int64_t delta = startTime - intervalTime;
|
||||||
|
int32_t factor = delta > 0? 1:-1;
|
||||||
|
|
||||||
|
int64_t start = (delta / slidingTime + factor) * slidingTime;
|
||||||
if (!(timeUnit == 'u' || timeUnit == 'a' || timeUnit == 'm' || timeUnit == 's' || timeUnit == 'h')) {
|
if (!(timeUnit == 'u' || timeUnit == 'a' || timeUnit == 'm' || timeUnit == 's' || timeUnit == 'h')) {
|
||||||
/*
|
/*
|
||||||
* here we revised the start time of day according to the local time zone,
|
* here we revised the start time of day according to the local time zone,
|
||||||
|
|
|
@ -1909,6 +1909,15 @@ static void changeExecuteScanOrder(SQInfo *pQInfo, bool stableQuery) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isGroupbyNormalCol(pQuery->pGroupbyExpr)) {
|
||||||
|
pQuery->order.order = TSDB_ORDER_ASC;
|
||||||
|
if (pQuery->window.skey > pQuery->window.ekey) {
|
||||||
|
SWAP(pQuery->window.skey, pQuery->window.ekey, TSKEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isPointInterpoQuery(pQuery) && pQuery->intervalTime == 0) {
|
if (isPointInterpoQuery(pQuery) && pQuery->intervalTime == 0) {
|
||||||
if (!QUERY_IS_ASC_QUERY(pQuery)) {
|
if (!QUERY_IS_ASC_QUERY(pQuery)) {
|
||||||
qDebug(msg, GET_QINFO_ADDR(pQuery), "interp", pQuery->order.order, TSDB_ORDER_ASC, pQuery->window.skey,
|
qDebug(msg, GET_QINFO_ADDR(pQuery), "interp", pQuery->order.order, TSDB_ORDER_ASC, pQuery->window.skey,
|
||||||
|
@ -4387,7 +4396,7 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, void *tsdb, int32_t vgId, bo
|
||||||
|
|
||||||
// NOTE: pTableCheckInfo need to update the query time range and the lastKey info
|
// NOTE: pTableCheckInfo need to update the query time range and the lastKey info
|
||||||
// TODO fixme
|
// TODO fixme
|
||||||
changeExecuteScanOrder(pQInfo, false);
|
changeExecuteScanOrder(pQInfo, isSTableQuery);
|
||||||
|
|
||||||
code = setupQueryHandle(tsdb, pQInfo, isSTableQuery);
|
code = setupQueryHandle(tsdb, pQInfo, isSTableQuery);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
@ -6095,6 +6104,9 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList,
|
||||||
goto _cleanup;
|
goto _cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: pTableCheckInfo need to update the query time range and the lastKey info
|
||||||
|
changeExecuteScanOrder(pQInfo, isSTableQuery);
|
||||||
|
|
||||||
int32_t index = 0;
|
int32_t index = 0;
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfGroups; ++i) {
|
for(int32_t i = 0; i < numOfGroups; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue