From 36daff8edca00c168c7867d67dc271ee77fc05f2 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Wed, 27 May 2020 02:47:00 +0000 Subject: [PATCH] [TD-90] tagschema develop --- src/common/src/tdataformat.c | 4 ---- src/tsdb/src/tsdbRead.c | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index 5359d98535..6a567c6e6c 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 720479130b..2220ebfd88 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) { -- GitLab