From 294a4376575db5496f3af0308d125e052dedc72c Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 20 Dec 2022 19:50:09 +0800 Subject: [PATCH] fix: fix percentile + interval res error --- source/libs/executor/src/executorimpl.c | 2 +- tests/script/tsim/compute/percentile.sim | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 1c80eff685..96425e0c14 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -200,7 +200,7 @@ SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pR // in case of repeat scan/reverse scan, no new time window added. if (isIntervalQuery) { - if (masterscan && p1 != NULL) { // the *p1 may be NULL in case of sliding+offset exists. + if (p1 != NULL) { // the *p1 may be NULL in case of sliding+offset exists. pResult = getResultRowByPos(pResultBuf, p1, true); ASSERT(pResult->pageId == p1->pageId && pResult->offset == p1->offset); } diff --git a/tests/script/tsim/compute/percentile.sim b/tests/script/tsim/compute/percentile.sim index 836a6baed5..c27441e719 100644 --- a/tests/script/tsim/compute/percentile.sim +++ b/tests/script/tsim/compute/percentile.sim @@ -120,6 +120,17 @@ if $data00 != 5.000000000 then return -1 endi +sql select _wstart, percentile(tbcol, 10) as c from $tb interval(1d) +if $rows != 1 then + return -1 +endi +if $data00 != @20-10-01 00:00:00.000@ then + return -1 +endi +if $data01 != @1.900000000@ then + return -1 +endi + print =============== clear sql drop database $db sql select * from information_schema.ins_databases