Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
200d879f
T
TDengine
项目概览
taosdata
/
TDengine
11 个月 前同步成功
通知
1178
Star
22014
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
200d879f
编写于
12月 09, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opti:modify logic for telnet and json in schemaless
上级
00126953
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
10 deletion
+21
-10
source/client/src/clientSml.c
source/client/src/clientSml.c
+18
-7
utils/test/c/sml_test.c
utils/test/c/sml_test.c
+3
-3
未找到文件。
source/client/src/clientSml.c
浏览文件 @
200d879f
...
...
@@ -1280,7 +1280,9 @@ static int32_t smlParseTagKv(SSmlHandle *info, char **sql, char *sqlEnd,
SSmlKv
kv
=
{.
key
=
key
,
.
type
=
TSDB_DATA_TYPE_NCHAR
,
.
keyLen
=
keyLen
,
.
value
=
value
,
.
length
=
valueLen
};
if
(
info
->
dataFormat
){
if
(
unlikely
(
cnt
+
1
>
info
->
currSTableMeta
->
tableInfo
.
numOfTags
)){
info
->
needModifySchema
=
true
;
info
->
dataFormat
=
false
;
info
->
reRun
=
true
;
return
TSDB_CODE_SUCCESS
;
}
if
(
isSameMeasure
){
...
...
@@ -1488,13 +1490,17 @@ static int32_t smlParseColKv(SSmlHandle *info, char **sql, char *sqlEnd,
if
(
info
->
dataFormat
){
//cnt begin 0, add ts so + 2
if
(
unlikely
(
cnt
+
2
>
info
->
currSTableMeta
->
tableInfo
.
numOfColumns
)){
info
->
needModifySchema
=
true
;
info
->
dataFormat
=
false
;
info
->
reRun
=
true
;
return
TSDB_CODE_SUCCESS
;
}
// bind data
ret
=
smlBuildCol
(
info
->
currTableDataCtx
,
info
->
currSTableMeta
->
schema
,
&
kv
,
cnt
+
1
);
if
(
unlikely
(
ret
!=
TSDB_CODE_SUCCESS
))
{
smlBuildInvalidDataMsg
(
&
info
->
msgBuf
,
"smlBuildCol error"
,
NULL
);
return
ret
;
uError
(
"smlBuildCol error, retry"
);
info
->
dataFormat
=
false
;
info
->
reRun
=
true
;
return
TSDB_CODE_SUCCESS
;
}
if
(
isSameMeasure
){
...
...
@@ -1795,7 +1801,9 @@ static int32_t smlParseTelnetTags(SSmlHandle *info, char *data, char *sqlEnd, SS
if
(
info
->
dataFormat
){
if
(
unlikely
(
cnt
+
1
>
info
->
currSTableMeta
->
tableInfo
.
numOfTags
)){
info
->
needModifySchema
=
true
;
info
->
dataFormat
=
false
;
info
->
reRun
=
true
;
return
TSDB_CODE_SUCCESS
;
}
if
(
isSameMeasure
){
...
...
@@ -2516,7 +2524,9 @@ static int32_t smlParseTagsFromJSON(SSmlHandle *info, cJSON *root, SSmlLineInfo
if
(
info
->
dataFormat
){
if
(
unlikely
(
cnt
+
1
>
info
->
currSTableMeta
->
tableInfo
.
numOfTags
)){
info
->
needModifySchema
=
true
;
info
->
dataFormat
=
false
;
info
->
reRun
=
true
;
return
TSDB_CODE_SUCCESS
;
}
if
(
isSameMeasure
){
...
...
@@ -2899,6 +2909,7 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char
return
code
;
}
char
*
oldRaw
=
rawLine
;
int32_t
i
=
0
;
while
(
i
<
numLines
)
{
char
*
tmp
=
NULL
;
...
...
@@ -2915,7 +2926,6 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char
len
++
;
}
if
(
info
->
protocol
==
TSDB_SML_LINE_PROTOCOL
&&
tmp
[
0
]
==
'#'
)
{
// this line is comment
i
++
;
continue
;
}
}
...
...
@@ -2946,6 +2956,7 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char
}
if
(
info
->
reRun
){
i
=
0
;
rawLine
=
oldRaw
;
info
->
reRun
=
false
;
// clear info->childTables
NodeList
*
pList
=
info
->
childTables
;
...
...
utils/test/c/sml_test.c
浏览文件 @
200d879f
...
...
@@ -1026,7 +1026,7 @@ int smlProcess_18784_Test() {
printf
(
"%s result:%s, rows:%d
\n
"
,
__FUNCTION__
,
taos_errstr
(
pRes
),
taos_affected_rows
(
pRes
));
int
code
=
taos_errno
(
pRes
);
ASSERT
(
!
code
);
ASSERT
(
taos_affected_rows
(
pRes
)
==
2
);
ASSERT
(
taos_affected_rows
(
pRes
)
==
1
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
taos
,
"select * from disk"
);
...
...
@@ -1160,8 +1160,8 @@ int sml_ttl_Test() {
int
main
(
int
argc
,
char
*
argv
[])
{
int
ret
=
0
;
//
ret = sml_ttl_Test();
//
ASSERT(!ret);
ret
=
sml_ttl_Test
();
ASSERT
(
!
ret
);
ret
=
sml_ts2164_Test
();
ASSERT
(
!
ret
);
ret
=
smlProcess_influx_Test
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录