diff --git a/src/common/src/tvariant.c b/src/common/src/tvariant.c index 29c870ed585f798b4c36b60969815fe0a6c4ba84..b275d24a1bc85cdb4ebb57b1700923c0f25cd9c6 100644 --- a/src/common/src/tvariant.c +++ b/src/common/src/tvariant.c @@ -106,10 +106,6 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) { * @param type */ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32_t type) { - if(type == TSDB_DATA_TYPE_JSON){ - if(JSON_TYPE_BINARY) type = TSDB_DATA_TYPE_BINARY; - else if(JSON_TYPE_NCHAR) type = TSDB_DATA_TYPE_NCHAR; - } switch (type) { case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: { @@ -172,7 +168,8 @@ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32 break; } - case TSDB_DATA_TYPE_BINARY:{ + case TSDB_DATA_TYPE_BINARY: + case TSDB_DATA_TYPE_JSON:{ pVar->pz = calloc(len + 1, sizeof(char)); memcpy(pVar->pz, pz, len); pVar->nLen = (int32_t)len; @@ -898,7 +895,7 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc *(int8_t *)payload = TSDB_DATA_TINYINT_NULL; } else if (pVariant->nType == TSDB_DATA_TYPE_BINARY){ *((int8_t *)payload) = TSDB_DATA_BINARY_PLACEHOLDER; - } else if (pVariant->nType == TSDB_DATA_TYPE_JSON){ // select * from stable, set tag type to json + } else if (pVariant->nType == TSDB_DATA_TYPE_JSON){ // select * from stable, set tag type to json,from setTagValue/tag_project_function memcpy(payload, pVariant->pz, pVariant->nLen); } else { return -1;