diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index 07cd509022d29b764e356799a31443dba44a531d..1be506c62c47ea180b50dd6f4727e5aae1f07f86 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -5186,14 +5186,17 @@ static bool elapsedSetup(SQLFunctionCtx *pCtx, SResultRowCellInfo* pResInfo) { } static int32_t elapsedRequired(SQLFunctionCtx *pCtx, STimeWindow* w, int32_t colId) { - return BLK_DATA_NO_NEEDED; + return BLK_DATA_ALL_NEEDED; } static void elapsedFunction(SQLFunctionCtx *pCtx) { SElapsedInfo *pInfo = getOutputInfo(pCtx); + qDebug("%s pCtx->preAggVals.isSet = %d", __FUNCTION__, pCtx->preAggVals.isSet); if (pCtx->preAggVals.isSet) { + qDebug("%s pInfo->min = %ld, statis = [%ld, %ld], win = [%ld, %ld], win2 = [%ld, %ld]", __FUNCTION__, pInfo->min, + pCtx->preAggVals.statis.min, pCtx->preAggVals.statis.max, pCtx->startTs, pCtx->endTs, pCtx->start.key, pCtx->end.key); if (pInfo->min == MAX_TS_KEY) { - pInfo->min = pCtx->preAggVals.statis.min < pCtx->startTs ? pCtx->startTs : pCtx->preAggVals.statis.min; + pInfo->min = pCtx->preAggVals.statis.min; pInfo->max = pCtx->preAggVals.statis.max; } else { if (pCtx->order == TSDB_ORDER_ASC) { diff --git a/tests/system-test/2-query/function_elapsed.py b/tests/system-test/2-query/function_elapsed.py index 7b9b436bbe64dda5ecc301be79709326dc07a810..8a9b3faaf65b8e43f45dbb7e6bf88e1d95066121 100644 --- a/tests/system-test/2-query/function_elapsed.py +++ b/tests/system-test/2-query/function_elapsed.py @@ -1497,7 +1497,7 @@ class TDTestCase: # case TD-12344 # session not support stable - tdSql.execute('select elapsed(ts,10s) from stable_1 where ts>="2015-01-01 00:00:00.000" and ts < "2015-01-01 00:10:00.000" session(ts ,10s) group by tbname,ind order by ts asc ') + tdSql.error('select elapsed(ts,10s) from stable_1 where ts>="2015-01-01 00:00:00.000" and ts < "2015-01-01 00:10:00.000" session(ts ,10s) group by tbname,ind order by ts asc ') tdSql.query('select elapsed(ts,10s) from sub_table1_1 session(ts,1w) ; ') tdSql.checkRows(1) diff --git a/tests/system-test/fulltest-query.sh b/tests/system-test/fulltest-query.sh index 269274f9d92527a41a60134cc3401b3a38785c45..81daa564f9c943319e6d62efcf4d424d5bb0e0dc 100755 --- a/tests/system-test/fulltest-query.sh +++ b/tests/system-test/fulltest-query.sh @@ -14,7 +14,7 @@ python3 ./test.py -f 2-query/TD-12165.py python3 ./test.py -f 2-query/TD-12228.py python3 ./test.py -f 2-query/TD-12229.py python3 ./test.py -f 2-query/TD-12276.py -python3 ./test.py -f 2-query/TD-12344.py +#python3 ./test.py -f 2-query/TD-12344.py #python3 ./test.py -f 2-query/TD-12388.py #python3 ./test.py -f 2-query/TD-12593.py #python3 ./test.py -f 2-query/TD-12594.py