[TD-90] tagschema develop
This commit is contained in:
parent
3882d0fa2d
commit
36daff8edc
|
@ -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;
|
void * tdQueryTagByID(SDataRow row, int16_t colId, int16_t *type) { //if find tag, 0, else return -1;
|
||||||
//todo
|
|
||||||
ASSERT(((STagRow *)row)->pData != NULL);
|
ASSERT(((STagRow *)row)->pData != NULL);
|
||||||
|
|
||||||
STagCol *pBase = ((STagRow *)row)->tagCols;
|
STagCol *pBase = ((STagRow *)row)->tagCols;
|
||||||
int16_t nCols = ((STagRow *)row)->ncols;
|
int16_t nCols = ((STagRow *)row)->ncols;
|
||||||
STagCol key = {colId,0,0};
|
STagCol key = {colId,0,0};
|
||||||
|
|
||||||
STagCol * stCol = taosbsearch(&key, pBase, nCols, sizeof(STagCol), compTagId, TD_EQ);
|
STagCol * stCol = taosbsearch(&key, pBase, nCols, sizeof(STagCol), compTagId, TD_EQ);
|
||||||
if (NULL == stCol) {
|
if (NULL == stCol) {
|
||||||
return NULL;
|
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(bytes-2 == varDataTLen(value));
|
||||||
ASSERT(row != NULL);
|
ASSERT(row != NULL);
|
||||||
STagRow *pTagrow = row;
|
STagRow *pTagrow = row;
|
||||||
|
|
||||||
pTagrow->tagCols[pTagrow->ncols].colId = colId;
|
pTagrow->tagCols[pTagrow->ncols].colId = colId;
|
||||||
pTagrow->tagCols[pTagrow->ncols].colType = type;
|
pTagrow->tagCols[pTagrow->ncols].colType = type;
|
||||||
pTagrow->tagCols[pTagrow->ncols].offset = pTagrow->dataLen;
|
pTagrow->tagCols[pTagrow->ncols].offset = pTagrow->dataLen;
|
||||||
|
|
|
@ -1847,10 +1847,10 @@ bool indexedNodeFilterFp(const void* pNode, void* param) {
|
||||||
int16_t type;
|
int16_t type;
|
||||||
// int32_t offset = pTSchema->columns[pInfo->colIndex].offset;
|
// int32_t offset = pTSchema->columns[pInfo->colIndex].offset;
|
||||||
// val = tdGetRowDataOfCol(elem->pTable->tagVal, pInfo->sch.type, TD_DATA_ROW_HEAD_SIZE + 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);
|
// ASSERT(pInfo->sch.type == type);
|
||||||
}
|
}
|
||||||
|
//todo :the val is possible to be null, so check it out carefully
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) {
|
if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) {
|
||||||
if (pInfo->optr == TSDB_RELATION_IN) {
|
if (pInfo->optr == TSDB_RELATION_IN) {
|
||||||
|
|
Loading…
Reference in New Issue