From f4efb6b19e435908f25cf783c8e6e5e8f477e784 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 23 Sep 2021 16:45:13 +0800 Subject: [PATCH] TD-6129 add tag-> select logic --- src/common/src/tvariant.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/common/src/tvariant.c b/src/common/src/tvariant.c index 29c870ed58..b275d24a1b 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; -- GitLab