From e479d77f2a992281e85554c2af338f2739248df2 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 21 Sep 2021 17:11:15 +0800 Subject: [PATCH] TD-6129 add json type check --- src/client/src/tscSQLParser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index bd657c9c3c..e0351784ff 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6074,6 +6074,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { } if(pItem->pVar.nType != TSDB_DATA_TYPE_BINARY){ tscError("json type error, should be string"); + tdDestroyKVRowBuilder(&kvRowBuilder); return invalidOperationMsg(pMsg, msg25); } code = parseJsontoTagData(pItem->pVar.pz, &kvRowBuilder, pMsg, pTagsSchema->colId); @@ -7698,6 +7699,7 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) { tVariantListItem* pItem = taosArrayGet(pValList, 0); if(pItem->pVar.nType != TSDB_DATA_TYPE_BINARY){ tscError("json type error, should be string"); + tdDestroyKVRowBuilder(&kvRowBuilder); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); } ret = parseJsontoTagData(pItem->pVar.pz, &kvRowBuilder, tscGetErrorMsgPayload(pCmd), pTagSchema[0].colId); -- GitLab