From d422bba8ddd25dc739ae11ae431bf5900905c4c6 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 16 Mar 2021 18:24:51 +0800 Subject: [PATCH] [td-3318]: fix crash caused by empty stddev query. --- src/query/src/qExecutor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 8f3c51d2a9..e0e18a7cc8 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4170,8 +4170,10 @@ static SSDataBlock* doTableScan(void* param) { assert(ret); } - pResultRowInfo->curIndex = 0; - pResultRowInfo->prevSKey = pResultRowInfo->pResult[0]->win.skey; + if (pResultRowInfo->size > 0) { + pResultRowInfo->curIndex = 0; + pResultRowInfo->prevSKey = pResultRowInfo->pResult[0]->win.skey; + } qDebug("QInfo:%p start to repeat scan data blocks due to query func required, qrange:%" PRId64 "-%" PRId64, pRuntimeEnv->qinfo, cond.twindow.skey, cond.twindow.ekey); -- GitLab