diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index 5359d9853573c0c0335f5abf2409a5fccac10432..6a567c6e6c73c7acca28c2b93584125c1d3210f8 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -173,13 +173,10 @@ static int compTagId(const void *key1, const void *key2) { } void * tdQueryTagByID(SDataRow row, int16_t colId, int16_t *type) { //if find tag, 0, else return -1; - //todo ASSERT(((STagRow *)row)->pData != NULL); - STagCol *pBase = ((STagRow *)row)->tagCols; int16_t nCols = ((STagRow *)row)->ncols; STagCol key = {colId,0,0}; - STagCol * stCol = taosbsearch(&key, pBase, nCols, sizeof(STagCol), compTagId, TD_EQ); if (NULL == stCol) { return NULL; @@ -196,7 +193,6 @@ int tdAppendTagColVal(SDataRow row, void *value, int8_t type, int32_t bytes, int //ASSERT(bytes-2 == varDataTLen(value)); ASSERT(row != NULL); STagRow *pTagrow = row; - pTagrow->tagCols[pTagrow->ncols].colId = colId; pTagrow->tagCols[pTagrow->ncols].colType = type; pTagrow->tagCols[pTagrow->ncols].offset = pTagrow->dataLen; diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 720479130be8a210cb55b9bae47b15ffcfac75ce..2220ebfd88abf6933ae4c88003b26b1c9be9b1b4 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -1847,10 +1847,10 @@ bool indexedNodeFilterFp(const void* pNode, void* param) { int16_t type; // int32_t offset = pTSchema->columns[pInfo->colIndex].offset; // val = tdGetRowDataOfCol(elem->pTable->tagVal, pInfo->sch.type, TD_DATA_ROW_HEAD_SIZE + offset); - val = tdQueryTagByID(elem->pTable->tagVal, pInfo->colIndex, &type); + val = tdQueryTagByID(elem->pTable->tagVal, pInfo->sch.colId, &type); // ASSERT(pInfo->sch.type == type); } - + //todo :the val is possible to be null, so check it out carefully int32_t ret = 0; if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) { if (pInfo->optr == TSDB_RELATION_IN) {