fix:fix error in new tag format

This commit is contained in:
wangmm0220 2022-06-01 13:06:25 +08:00
parent 094aaa2077
commit eb82ac04a0
2 changed files with 3 additions and 2 deletions

View File

@ -327,7 +327,8 @@ void addTagPseudoColumnData(SReadHandle *pHandle, SExprInfo* pPseudoExpr, int32_
for (int32_t i = 0; i < pBlock->info.rows; ++i) { for (int32_t i = 0; i < pBlock->info.rows; ++i) {
colDataAppend(pColInfoData, i, data, (data == NULL)); colDataAppend(pColInfoData, i, data, (data == NULL));
} }
if(pColInfoData->info.type != TSDB_DATA_TYPE_JSON && IS_VAR_DATA_TYPE(((const STagVal *)p)->type) && data){ if(pColInfoData->info.type != TSDB_DATA_TYPE_JSON && p != NULL &&
IS_VAR_DATA_TYPE(((const STagVal *)p)->type) && data){
taosMemoryFree(data); taosMemoryFree(data);
} }
} }

View File

@ -2126,7 +2126,7 @@ static int32_t smlBuildTagRow(SArray* cols, SParsedDataColInfo* tags, SSchema* p
val.nData = kv->length; val.nData = kv->length;
}else if(pTagSchema->type == TSDB_DATA_TYPE_NCHAR){ }else if(pTagSchema->type == TSDB_DATA_TYPE_NCHAR){
int32_t output = 0; int32_t output = 0;
void *p = taosMemoryCalloc(1, kv->length * TSDB_NCHAR_SIZE); void *p = taosMemoryCalloc(1, pTagSchema->bytes - VARSTR_HEADER_SIZE);
if(p == NULL){ if(p == NULL){
code = TSDB_CODE_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY;
goto end; goto end;