Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a1c4f5c2
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
a1c4f5c2
编写于
4月 18, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stmt
上级
0c2f22fb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
77 addition
and
65 deletion
+77
-65
source/client/inc/clientStmt.h
source/client/inc/clientStmt.h
+1
-1
source/client/src/clientMain.c
source/client/src/clientMain.c
+14
-2
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+1
-1
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+61
-61
未找到文件。
source/client/inc/clientStmt.h
浏览文件 @
a1c4f5c2
...
@@ -100,7 +100,7 @@ int stmtIsInsert(TAOS_STMT *stmt, int *insert);
...
@@ -100,7 +100,7 @@ int stmtIsInsert(TAOS_STMT *stmt, int *insert);
int
stmtGetParamNum
(
TAOS_STMT
*
stmt
,
int
*
nums
);
int
stmtGetParamNum
(
TAOS_STMT
*
stmt
,
int
*
nums
);
int
stmtAddBatch
(
TAOS_STMT
*
stmt
);
int
stmtAddBatch
(
TAOS_STMT
*
stmt
);
TAOS_RES
*
stmtUseResult
(
TAOS_STMT
*
stmt
);
TAOS_RES
*
stmtUseResult
(
TAOS_STMT
*
stmt
);
int
stmtBindBatch
(
TAOS_STMT
*
stmt
,
TAOS_BIND_v2
*
bind
);
int
stmtBindBatch
(
TAOS_STMT
*
stmt
,
TAOS_BIND_v2
*
bind
,
int32_t
colIdx
);
#ifdef __cplusplus
#ifdef __cplusplus
...
...
source/client/src/clientMain.c
浏览文件 @
a1c4f5c2
...
@@ -635,7 +635,7 @@ int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_BIND_v2 *bind) {
...
@@ -635,7 +635,7 @@ int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_BIND_v2 *bind) {
return
terrno
;
return
terrno
;
}
}
return
stmtBindBatch
(
stmt
,
bind
);
return
stmtBindBatch
(
stmt
,
bind
,
-
1
);
}
}
int
taos_stmt_bind_param_batch
(
TAOS_STMT
*
stmt
,
TAOS_BIND_v2
*
bind
)
{
int
taos_stmt_bind_param_batch
(
TAOS_STMT
*
stmt
,
TAOS_BIND_v2
*
bind
)
{
...
@@ -651,10 +651,22 @@ int taos_stmt_bind_param_batch(TAOS_STMT *stmt, TAOS_BIND_v2 *bind) {
...
@@ -651,10 +651,22 @@ int taos_stmt_bind_param_batch(TAOS_STMT *stmt, TAOS_BIND_v2 *bind) {
return
terrno
;
return
terrno
;
}
}
return
stmtBindBatch
(
stmt
,
bind
);
return
stmtBindBatch
(
stmt
,
bind
,
-
1
);
}
}
int
taos_stmt_bind_single_param_batch
(
TAOS_STMT
*
stmt
,
TAOS_BIND_v2
*
bind
,
int
colIdx
)
{
int
taos_stmt_bind_single_param_batch
(
TAOS_STMT
*
stmt
,
TAOS_BIND_v2
*
bind
,
int
colIdx
)
{
if
(
stmt
==
NULL
||
bind
==
NULL
)
{
tscError
(
"NULL parameter for %s"
,
__FUNCTION__
);
terrno
=
TSDB_CODE_INVALID_PARA
;
return
terrno
;
}
if
(
colIdx
<=
0
)
{
tscError
(
"invalid bind column idx %d"
,
colIdx
);
terrno
=
TSDB_CODE_INVALID_PARA
;
return
terrno
;
}
return
stmtBindBatch
(
stmt
,
bind
,
colIdx
);
/* TODO */
return
stmtBindBatch
(
stmt
,
bind
,
colIdx
);
/* TODO */
}
}
...
...
source/client/src/clientStmt.c
浏览文件 @
a1c4f5c2
...
@@ -402,7 +402,7 @@ int32_t stmtFetchColFields(TAOS_STMT *stmt, int32_t *fieldNum, TAOS_FIELD** fiel
...
@@ -402,7 +402,7 @@ int32_t stmtFetchColFields(TAOS_STMT *stmt, int32_t *fieldNum, TAOS_FIELD** fiel
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int
stmtBindBatch
(
TAOS_STMT
*
stmt
,
TAOS_BIND_v2
*
bind
)
{
int
stmtBindBatch
(
TAOS_STMT
*
stmt
,
TAOS_BIND_v2
*
bind
,
int32_t
colIdx
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
STMT_ERR_RET
(
stmtSwitchStatus
(
pStmt
,
STMT_BIND
));
STMT_ERR_RET
(
stmtSwitchStatus
(
pStmt
,
STMT_BIND
));
...
...
tests/script/api/batchprepare.c
浏览文件 @
a1c4f5c2
...
@@ -407,7 +407,6 @@ int stmt_scol_func3(TAOS_STMT *stmt) {
...
@@ -407,7 +407,6 @@ int stmt_scol_func3(TAOS_STMT *stmt) {
return
0
;
return
0
;
}
}
#if 0
//10 tables 10 records single column bind
//10 tables 10 records single column bind
...
@@ -428,7 +427,7 @@ int stmt_scol_func4(TAOS_STMT *stmt) {
...
@@ -428,7 +427,7 @@ int stmt_scol_func4(TAOS_STMT *stmt) {
int
*
lb
=
taosMemoryMalloc
(
60
*
sizeof
(
int
));
int
*
lb
=
taosMemoryMalloc
(
60
*
sizeof
(
int
));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1000*10);
TAOS_
BIND_v2
*
params
=
taosMemoryCalloc
(
1
,
sizeof
(
TAOS_BIND_v2
)
*
1000
*
10
);
char
*
is_null
=
taosMemoryMalloc
(
sizeof
(
char
)
*
60
);
char
*
is_null
=
taosMemoryMalloc
(
sizeof
(
char
)
*
60
);
char
*
no_null
=
taosMemoryMalloc
(
sizeof
(
char
)
*
60
);
char
*
no_null
=
taosMemoryMalloc
(
sizeof
(
char
)
*
60
);
...
@@ -488,7 +487,7 @@ int stmt_scol_func4(TAOS_STMT *stmt) {
...
@@ -488,7 +487,7 @@ int stmt_scol_func4(TAOS_STMT *stmt) {
v
.
ts
[
i
]
=
tts
+
i
;
v
.
ts
[
i
]
=
tts
+
i
;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned
long
long
starttime
=
taosGetTimestampUs
();
char
*
sql
=
"insert into ? (ts,b,v4,v8,f8) values(?,?,?,?,?)"
;
char
*
sql
=
"insert into ? (ts,b,v4,v8,f8) values(?,?,?,?,?)"
;
int
code
=
taos_stmt_prepare
(
stmt
,
sql
,
0
);
int
code
=
taos_stmt_prepare
(
stmt
,
sql
,
0
);
...
@@ -519,7 +518,7 @@ int stmt_scol_func4(TAOS_STMT *stmt) {
...
@@ -519,7 +518,7 @@ int stmt_scol_func4(TAOS_STMT *stmt) {
}
}
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned
long
long
endtime
=
taosGetTimestampUs
();
printf
(
"insert total %d records, used %u seconds, avg:%u useconds
\n
"
,
3000
*
300
*
60
,
(
endtime
-
starttime
)
/
1000000UL
,
(
endtime
-
starttime
)
/
(
3000
*
300
*
60
));
printf
(
"insert total %d records, used %u seconds, avg:%u useconds
\n
"
,
3000
*
300
*
60
,
(
endtime
-
starttime
)
/
1000000UL
,
(
endtime
-
starttime
)
/
(
3000
*
300
*
60
));
taosMemoryFree
(
v
.
ts
);
taosMemoryFree
(
v
.
ts
);
...
@@ -531,6 +530,7 @@ int stmt_scol_func4(TAOS_STMT *stmt) {
...
@@ -531,6 +530,7 @@ int stmt_scol_func4(TAOS_STMT *stmt) {
return
0
;
return
0
;
}
}
#if 0
int stmt_func1(TAOS_STMT *stmt) {
int stmt_func1(TAOS_STMT *stmt) {
...
@@ -926,7 +926,7 @@ int stmt_funcb_autoctb1(TAOS_STMT *stmt) {
...
@@ -926,7 +926,7 @@ int stmt_funcb_autoctb1(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*10);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -1075,7 +1075,7 @@ int stmt_funcb_autoctb1(TAOS_STMT *stmt) {
...
@@ -1075,7 +1075,7 @@ int stmt_funcb_autoctb1(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -1104,7 +1104,7 @@ int stmt_funcb_autoctb1(TAOS_STMT *stmt) {
...
@@ -1104,7 +1104,7 @@ int stmt_funcb_autoctb1(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -1139,7 +1139,7 @@ int stmt_funcb_autoctb2(TAOS_STMT *stmt) {
...
@@ -1139,7 +1139,7 @@ int stmt_funcb_autoctb2(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*10);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -1288,7 +1288,7 @@ int stmt_funcb_autoctb2(TAOS_STMT *stmt) {
...
@@ -1288,7 +1288,7 @@ int stmt_funcb_autoctb2(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 tags(1,true,2,3,4,5.0,6.0,'a','b') values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? using stb1 tags(1,true,2,3,4,5.0,6.0,'a','b') values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -1317,7 +1317,7 @@ int stmt_funcb_autoctb2(TAOS_STMT *stmt) {
...
@@ -1317,7 +1317,7 @@ int stmt_funcb_autoctb2(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -1353,7 +1353,7 @@ int stmt_funcb_autoctb3(TAOS_STMT *stmt) {
...
@@ -1353,7 +1353,7 @@ int stmt_funcb_autoctb3(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*10);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -1477,7 +1477,7 @@ int stmt_funcb_autoctb3(TAOS_STMT *stmt) {
...
@@ -1477,7 +1477,7 @@ int stmt_funcb_autoctb3(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 tags(1,?,2,?,4,?,6.0,?,'b') values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? using stb1 tags(1,?,2,?,4,?,6.0,?,'b') values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -1506,7 +1506,7 @@ int stmt_funcb_autoctb3(TAOS_STMT *stmt) {
...
@@ -1506,7 +1506,7 @@ int stmt_funcb_autoctb3(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -1544,7 +1544,7 @@ int stmt_funcb_autoctb4(TAOS_STMT *stmt) {
...
@@ -1544,7 +1544,7 @@ int stmt_funcb_autoctb4(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*5);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*5);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -1632,7 +1632,7 @@ int stmt_funcb_autoctb4(TAOS_STMT *stmt) {
...
@@ -1632,7 +1632,7 @@ int stmt_funcb_autoctb4(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 tags(1,?,2,?,4,?,6.0,?,'b') (ts,b,v4,v8,f8) values(?,?,?,?,?)";
char *sql = "insert into ? using stb1 tags(1,?,2,?,4,?,6.0,?,'b') (ts,b,v4,v8,f8) values(?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -1661,7 +1661,7 @@ int stmt_funcb_autoctb4(TAOS_STMT *stmt) {
...
@@ -1661,7 +1661,7 @@ int stmt_funcb_autoctb4(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -1697,7 +1697,7 @@ int stmt_funcb_autoctb_e1(TAOS_STMT *stmt) {
...
@@ -1697,7 +1697,7 @@ int stmt_funcb_autoctb_e1(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*10);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -1821,7 +1821,7 @@ int stmt_funcb_autoctb_e1(TAOS_STMT *stmt) {
...
@@ -1821,7 +1821,7 @@ int stmt_funcb_autoctb_e1(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 (id1,id2,id3,id4,id5,id6,id7,id8,id9) tags(1,?,2,?,4,?,6.0,?,'b') values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? using stb1 (id1,id2,id3,id4,id5,id6,id7,id8,id9) tags(1,?,2,?,4,?,6.0,?,'b') values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -1850,7 +1850,7 @@ int stmt_funcb_autoctb_e1(TAOS_STMT *stmt) {
...
@@ -1850,7 +1850,7 @@ int stmt_funcb_autoctb_e1(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -1886,7 +1886,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) {
...
@@ -1886,7 +1886,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*10);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -2035,7 +2035,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) {
...
@@ -2035,7 +2035,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -2065,7 +2065,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) {
...
@@ -2065,7 +2065,7 @@ int stmt_funcb_autoctb_e2(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -2103,7 +2103,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) {
...
@@ -2103,7 +2103,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*10);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -2252,7 +2252,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) {
...
@@ -2252,7 +2252,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 (id1,id2,id3,id4,id5,id6,id7,id8,id9) tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? using stb1 (id1,id2,id3,id4,id5,id6,id7,id8,id9) tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -2283,7 +2283,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) {
...
@@ -2283,7 +2283,7 @@ int stmt_funcb_autoctb_e3(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -2318,7 +2318,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) {
...
@@ -2318,7 +2318,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*10);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -2467,7 +2467,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) {
...
@@ -2467,7 +2467,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -2508,7 +2508,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) {
...
@@ -2508,7 +2508,7 @@ int stmt_funcb_autoctb_e4(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -2545,7 +2545,7 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
...
@@ -2545,7 +2545,7 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(10 * sizeof(int));
int *lb = taosMemoryMalloc(10 * sizeof(int));
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_BIND *tags = taosMemoryCalloc(1, sizeof(TAOS_BIND) * 9 * 1);
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 1*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 1*10);
// int one_null = 1;
// int one_null = 1;
int one_not_null = 0;
int one_not_null = 0;
...
@@ -2694,7 +2694,7 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
...
@@ -2694,7 +2694,7 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? using stb1 tags(?,?,?,?,?,?,?,?,?) values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(NULL, sql, 0);
int code = taos_stmt_prepare(NULL, sql, 0);
...
@@ -2735,7 +2735,7 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
...
@@ -2735,7 +2735,7 @@ int stmt_funcb_autoctb_e5(TAOS_STMT *stmt) {
++id;
++id;
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 10, (endtime-starttime)/1000000UL, (endtime-starttime)/(10));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -2768,7 +2768,7 @@ int stmt_funcb1(TAOS_STMT *stmt) {
...
@@ -2768,7 +2768,7 @@ int stmt_funcb1(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(60 * sizeof(int));
int *lb = taosMemoryMalloc(60 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 900000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 900000*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
...
@@ -2864,7 +2864,7 @@ int stmt_funcb1(TAOS_STMT *stmt) {
...
@@ -2864,7 +2864,7 @@ int stmt_funcb1(TAOS_STMT *stmt) {
v.ts[i] = tts + i;
v.ts[i] = tts + i;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -2894,7 +2894,7 @@ int stmt_funcb1(TAOS_STMT *stmt) {
...
@@ -2894,7 +2894,7 @@ int stmt_funcb1(TAOS_STMT *stmt) {
++id;
++id;
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -2925,7 +2925,7 @@ int stmt_funcb2(TAOS_STMT *stmt) {
...
@@ -2925,7 +2925,7 @@ int stmt_funcb2(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(18000 * sizeof(int));
int *lb = taosMemoryMalloc(18000 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 3000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 3000*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 18000);
char* is_null = taosMemoryMalloc(sizeof(char) * 18000);
char* no_null = taosMemoryMalloc(sizeof(char) * 18000);
char* no_null = taosMemoryMalloc(sizeof(char) * 18000);
...
@@ -3021,7 +3021,7 @@ int stmt_funcb2(TAOS_STMT *stmt) {
...
@@ -3021,7 +3021,7 @@ int stmt_funcb2(TAOS_STMT *stmt) {
v.ts[i] = tts + i;
v.ts[i] = tts + i;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -3052,7 +3052,7 @@ int stmt_funcb2(TAOS_STMT *stmt) {
...
@@ -3052,7 +3052,7 @@ int stmt_funcb2(TAOS_STMT *stmt) {
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -3083,7 +3083,7 @@ int stmt_funcb3(TAOS_STMT *stmt) {
...
@@ -3083,7 +3083,7 @@ int stmt_funcb3(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(60 * sizeof(int));
int *lb = taosMemoryMalloc(60 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 900000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 900000*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
...
@@ -3185,7 +3185,7 @@ int stmt_funcb3(TAOS_STMT *stmt) {
...
@@ -3185,7 +3185,7 @@ int stmt_funcb3(TAOS_STMT *stmt) {
}
}
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -3215,7 +3215,7 @@ int stmt_funcb3(TAOS_STMT *stmt) {
...
@@ -3215,7 +3215,7 @@ int stmt_funcb3(TAOS_STMT *stmt) {
++id;
++id;
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -3248,7 +3248,7 @@ int stmt_funcb4(TAOS_STMT *stmt) {
...
@@ -3248,7 +3248,7 @@ int stmt_funcb4(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(60 * sizeof(int));
int *lb = taosMemoryMalloc(60 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 900000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 900000*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
...
@@ -3344,7 +3344,7 @@ int stmt_funcb4(TAOS_STMT *stmt) {
...
@@ -3344,7 +3344,7 @@ int stmt_funcb4(TAOS_STMT *stmt) {
v.ts[i] = tts;
v.ts[i] = tts;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -3374,7 +3374,7 @@ int stmt_funcb4(TAOS_STMT *stmt) {
...
@@ -3374,7 +3374,7 @@ int stmt_funcb4(TAOS_STMT *stmt) {
++id;
++id;
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -3407,7 +3407,7 @@ int stmt_funcb5(TAOS_STMT *stmt) {
...
@@ -3407,7 +3407,7 @@ int stmt_funcb5(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(18000 * sizeof(int));
int *lb = taosMemoryMalloc(18000 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 3000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 3000*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 18000);
char* is_null = taosMemoryMalloc(sizeof(char) * 18000);
char* no_null = taosMemoryMalloc(sizeof(char) * 18000);
char* no_null = taosMemoryMalloc(sizeof(char) * 18000);
...
@@ -3503,7 +3503,7 @@ int stmt_funcb5(TAOS_STMT *stmt) {
...
@@ -3503,7 +3503,7 @@ int stmt_funcb5(TAOS_STMT *stmt) {
v.ts[i] = tts + i;
v.ts[i] = tts + i;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into m0 values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into m0 values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -3527,7 +3527,7 @@ int stmt_funcb5(TAOS_STMT *stmt) {
...
@@ -3527,7 +3527,7 @@ int stmt_funcb5(TAOS_STMT *stmt) {
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -3551,7 +3551,7 @@ int stmt_funcb_ssz1(TAOS_STMT *stmt) {
...
@@ -3551,7 +3551,7 @@ int stmt_funcb_ssz1(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(30000 * sizeof(int));
int *lb = taosMemoryMalloc(30000 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 3000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 3000*10);
char* no_null = taosMemoryMalloc(sizeof(int) * 200000);
char* no_null = taosMemoryMalloc(sizeof(int) * 200000);
for (int i = 0; i < 30000; ++i) {
for (int i = 0; i < 30000; ++i) {
...
@@ -3581,7 +3581,7 @@ int stmt_funcb_ssz1(TAOS_STMT *stmt) {
...
@@ -3581,7 +3581,7 @@ int stmt_funcb_ssz1(TAOS_STMT *stmt) {
v.ts[i] = tts + i;
v.ts[i] = tts + i;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?)";
char *sql = "insert into ? values(?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -3612,7 +3612,7 @@ int stmt_funcb_ssz1(TAOS_STMT *stmt) {
...
@@ -3612,7 +3612,7 @@ int stmt_funcb_ssz1(TAOS_STMT *stmt) {
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -3642,7 +3642,7 @@ int stmt_funcb_s1(TAOS_STMT *stmt) {
...
@@ -3642,7 +3642,7 @@ int stmt_funcb_s1(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(60 * sizeof(int));
int *lb = taosMemoryMalloc(60 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 900000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 900000*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
...
@@ -3738,7 +3738,7 @@ int stmt_funcb_s1(TAOS_STMT *stmt) {
...
@@ -3738,7 +3738,7 @@ int stmt_funcb_s1(TAOS_STMT *stmt) {
v.ts[i] = tts + i;
v.ts[i] = tts + i;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -3769,7 +3769,7 @@ int stmt_funcb_s1(TAOS_STMT *stmt) {
...
@@ -3769,7 +3769,7 @@ int stmt_funcb_s1(TAOS_STMT *stmt) {
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -3804,7 +3804,7 @@ int stmt_funcb_sc1(TAOS_STMT *stmt) {
...
@@ -3804,7 +3804,7 @@ int stmt_funcb_sc1(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(60 * sizeof(int));
int *lb = taosMemoryMalloc(60 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 900000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 900000*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
...
@@ -3900,7 +3900,7 @@ int stmt_funcb_sc1(TAOS_STMT *stmt) {
...
@@ -3900,7 +3900,7 @@ int stmt_funcb_sc1(TAOS_STMT *stmt) {
v.ts[i] = tts + i;
v.ts[i] = tts + i;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -3931,7 +3931,7 @@ int stmt_funcb_sc1(TAOS_STMT *stmt) {
...
@@ -3931,7 +3931,7 @@ int stmt_funcb_sc1(TAOS_STMT *stmt) {
}
}
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -3962,7 +3962,7 @@ int stmt_funcb_sc2(TAOS_STMT *stmt) {
...
@@ -3962,7 +3962,7 @@ int stmt_funcb_sc2(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(60 * sizeof(int));
int *lb = taosMemoryMalloc(60 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 900000*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 900000*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
...
@@ -4058,7 +4058,7 @@ int stmt_funcb_sc2(TAOS_STMT *stmt) {
...
@@ -4058,7 +4058,7 @@ int stmt_funcb_sc2(TAOS_STMT *stmt) {
v.ts[i] = tts + i;
v.ts[i] = tts + i;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -4091,7 +4091,7 @@ int stmt_funcb_sc2(TAOS_STMT *stmt) {
...
@@ -4091,7 +4091,7 @@ int stmt_funcb_sc2(TAOS_STMT *stmt) {
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
@@ -4122,7 +4122,7 @@ int stmt_funcb_sc3(TAOS_STMT *stmt) {
...
@@ -4122,7 +4122,7 @@ int stmt_funcb_sc3(TAOS_STMT *stmt) {
int *lb = taosMemoryMalloc(60 * sizeof(int));
int *lb = taosMemoryMalloc(60 * sizeof(int));
TAOS_
MULTI_BIND *params = taosMemoryCalloc(1, sizeof(TAOS_MULTI_BIND
) * 60*10);
TAOS_
BIND_v2 *params = taosMemoryCalloc(1, sizeof(TAOS_BIND_v2
) * 60*10);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* is_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
char* no_null = taosMemoryMalloc(sizeof(char) * 60);
...
@@ -4219,7 +4219,7 @@ int stmt_funcb_sc3(TAOS_STMT *stmt) {
...
@@ -4219,7 +4219,7 @@ int stmt_funcb_sc3(TAOS_STMT *stmt) {
v.ts[i] = tts + i;
v.ts[i] = tts + i;
}
}
unsigned long long starttime =
getCurrentTime
();
unsigned long long starttime =
taosGetTimestampUs
();
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
char *sql = "insert into ? values(?,?,?,?,?,?,?,?,?,?)";
int code = taos_stmt_prepare(stmt, sql, 0);
int code = taos_stmt_prepare(stmt, sql, 0);
...
@@ -4248,7 +4248,7 @@ int stmt_funcb_sc3(TAOS_STMT *stmt) {
...
@@ -4248,7 +4248,7 @@ int stmt_funcb_sc3(TAOS_STMT *stmt) {
exit(1);
exit(1);
}
}
unsigned long long endtime =
getCurrentTime
();
unsigned long long endtime =
taosGetTimestampUs
();
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
printf("insert total %d records, used %u seconds, avg:%u useconds\n", 3000*300*60, (endtime-starttime)/1000000UL, (endtime-starttime)/(3000*300*60));
taosMemoryFree(v.ts);
taosMemoryFree(v.ts);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录