From 373c128a7add2132e7b253ad71932c91f86548f6 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 31 Mar 2023 14:16:39 +0800 Subject: [PATCH] fix:[TS-3038] coredump if nchar data not clear SColVal in schemaless --- source/libs/parser/src/parInsertSml.c | 2 ++ utils/test/c/sml_test.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/source/libs/parser/src/parInsertSml.c b/source/libs/parser/src/parInsertSml.c index 106ee641af..0bcd777d2a 100644 --- a/source/libs/parser/src/parInsertSml.c +++ b/source/libs/parser/src/parInsertSml.c @@ -25,6 +25,8 @@ static void clearColValArray(SArray* pCols) { if (TSDB_DATA_TYPE_NCHAR == pCol->type) { taosMemoryFreeClear(pCol->value.pData); } + pCol->flag = CV_FLAG_NONE; + pCol->value.val = 0; } } diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index 44fbd060be..b0cc6f749c 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -939,6 +939,9 @@ int sml_ts2164_Test() { // "meters,location=la,groupid=ca current=11.8,voltage=221,phase=0.27", "meters,location=la,groupid=ca current=11.8,voltage=221", "meters,location=la,groupid=ca current=11.8,voltage=221,phase=0.27", + "ts3038,location=l2a,groupid=ca current=L\"11.8\"", + "ts3038,location=l2a,groupid=ca voltage=L\"221\"", + "ts3038,location=l2a,groupid=ca phase=L\"221\"", // "meters,location=la,groupid=cb current=11.8,voltage=221,phase=0.27", }; -- GitLab