<fix>[query]: move the reset columnInfoData to the right place.

This commit is contained in:
Haojun Liao 2022-04-08 23:48:01 +08:00
parent fce5d48835
commit cd71bf4816
2 changed files with 11 additions and 9 deletions

View File

@ -2828,6 +2828,11 @@ static bool loadDataBlockFromTableSeq(STsdbReadHandle* pTsdbReadHandle) {
bool tsdbNextDataBlock(tsdbReaderT pHandle) { bool tsdbNextDataBlock(tsdbReaderT pHandle) {
STsdbReadHandle* pTsdbReadHandle = (STsdbReadHandle*) pHandle; STsdbReadHandle* pTsdbReadHandle = (STsdbReadHandle*) pHandle;
for(int32_t i = 0; i < taosArrayGetSize(pTsdbReadHandle->pColumns); ++i) {
SColumnInfoData* pColInfo = taosArrayGet(pTsdbReadHandle->pColumns, i);
colInfoDataCleanup(pColInfo, pTsdbReadHandle->outputCapacity);
}
if (emptyQueryTimewindow(pTsdbReadHandle)) { if (emptyQueryTimewindow(pTsdbReadHandle)) {
tsdbDebug("%p query window not overlaps with the data set, no result returned, %s", pTsdbReadHandle, pTsdbReadHandle->idStr); tsdbDebug("%p query window not overlaps with the data set, no result returned, %s", pTsdbReadHandle, pTsdbReadHandle->idStr);
return false; return false;
@ -3253,12 +3258,6 @@ SArray* tsdbRetrieveDataBlock(tsdbReaderT* pTsdbReadHandle, SArray* pIdList) {
* 1. data is from cache, 2. data block is not completed qualified to query time range * 1. data is from cache, 2. data block is not completed qualified to query time range
*/ */
STsdbReadHandle* pHandle = (STsdbReadHandle*)pTsdbReadHandle; STsdbReadHandle* pHandle = (STsdbReadHandle*)pTsdbReadHandle;
for(int32_t i = 0; i < taosArrayGetSize(pHandle->pColumns); ++i) {
SColumnInfoData* pColInfo = taosArrayGet(pHandle->pColumns, i);
colInfoDataCleanup(pColInfo, pHandle->outputCapacity);
}
if (pHandle->cur.fid == INT32_MIN) { if (pHandle->cur.fid == INT32_MIN) {
return pHandle->pColumns; return pHandle->pColumns;
} else { } else {

View File

@ -83,7 +83,7 @@ while $dbCnt < 2
print =============== query data print =============== query data
sql select * from `table` sql select * from `table`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
@ -99,7 +99,9 @@ while $dbCnt < 2
print expect table, actual $data03 print expect table, actual $data03
return -1 return -1
endi endi
print =================> 1
sql select * from `Table` sql select * from `Table`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
@ -116,7 +118,8 @@ while $dbCnt < 2
if $data03 != Table then if $data03 != Table then
return -1 return -1
endi endi
print ================>2
sql select * from `TAble` sql select * from `TAble`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03