Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e211ba81
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看板
提交
e211ba81
编写于
8月 26, 2021
作者:
Z
zhaoyanggh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
unlock stmt.c
上级
4461803b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
14 deletion
+14
-14
tests/script/api/stmt.c
tests/script/api/stmt.c
+14
-14
未找到文件。
tests/script/api/stmt.c
浏览文件 @
e211ba81
...
@@ -38,7 +38,7 @@ void taos_stmt_init_test() {
...
@@ -38,7 +38,7 @@ void taos_stmt_init_test() {
stmt
=
taos_stmt_init
(
taos
);
stmt
=
taos_stmt_init
(
taos
);
assert
(
stmt
==
NULL
);
assert
(
stmt
==
NULL
);
// ASM ERROR
// ASM ERROR
//
assert(taos_stmt_close(stmt) != 0);
assert
(
taos_stmt_close
(
stmt
)
!=
0
);
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
if
(
taos
==
NULL
)
{
if
(
taos
==
NULL
)
{
printf
(
"Cannot connect to tdengine server
\n
"
);
printf
(
"Cannot connect to tdengine server
\n
"
);
...
@@ -72,11 +72,11 @@ void taos_stmt_preprare_test() {
...
@@ -72,11 +72,11 @@ void taos_stmt_preprare_test() {
// below will make client dead lock
// below will make client dead lock
assert
(
taos_stmt_prepare
(
stmt
,
stmt_sql
,
0
)
==
0
);
assert
(
taos_stmt_prepare
(
stmt
,
stmt_sql
,
0
)
==
0
);
//
assert(taos_stmt_close(stmt) == 0);
assert
(
taos_stmt_close
(
stmt
)
==
0
);
//
stmt = taos_stmt_init(taos);
stmt
=
taos_stmt_init
(
taos
);
assert
(
stmt
!=
NULL
);
assert
(
stmt
!=
NULL
);
sprintf
(
stmt_sql
,
"select from ?"
);
sprintf
(
stmt_sql
,
"select from ?"
);
assert
(
taos_stmt_prepare
(
stmt
,
stmt_sql
,
0
)
!
=
0
);
assert
(
taos_stmt_prepare
(
stmt
,
stmt_sql
,
0
)
=
=
0
);
assert
(
taos_stmt_close
(
stmt
)
==
0
);
assert
(
taos_stmt_close
(
stmt
)
==
0
);
stmt
=
taos_stmt_init
(
taos
);
stmt
=
taos_stmt_init
(
taos
);
...
@@ -106,7 +106,7 @@ void taos_stmt_set_tbname_test() {
...
@@ -106,7 +106,7 @@ void taos_stmt_set_tbname_test() {
TAOS_STMT
*
stmt
=
NULL
;
TAOS_STMT
*
stmt
=
NULL
;
char
*
name
=
calloc
(
1
,
200
);
char
*
name
=
calloc
(
1
,
200
);
// ASM ERROR
// ASM ERROR
//
assert(taos_stmt_set_tbname(stmt, name) != 0);
assert
(
taos_stmt_set_tbname
(
stmt
,
name
)
!=
0
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
if
(
taos
==
NULL
)
{
if
(
taos
==
NULL
)
{
printf
(
"Cannot connect to tdengine server
\n
"
);
printf
(
"Cannot connect to tdengine server
\n
"
);
...
@@ -137,7 +137,7 @@ void taos_stmt_set_tbname_tags_test() {
...
@@ -137,7 +137,7 @@ void taos_stmt_set_tbname_tags_test() {
char
*
name
=
calloc
(
1
,
20
);
char
*
name
=
calloc
(
1
,
20
);
TAOS_BIND
*
tags
=
calloc
(
1
,
sizeof
(
TAOS_BIND
));
TAOS_BIND
*
tags
=
calloc
(
1
,
sizeof
(
TAOS_BIND
));
// ASM ERROR
// ASM ERROR
//
assert(taos_stmt_set_tbname_tags(stmt, name, tags) != 0);
assert
(
taos_stmt_set_tbname_tags
(
stmt
,
name
,
tags
)
!=
0
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
if
(
taos
==
NULL
)
{
if
(
taos
==
NULL
)
{
printf
(
"Cannot connect to tdengine server
\n
"
);
printf
(
"Cannot connect to tdengine server
\n
"
);
...
@@ -175,7 +175,7 @@ void taos_stmt_set_sub_tbname_test() {
...
@@ -175,7 +175,7 @@ void taos_stmt_set_sub_tbname_test() {
TAOS_STMT
*
stmt
=
NULL
;
TAOS_STMT
*
stmt
=
NULL
;
char
*
name
=
calloc
(
1
,
200
);
char
*
name
=
calloc
(
1
,
200
);
// ASM ERROR
// ASM ERROR
//
assert(taos_stmt_set_sub_tbname(stmt, name) != 0);
assert
(
taos_stmt_set_sub_tbname
(
stmt
,
name
)
!=
0
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
void
*
taos
=
taos_connect
(
"127.0.0.1"
,
"root"
,
"taosdata"
,
NULL
,
0
);
if
(
taos
==
NULL
)
{
if
(
taos
==
NULL
)
{
printf
(
"Cannot connect to tdengine server
\n
"
);
printf
(
"Cannot connect to tdengine server
\n
"
);
...
@@ -194,8 +194,8 @@ void taos_stmt_set_sub_tbname_test() {
...
@@ -194,8 +194,8 @@ void taos_stmt_set_sub_tbname_test() {
assert
(
taos_stmt_set_sub_tbname
(
stmt
,
name
)
!=
0
);
assert
(
taos_stmt_set_sub_tbname
(
stmt
,
name
)
!=
0
);
sprintf
(
name
,
"tb"
);
sprintf
(
name
,
"tb"
);
assert
(
taos_stmt_set_sub_tbname
(
stmt
,
name
)
==
0
);
assert
(
taos_stmt_set_sub_tbname
(
stmt
,
name
)
==
0
);
//
assert(taos_load_table_info(taos, "super, tb") == 0);
assert
(
taos_load_table_info
(
taos
,
"super, tb"
)
==
0
);
//
assert(taos_stmt_set_sub_tbname(stmt, name) == 0);
assert
(
taos_stmt_set_sub_tbname
(
stmt
,
name
)
==
0
);
free
(
name
);
free
(
name
);
free
(
stmt_sql
);
free
(
stmt_sql
);
assert
(
taos_stmt_close
(
stmt
)
==
0
);
assert
(
taos_stmt_close
(
stmt
)
==
0
);
...
@@ -494,7 +494,7 @@ void taos_stmt_use_result_test() {
...
@@ -494,7 +494,7 @@ void taos_stmt_use_result_test() {
execute_simple_sql
(
execute_simple_sql
(
taos
,
"insert into t1 values (1591060628001, 1, 1, 1, 1, 'abcdefgh',1,1,1,'一二三四五六七八', now, 1, 1, 1, 1)"
);
taos
,
"insert into t1 values (1591060628001, 1, 1, 1, 1, 'abcdefgh',1,1,1,'一二三四五六七八', now, 1, 1, 1, 1)"
);
//
taos_stmt_use_result_query(taos, "ts", TSDB_DATA_TYPE_TIMESTAMP);
taos_stmt_use_result_query
(
taos
,
"ts"
,
TSDB_DATA_TYPE_TIMESTAMP
);
taos_stmt_use_result_query
(
taos
,
"c1"
,
TSDB_DATA_TYPE_INT
);
taos_stmt_use_result_query
(
taos
,
"c1"
,
TSDB_DATA_TYPE_INT
);
taos_stmt_use_result_query
(
taos
,
"c2"
,
TSDB_DATA_TYPE_BIGINT
);
taos_stmt_use_result_query
(
taos
,
"c2"
,
TSDB_DATA_TYPE_BIGINT
);
taos_stmt_use_result_query
(
taos
,
"c3"
,
TSDB_DATA_TYPE_FLOAT
);
taos_stmt_use_result_query
(
taos
,
"c3"
,
TSDB_DATA_TYPE_FLOAT
);
...
@@ -504,7 +504,7 @@ void taos_stmt_use_result_test() {
...
@@ -504,7 +504,7 @@ void taos_stmt_use_result_test() {
taos_stmt_use_result_query
(
taos
,
"c7"
,
TSDB_DATA_TYPE_TINYINT
);
taos_stmt_use_result_query
(
taos
,
"c7"
,
TSDB_DATA_TYPE_TINYINT
);
taos_stmt_use_result_query
(
taos
,
"c8"
,
TSDB_DATA_TYPE_BOOL
);
taos_stmt_use_result_query
(
taos
,
"c8"
,
TSDB_DATA_TYPE_BOOL
);
taos_stmt_use_result_query
(
taos
,
"c9"
,
TSDB_DATA_TYPE_NCHAR
);
taos_stmt_use_result_query
(
taos
,
"c9"
,
TSDB_DATA_TYPE_NCHAR
);
//
taos_stmt_use_result_query(taos, "c10", TSDB_DATA_TYPE_TIMESTAMP);
taos_stmt_use_result_query
(
taos
,
"c10"
,
TSDB_DATA_TYPE_TIMESTAMP
);
taos_stmt_use_result_query
(
taos
,
"c11"
,
TSDB_DATA_TYPE_UINT
);
taos_stmt_use_result_query
(
taos
,
"c11"
,
TSDB_DATA_TYPE_UINT
);
taos_stmt_use_result_query
(
taos
,
"c12"
,
TSDB_DATA_TYPE_UBIGINT
);
taos_stmt_use_result_query
(
taos
,
"c12"
,
TSDB_DATA_TYPE_UBIGINT
);
taos_stmt_use_result_query
(
taos
,
"c13"
,
TSDB_DATA_TYPE_USMALLINT
);
taos_stmt_use_result_query
(
taos
,
"c13"
,
TSDB_DATA_TYPE_USMALLINT
);
...
@@ -516,8 +516,8 @@ void taos_stmt_use_result_test() {
...
@@ -516,8 +516,8 @@ void taos_stmt_use_result_test() {
void
taos_stmt_close_test
()
{
void
taos_stmt_close_test
()
{
printf
(
"start taos_stmt_close test
\n
"
);
printf
(
"start taos_stmt_close test
\n
"
);
// ASM ERROR
// ASM ERROR
//
TAOS_STMT *stmt = NULL;
TAOS_STMT
*
stmt
=
NULL
;
//
assert(taos_stmt_close(stmt) != 0);
assert
(
taos_stmt_close
(
stmt
)
!=
0
);
printf
(
"finish taos_stmt_close test
\n
"
);
printf
(
"finish taos_stmt_close test
\n
"
);
}
}
...
@@ -539,7 +539,7 @@ void test_api_reliability() {
...
@@ -539,7 +539,7 @@ void test_api_reliability() {
void
test_query
()
{
taos_stmt_use_result_test
();
}
void
test_query
()
{
taos_stmt_use_result_test
();
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
//
test_api_reliability();
test_api_reliability
();
test_query
();
test_query
();
return
0
;
return
0
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录