From 29a8c27dcb8f88674618befaf6aa9fece5348ba1 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 3 Sep 2020 18:37:47 +0800 Subject: [PATCH 1/2] [td-1308] --- src/query/src/qExecutor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 9e71a7421a..d48d7d5ea1 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -2920,11 +2920,11 @@ int32_t mergeIntoGroupResultImpl(SQInfo *pQInfo, SArray *pGroup) { STableQueryInfo *item = taosArrayGetP(pGroup, i); SIDList list = getDataBufPagesIdList(pRuntimeEnv->pResultBuf, TSDB_TABLEID(item->pTable)->tid); - pageList = list; - tid = TSDB_TABLEID(item->pTable)->tid; if (taosArrayGetSize(list) > 0 && item->windowResInfo.size > 0) { pTableList[numOfTables++] = item; + tid = TSDB_TABLEID(item->pTable)->tid; + pageList = list; } } From 79bfe7a6a7eacd218b127dc83e373160c4f91542 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 3 Sep 2020 18:54:13 +0800 Subject: [PATCH 2/2] [td-1308]add test case --- tests/script/general/parser/topbot.sim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/script/general/parser/topbot.sim b/tests/script/general/parser/topbot.sim index 5616f8ed16..8e529b4eb4 100644 --- a/tests/script/general/parser/topbot.sim +++ b/tests/script/general/parser/topbot.sim @@ -137,4 +137,23 @@ if $rows != 3 then return -1 endi +print =========>td-1308 +sql create database db; +sql use db; + +sql create table stb (ts timestamp, c1 int, c2 binary(10)) tags(t1 binary(10)); +sql create table tb1 using stb tags('a1'); + +sql insert into tb1 values('2020-09-03 15:30:48.812', 0, 'tb1'); +sql select count(*) from stb where ts > '2020-09-03 15:30:44' interval(4s); +if $rows != 1 then + return -1 +endi + +sql create table tb4 using stb tags('a4'); +sql select count(*) from stb where ts > '2020-09-03 15:30:44' interval(4s); +if $rows != 1 then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file