From 51000ffe7fdeeb7e6132229429cb74992ce0ef50 Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Thu, 11 Jul 2024 19:03:33 +0800 Subject: [PATCH] fix: parseOneStbRow support for jsontag --- source/libs/parser/src/parTranslater.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 9b1c8096aa..104ffcc945 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -12815,6 +12815,7 @@ static int32_t parseOneStbRow(SMsgBuf* pMsgBuf, SParseFileContext* pParFileCxt) int32_t numOfTags = getNumOfTags(pParFileCxt->pStbMeta); uint8_t precision = getTableInfo(pParFileCxt->pStbMeta).precision; SSchema* pSchemas = getTableTagSchema(pParFileCxt->pStbMeta); + bool isJson = false; for (int i = 0; i < sz; i++) { const char* pSql = pParFileCxt->pSql; @@ -12832,6 +12833,7 @@ static int32_t parseOneStbRow(SMsgBuf* pMsgBuf, SParseFileContext* pParFileCxt) // parse tag const SSchema* pTagSchema = &pSchemas[index]; + isJson = (pTagSchema->type == TSDB_DATA_TYPE_JSON); code = checkAndTrimValue(&token, pParFileCxt->tmpTokenBuf, pMsgBuf, pTagSchema->type); if (TSDB_CODE_SUCCESS == code && TK_NK_VARIABLE == token.type) { code = buildInvalidOperationMsg(pMsgBuf, "not expected row value"); @@ -12859,7 +12861,9 @@ static int32_t parseOneStbRow(SMsgBuf* pMsgBuf, SParseFileContext* pParFileCxt) if (TSDB_CODE_SUCCESS == code) { pParFileCxt->tagNameFilled = true; - code = tTagNew(pParFileCxt->aTagVals, 1, false, &pParFileCxt->pTag); + if (!isJson) { + code = tTagNew(pParFileCxt->aTagVals, 1, false, &pParFileCxt->pTag); + } } return code;