Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b493b8d2
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b493b8d2
编写于
1月 28, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:cols error because delete json cols value
上级
0f1f2394
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
3 deletion
+16
-3
source/client/inc/clientSml.h
source/client/inc/clientSml.h
+1
-0
source/client/src/clientSml.c
source/client/src/clientSml.c
+7
-0
source/client/src/clientSmlJson.c
source/client/src/clientSmlJson.c
+6
-3
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+2
-0
未找到文件。
source/client/inc/clientSml.h
浏览文件 @
b493b8d2
...
...
@@ -184,6 +184,7 @@ typedef struct {
SSmlLineInfo
*
lines
;
// element is SSmlLineInfo
bool
parseJsonByLib
;
SArray
*
tagJsonArray
;
SArray
*
valueJsonArray
;
//
SArray
*
preLineTagKV
;
...
...
source/client/src/clientSml.c
浏览文件 @
b493b8d2
...
...
@@ -1072,6 +1072,12 @@ void smlDestroyInfo(SSmlHandle *info) {
}
taosArrayDestroy
(
info
->
tagJsonArray
);
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
info
->
valueJsonArray
);
i
++
)
{
cJSON
*
value
=
(
cJSON
*
)
taosArrayGetP
(
info
->
valueJsonArray
,
i
);
cJSON_Delete
(
value
);
}
taosArrayDestroy
(
info
->
valueJsonArray
);
taosArrayDestroy
(
info
->
preLineTagKV
);
taosArrayDestroy
(
info
->
maxTagKVs
);
taosArrayDestroy
(
info
->
preLineColKV
);
...
...
@@ -1111,6 +1117,7 @@ SSmlHandle *smlBuildSmlInfo(TAOS *taos) {
info
->
dataFormat
=
true
;
info
->
tagJsonArray
=
taosArrayInit
(
8
,
POINTER_BYTES
);
info
->
valueJsonArray
=
taosArrayInit
(
8
,
POINTER_BYTES
);
info
->
preLineTagKV
=
taosArrayInit
(
8
,
sizeof
(
SSmlKv
));
info
->
maxTagKVs
=
taosArrayInit
(
8
,
sizeof
(
SSmlKv
));
info
->
preLineColKV
=
taosArrayInit
(
8
,
sizeof
(
SSmlKv
));
...
...
source/client/src/clientSmlJson.c
浏览文件 @
b493b8d2
...
...
@@ -1155,15 +1155,18 @@ static int32_t smlParseJSONString(SSmlHandle *info, char **start, SSmlLineInfo *
char
tmp
=
elements
->
cols
[
elements
->
colsLen
];
elements
->
cols
[
elements
->
colsLen
]
=
'\0'
;
cJSON
*
valueJson
=
cJSON_Parse
(
elements
->
cols
);
if
(
unlikely
(
valueJson
==
NULL
))
{
uError
(
"SML:0x%"
PRIx64
" parse json cols failed:%s"
,
info
->
id
,
elements
->
cols
);
return
TSDB_CODE_TSC_INVALID_JSON
;
}
taosArrayPush
(
info
->
tagJsonArray
,
&
valueJson
);
ret
=
smlParseValueFromJSONObj
(
valueJson
,
&
kv
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"SML:Failed to parse value from JSON Obj:%s"
,
elements
->
cols
);
elements
->
cols
[
elements
->
colsLen
]
=
tmp
;
cJSON_Delete
(
valueJson
);
return
TSDB_CODE_TSC_INVALID_VALUE
;
}
elements
->
cols
[
elements
->
colsLen
]
=
tmp
;
cJSON_Delete
(
valueJson
);
}
else
if
(
smlParseValue
(
&
kv
,
&
info
->
msgBuf
)
!=
TSDB_CODE_SUCCESS
){
uError
(
"SML:cols invalidate:%s"
,
elements
->
cols
);
return
TSDB_CODE_TSC_INVALID_VALUE
;
...
...
@@ -1176,7 +1179,7 @@ static int32_t smlParseJSONString(SSmlHandle *info, char **start, SSmlLineInfo *
cJSON
*
tagsJson
=
cJSON_Parse
(
elements
->
tags
);
*
(
elements
->
tags
+
elements
->
tagsLen
)
=
tmp
;
if
(
unlikely
(
tagsJson
==
NULL
))
{
uError
(
"SML:0x%"
PRIx64
" parse json failed:%s"
,
info
->
id
,
elements
->
tags
);
uError
(
"SML:0x%"
PRIx64
" parse json
tag
failed:%s"
,
info
->
id
,
elements
->
tags
);
return
TSDB_CODE_TSC_INVALID_JSON
;
}
...
...
tests/pytest/util/dnodes.py
浏览文件 @
b493b8d2
...
...
@@ -29,6 +29,7 @@ class TDSimClient:
self
.
testCluster
=
False
self
.
path
=
path
self
.
cfgDict
=
{
"fqdn"
:
"localhost"
,
"numOfLogLines"
:
"100000000"
,
"locale"
:
"en_US.UTF-8"
,
"charset"
:
"UTF-8"
,
...
...
@@ -119,6 +120,7 @@ class TDDnode:
self
.
asan
=
False
self
.
remoteIP
=
""
self
.
cfgDict
=
{
"fqdn"
:
"localhost"
,
"monitor"
:
"0"
,
"maxShellConns"
:
"30000"
,
"locale"
:
"en_US.UTF-8"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录