Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小楼昨夜-听风雨
TDengine
提交
93c6fee9
T
TDengine
项目概览
小楼昨夜-听风雨
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
93c6fee9
编写于
7月 12, 2021
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
can add two lines of one supertable/diffrent subtable
上级
ee10305d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
9 deletion
+11
-9
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+6
-6
tests/examples/c/apitest.c
tests/examples/c/apitest.c
+5
-3
未找到文件。
src/client/src/tscParseLineProtocol.c
浏览文件 @
93c6fee9
...
...
@@ -540,13 +540,13 @@ int taos_sml_insert(TAOS* taos, TAOS_SML_DATA_POINT* points, int numPoint) {
for
(
int
i
=
0
;
i
<
numPoint
;
++
i
)
{
TAOS_SML_DATA_POINT
*
point
=
&
points
[
i
];
SSmlSTableSchema
**
ppStableSchema
=
taosHashGet
(
sname2shema
,
point
->
stableName
,
TSDB_TABLE_NAME_LEN
);
size_t
stableNameLen
=
strlen
(
point
->
stableName
);
SSmlSTableSchema
**
ppStableSchema
=
taosHashGet
(
sname2shema
,
point
->
stableName
,
stableNameLen
);
SSmlSTableSchema
*
pStableSchema
=
NULL
;
if
(
ppStableSchema
)
{
pStableSchema
=
*
ppStableSchema
;
}
else
{
SSmlSTableSchema
schema
;
size_t
stableNameLen
=
strlen
(
point
->
stableName
);
strncpy
(
schema
.
sTableName
,
point
->
stableName
,
stableNameLen
);
schema
.
sTableName
[
stableNameLen
]
=
'\0'
;
schema
.
fields
=
taosArrayInit
(
64
,
sizeof
(
SSchema
));
...
...
@@ -730,13 +730,13 @@ int32_t parseItemValue(SLPItem* item, LPItemKind kind) {
item
->
length
=
(
int16_t
)
tDataTypes
[
item
->
type
].
bytes
;
item
->
value
=
malloc
(
item
->
length
);
char
*
endptr
=
NULL
;
*
(
item
->
value
)
=
strtoll
(
sv
,
&
endptr
,
10
);
*
(
i
nt64_t
*
)(
i
tem
->
value
)
=
strtoll
(
sv
,
&
endptr
,
10
);
}
else
{
item
->
type
=
TSDB_DATA_TYPE_DOUBLE
;
item
->
length
=
(
int16_t
)
tDataTypes
[
item
->
type
].
bytes
;
item
->
value
=
malloc
(
item
->
length
);
char
*
endptr
=
NULL
;
*
(
item
->
value
)
=
strtold
(
sv
,
&
endptr
);
*
(
double
*
)(
item
->
value
)
=
strtold
(
sv
,
&
endptr
);
}
}
else
if
((
sv
[
0
]
==
'L'
&&
sv
[
1
]
==
'"'
)
||
sv
[
0
]
==
'"'
)
{
if
(
sv
[
0
]
==
'L'
)
{
...
...
@@ -744,7 +744,7 @@ int32_t parseItemValue(SLPItem* item, LPItemKind kind) {
uint32_t
bytes
=
item
->
valueToken
.
n
-
3
;
item
->
length
=
bytes
;
item
->
value
=
malloc
(
bytes
);
memcpy
(
item
->
value
,
sv
+
1
,
bytes
);
memcpy
(
item
->
value
,
sv
+
2
,
bytes
);
}
else
if
(
sv
[
0
]
==
'"'
){
item
->
type
=
TSDB_DATA_TYPE_BINARY
;
uint32_t
bytes
=
item
->
valueToken
.
n
-
2
;
...
...
@@ -756,7 +756,7 @@ int32_t parseItemValue(SLPItem* item, LPItemKind kind) {
item
->
type
=
TSDB_DATA_TYPE_BOOL
;
item
->
length
=
tDataTypes
[
item
->
type
].
bytes
;
item
->
value
=
malloc
(
tDataTypes
[
item
->
type
].
bytes
);
*
(
item
->
value
)
=
tolower
(
sv
[
0
])
==
't'
?
TSDB_TRUE
:
TSDB_FALSE
;
*
(
uint8_t
*
)(
item
->
value
)
=
tolower
(
sv
[
0
])
==
't'
?
TSDB_TRUE
:
TSDB_FALSE
;
}
return
0
;
}
...
...
tests/examples/c/apitest.c
浏览文件 @
93c6fee9
...
...
@@ -952,9 +952,11 @@ void verify_stream(TAOS* taos) {
int32_t
verify_schema_less
(
TAOS
*
taos
)
{
prepare_data
(
taos
);
char
*
lines
[]
=
{
"st,t1=3i,t2=4,t3=
\"
t3
\"
c1=3i,c3=L
\"
passit
\"
,c2=false,c4=4 1626006833639162922"
"st,t1=3i,t2=4,t3=
\"
t3
\"
c1=3i,c3=L
\"
passit
\"
,c2=false,c4=4 1626006833639"
,
"st,t1=4i,t2=5,t3=
\"
t4
\"
c1=3i,c3=L
\"
passitagain
\"
,c2=true,c4=5 1626006833640"
,
"st,t1=4i,t2=5,t3=
\"
t4
\"
c1=3i,c3=L
\"
passitagain
\"
,c2=true,c4=5 1626006833642"
};
int
code
=
taos_insert_by_lines
(
taos
,
lines
,
1
);
int
code
=
taos_insert_by_lines
(
taos
,
lines
,
2
);
return
code
;
}
...
...
@@ -976,7 +978,7 @@ int main(int argc, char *argv[]) {
info
=
taos_get_client_info
(
taos
);
printf
(
"client info: %s
\n
"
,
info
);
printf
(
"************ verify
query
*************
\n
"
);
printf
(
"************ verify
shemaless
*************
\n
"
);
int
code
=
verify_schema_less
(
taos
);
if
(
code
==
0
)
{
return
code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录