Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b04933f0
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b04933f0
编写于
10月 19, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed apitest.c
上级
47c656c9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
61 addition
and
12 deletion
+61
-12
tests/examples/c/apitest.c
tests/examples/c/apitest.c
+61
-12
未找到文件。
tests/examples/c/apitest.c
浏览文件 @
b04933f0
...
...
@@ -288,7 +288,7 @@ void verify_stream(TAOS* taos) {
taos_close_stream
(
strm
);
}
int32_t
verify_schema_less
(
TAOS
*
taos
)
{
void
verify_schema_less
(
TAOS
*
taos
)
{
TAOS_RES
*
result
;
result
=
taos_query
(
taos
,
"drop database if exists test;"
);
taos_free_result
(
result
);
...
...
@@ -302,8 +302,7 @@ int32_t verify_schema_less(TAOS* taos) {
taos_free_result
(
result
);
usleep
(
100000
);
char
msg
[
512
];
int
code
=
0
,
a_lines
=
0
;
int
code
=
0
,
affected_rows
=
0
;
char
*
lines
[]
=
{
"st,t1=3i64,t2=4f64,t3=
\"
t3
\"
c1=3i64,c3=L
\"
passit
\"
,c2=false,c4=4f64 1626006833639000000"
,
...
...
@@ -317,41 +316,91 @@ int32_t verify_schema_less(TAOS* taos) {
"stf,t1=4i64,t3=
\"
t4
\"
,t2=5f64,t4=5f64 c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933641000000"
};
code
=
taos_schemaless_insert
(
taos
,
lines
,
sizeof
(
lines
)
/
sizeof
(
char
*
),
0
,
"ns"
,
&
a_lines
,
msg
,
sizeof
(
msg
));
result
=
taos_schemaless_insert
(
taos
,
lines
,
sizeof
(
lines
)
/
sizeof
(
char
*
),
SML_LINE_PROTOCOL
,
SML_TIMESTAMP_MILLI_SECONDS
);
code
=
taos_errno
(
result
);
affected_rows
=
taos_affected_rows
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"
\033
[31m [lines1]taos_schemaless_insert failed, code: %d,%s, affected rows:%d
\033
[0m
\n
"
,
code
,
taos_errstr
(
result
),
affected_rows
);
}
taos_free_result
(
result
);
char
*
lines2
[]
=
{
"stg,t1=3i64,t2=4f64,t3=
\"
t3
\"
c1=3i64,c3=L
\"
passit
\"
,c2=false,c4=4f64 1626006833639000000"
,
"stg,t1=4i64,t3=
\"
t4
\"
,t2=5f64,t4=5f64 c1=3i64,c3=L
\"
passitagin
\"
,c2=true,c4=5f64,c5=5f64 1626006833641000000"
};
code
=
taos_schemaless_insert
(
taos
,
&
lines2
[
0
],
1
,
0
,
"ns"
,
&
a_lines
,
msg
,
sizeof
(
msg
));
code
=
taos_schemaless_insert
(
taos
,
&
lines2
[
1
],
1
,
0
,
"ns"
,
&
a_lines
,
msg
,
sizeof
(
msg
));
result
=
taos_schemaless_insert
(
taos
,
&
lines2
[
0
],
1
,
SML_LINE_PROTOCOL
,
SML_TIMESTAMP_MILLI_SECONDS
);
code
=
taos_errno
(
result
);
affected_rows
=
taos_affected_rows
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"
\033
[31m [lines2_0]taos_schemaless_insert failed, code: %d,%s, affected rows:%d
\033
[0m
\n
"
,
code
,
taos_errstr
(
result
),
affected_rows
);
}
taos_free_result
(
result
);
result
=
taos_schemaless_insert
(
taos
,
&
lines2
[
1
],
1
,
SML_LINE_PROTOCOL
,
SML_TIMESTAMP_MILLI_SECONDS
);
code
=
taos_errno
(
result
);
affected_rows
=
taos_affected_rows
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"
\033
[31m [lines2_1]taos_schemaless_insert failed, code: %d,%s, affected rows:%d
\033
[0m
\n
"
,
code
,
taos_errstr
(
result
),
affected_rows
);
}
taos_free_result
(
result
);
char
*
lines3
[]
=
{
"sth,t1=4i64,t2=5f64,t4=5f64,ID=childTable c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933641"
,
"sth,t1=4i64,t2=5f64,t4=5f64 c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933654"
};
code
=
taos_schemaless_insert
(
taos
,
lines3
,
2
,
0
,
"ms"
,
&
a_lines
,
msg
,
sizeof
(
msg
));
result
=
taos_schemaless_insert
(
taos
,
lines3
,
2
,
SML_LINE_PROTOCOL
,
SML_TIMESTAMP_MILLI_SECONDS
);
code
=
taos_errno
(
result
);
affected_rows
=
taos_affected_rows
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"
\033
[31m [lines3]taos_schemaless_insert failed, code: %d,%s, affected rows:%d
\033
[0m
\n
"
,
code
,
taos_errstr
(
result
),
affected_rows
);
}
taos_free_result
(
result
);
char
*
lines4
[]
=
{
"st123456,t1=3i64,t2=4f64,t3=
\"
t3
\"
c1=3i64,c3=L
\"
passit
\"
,c2=false,c4=4f64 1626006833639000000"
,
"dgtyqodr,t2=5f64,t3=L
\"
ste
\"
c1=tRue,c2=4i64,c3=
\"
iam
\"
1626056811823316532"
};
code
=
taos_schemaless_insert
(
taos
,
lines4
,
2
,
0
,
"ns"
,
&
a_lines
,
msg
,
sizeof
(
msg
));
result
=
taos_schemaless_insert
(
taos
,
lines4
,
2
,
SML_LINE_PROTOCOL
,
SML_TIMESTAMP_MILLI_SECONDS
);
code
=
taos_errno
(
result
);
affected_rows
=
taos_affected_rows
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"
\033
[31m [lines4]taos_schemaless_insert failed, code: %d,%s, affected rows:%d
\033
[0m
\n
"
,
code
,
taos_errstr
(
result
),
affected_rows
);
}
taos_free_result
(
result
);
char
*
lines5
[]
=
{
"zqlbgs,id=zqlbgs_39302_21680,t0=f,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=
\"
binaryTagValue
\"
,t8=L
\"
ncharTagValue
\"
c0=f,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=
\"
binaryColValue
\"
,c8=L
\"
ncharColValue
\"
,c9=7u64 1626006833639000000"
,
"zqlbgs,t9=f,id=zqlbgs_39302_21680,t0=f,t1=127i8,t11=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=
\"
binaryTagValue
\"
,t8=L
\"
ncharTagValue
\"
,t10=L
\"
ncharTagValue
\"
c10=f,c0=f,c1=127i8,c12=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=
\"
binaryColValue
\"
,c8=L
\"
ncharColValue
\"
,c9=7u64,c11=L
\"
ncharColValue
\"
1626006833639000000"
};
code
=
taos_schemaless_insert
(
taos
,
&
lines5
[
0
],
1
,
0
,
"ns"
,
&
a_lines
,
msg
,
sizeof
(
msg
));
code
=
taos_schemaless_insert
(
taos
,
&
lines5
[
1
],
1
,
0
,
"ns"
,
&
a_lines
,
msg
,
sizeof
(
msg
));
result
=
taos_schemaless_insert
(
taos
,
&
lines5
[
0
],
1
,
SML_LINE_PROTOCOL
,
SML_TIMESTAMP_MILLI_SECONDS
);
code
=
taos_errno
(
result
);
affected_rows
=
taos_affected_rows
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"
\033
[31m [lines5_0]taos_schemaless_insert failed, code: %d,%s, affected rows:%d
\033
[0m
\n
"
,
code
,
taos_errstr
(
result
),
affected_rows
);
}
taos_free_result
(
result
);
result
=
taos_schemaless_insert
(
taos
,
&
lines5
[
1
],
1
,
SML_LINE_PROTOCOL
,
SML_TIMESTAMP_MILLI_SECONDS
);
code
=
taos_errno
(
result
);
affected_rows
=
taos_affected_rows
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"
\033
[31m [lines5_1]taos_schemaless_insert failed, code: %d,%s, affected rows:%d
\033
[0m
\n
"
,
code
,
taos_errstr
(
result
),
affected_rows
);
}
taos_free_result
(
result
);
char
*
lines6
[]
=
{
"st123456,t1=3i64,t2=4f64,t3=
\"
t3
\"
c1=3i64,c3=L
\"
passit
\"
,c2=false,c4=4f64 1626006833639000000"
,
"dgtyqodr,t2=5f64,t3=L
\"
ste
\"
c1=tRue,c2=4i64,c3=
\"
iam
\"
1626056811823316532"
};
code
=
taos_schemaless_insert
(
taos
,
lines6
,
2
,
0
,
"ns"
,
&
a_lines
,
msg
,
sizeof
(
msg
));
result
=
taos_schemaless_insert
(
taos
,
lines6
,
2
,
SML_LINE_PROTOCOL
,
SML_TIMESTAMP_MILLI_SECONDS
);
code
=
taos_errno
(
result
);
affected_rows
=
taos_affected_rows
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
printf
(
"
\033
[31m [lines6]taos_schemaless_insert failed, code: %d,%s, affected rows:%d
\033
[0m
\n
"
,
code
,
taos_errstr
(
result
),
affected_rows
);
}
taos_free_result
(
result
);
return
(
code
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录