From b17c9a57729bab7d984ed7e3de9ebe49577026e5 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Fri, 3 Dec 2021 23:01:44 +0800 Subject: [PATCH] case check modify code --- src/client/src/tscStream.c | 5 ++++- tests/pytest/stream/new.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscStream.c b/src/client/src/tscStream.c index bf56accb0e..4f20bee97e 100644 --- a/src/client/src/tscStream.c +++ b/src/client/src/tscStream.c @@ -577,8 +577,11 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf if (!pStream->isProject) { pStream->stime = taosTimeAdd(pStream->stime, pStream->interval.sliding, pStream->interval.slidingUnit, pStream->precision); } + int32_t code = TSDB_CODE_SUCCESS; + if(pQueryInfo && pQueryInfo->pQInfo) + code = pQueryInfo->pQInfo->code; // actually only one row is returned. this following is not necessary - if(pQueryInfo->pQInfo->code == TSDB_CODE_SUCCESS) { + if(code == TSDB_CODE_SUCCESS) { taos_fetch_rows_a(res, tscProcessStreamRetrieveResult, pStream); } } else { // numOfRows == 0, all data has been retrieved diff --git a/tests/pytest/stream/new.py b/tests/pytest/stream/new.py index 4a0e47c01a..25e1fa718c 100644 --- a/tests/pytest/stream/new.py +++ b/tests/pytest/stream/new.py @@ -27,13 +27,14 @@ class TDTestCase: def run(self): rowNum = 200 tdSql.prepare() + start = 1633017600 tdLog.info("=============== step1") tdSql.execute("create table mt(ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)") for i in range(5): tdSql.execute("create table tb%d using mt tags(%d)" % (i, i)) for j in range(rowNum): - tdSql.execute("insert into tb%d values(now + %ds, %d, %d)" % (i, j, j, j)) + tdSql.execute("insert into tb%d values(%d + %ds, %d, %d)" % (start, i, j, j, j)) time.sleep(0.1) tdLog.info("=============== step2") @@ -52,7 +53,7 @@ class TDTestCase: for i in range(5, 10): tdSql.execute("create table tb%d using mt tags(%d)" % (i, i)) for j in range(rowNum): - tdSql.execute("insert into tb%d values(now + %ds, %d, %d)" % (i, j, j, j)) + tdSql.execute("insert into tb%d values(%d + %ds, %d, %d)" % (start, i, j, j, j)) tdLog.info("=============== step5") maxValue = 0 -- GitLab