diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index c4c3722455..78f012cb98 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -711,6 +711,7 @@ static void initNextGroupScan(STableScanInfo* pInfo, STableKeyInfo** pKeyInfo, i pInfo->tableStartIndex = TARRAY_ELEM_IDX(pInfo->base.pTableListInfo->pTableList, *pKeyInfo); pInfo->tableEndIndex = (pInfo->tableStartIndex + (*size) - 1); pInfo->pResBlock->info.blankFill = false; + taosMemoryFreeClear(pInfo->pResBlock->pBlockAgg); if (!pInfo->needCountEmptyTable) { pInfo->countState = TABLE_COUNT_STATE_END; diff --git a/tests/system-test/2-query/count.py b/tests/system-test/2-query/count.py index 2f82ece0ec..155cb39b62 100644 --- a/tests/system-test/2-query/count.py +++ b/tests/system-test/2-query/count.py @@ -257,7 +257,18 @@ class TDTestCase: os.system(f'taos -f {sql_file}') tdSql.query('select count(c_1) from d2.t2 where c_1 < 10', queryTimes=1) tdSql.checkData(0, 0, 0) - tdSql.execute('drop database d2') + tdSql.query('select count(c_1), min(c_1),tbname from d2.can partition by tbname', queryTimes=1) + tdSql.checkData(0, 0, 0) + tdSql.checkData(0, 1, None) + tdSql.checkData(0, 2, 't3') + + tdSql.checkData(1, 0, 15) + tdSql.checkData(1, 1, 1471617148940980000) + tdSql.checkData(1, 2, 't2') + + tdSql.checkData(2, 0, 0) + tdSql.checkData(2, 1, None) + tdSql.checkData(2, 2, 't1') def run(self): self.test_count_with_sma_data()