From 8098a2995d4076a986eb0fb83fe27003196094f4 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 23 Jan 2023 22:20:44 +0500 Subject: [PATCH] opti:parse non-standard json format --- source/client/src/clientSmlJson.c | 2 +- utils/test/c/sml_test.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientSmlJson.c b/source/client/src/clientSmlJson.c index f17f4f3dac..080ce4568f 100644 --- a/source/client/src/clientSmlJson.c +++ b/source/client/src/clientSmlJson.c @@ -1283,8 +1283,8 @@ int32_t smlParseJSON(SSmlHandle *info, char *payload) { continue; } - if(*dataPointStart == '\0') break; cnt++; + if(*dataPointStart == '\0') break; } info->lineNum = cnt; diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index e0a7ccb35c..6af4a655f9 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -901,7 +901,10 @@ int sml_ts2164_Test() { int sml_ttl_Test() { TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0); - TAOS_RES *pRes = taos_query(taos, "create database if not exists sml_db schemaless 1"); + TAOS_RES *pRes = taos_query(taos, "drop database if exists sml_db"); + taos_free_result(pRes); + + pRes = taos_query(taos, "create database if not exists sml_db schemaless 1"); taos_free_result(pRes); const char *sql[] = {