Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0eb724fc
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看板
提交
0eb724fc
编写于
11月 12, 2021
作者:
Z
zhaoyanggh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove assert
上级
9ef8f245
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
516 addition
and
1234 deletion
+516
-1234
src/kit/taosdemo/inc/demo.h
src/kit/taosdemo/inc/demo.h
+0
-7
src/kit/taosdemo/inc/demoData.h
src/kit/taosdemo/inc/demoData.h
+3
-5
src/kit/taosdemo/src/demoCommandOpt.c
src/kit/taosdemo/src/demoCommandOpt.c
+156
-148
src/kit/taosdemo/src/demoData.c
src/kit/taosdemo/src/demoData.c
+107
-25
src/kit/taosdemo/src/demoInsert.c
src/kit/taosdemo/src/demoInsert.c
+250
-1047
src/kit/taosdemo/src/demoMain.c
src/kit/taosdemo/src/demoMain.c
+0
-2
未找到文件。
src/kit/taosdemo/inc/demo.h
浏览文件 @
0eb724fc
...
@@ -383,10 +383,8 @@ typedef struct SSuperTable_S {
...
@@ -383,10 +383,8 @@ typedef struct SSuperTable_S {
uint32_t
tagSampleCount
;
uint32_t
tagSampleCount
;
uint32_t
tagUsePos
;
uint32_t
tagUsePos
;
#if STMT_BIND_PARAM_BATCH == 1
// bind param batch
// bind param batch
char
*
sampleBindBatchArray
;
char
*
sampleBindBatchArray
;
#endif
// statistics
// statistics
uint64_t
totalInsertRows
;
uint64_t
totalInsertRows
;
uint64_t
totalAffectedRows
;
uint64_t
totalAffectedRows
;
...
@@ -525,13 +523,9 @@ typedef struct SThreadInfo_S {
...
@@ -525,13 +523,9 @@ typedef struct SThreadInfo_S {
TAOS_STMT
*
stmt
;
TAOS_STMT
*
stmt
;
int64_t
*
bind_ts
;
int64_t
*
bind_ts
;
#if STMT_BIND_PARAM_BATCH == 1
int64_t
*
bind_ts_array
;
int64_t
*
bind_ts_array
;
char
*
bindParams
;
char
*
bindParams
;
char
*
is_null
;
char
*
is_null
;
#else
char
*
sampleBindArray
;
#endif
int
threadID
;
int
threadID
;
char
db_name
[
TSDB_DB_NAME_LEN
];
char
db_name
[
TSDB_DB_NAME_LEN
];
...
@@ -579,7 +573,6 @@ typedef struct SThreadInfo_S {
...
@@ -579,7 +573,6 @@ typedef struct SThreadInfo_S {
}
threadInfo
;
}
threadInfo
;
/* ************ Global variables ************ */
/* ************ Global variables ************ */
extern
char
*
g_dupstr
;
extern
char
*
g_aggreFuncDemo
[];
extern
char
*
g_aggreFuncDemo
[];
extern
char
*
g_aggreFunc
[];
extern
char
*
g_aggreFunc
[];
extern
SArguments
g_args
;
extern
SArguments
g_args
;
...
...
src/kit/taosdemo/inc/demoData.h
浏览文件 @
0eb724fc
...
@@ -18,10 +18,8 @@
...
@@ -18,10 +18,8 @@
#include "demo.h"
#include "demo.h"
/***** Global variables ******/
/***** Global variables ******/
extern
char
*
g_sampleDataBuf
;
extern
char
*
g_sampleDataBuf
;
#if STMT_BIND_PARAM_BATCH == 1
extern
char
*
g_sampleBindBatchArray
;
extern
char
*
g_sampleBindBatchArray
;
#endif
extern
int32_t
*
g_randint
;
extern
int32_t
*
g_randint
;
extern
uint32_t
*
g_randuint
;
extern
uint32_t
*
g_randuint
;
extern
int64_t
*
g_randbigint
;
extern
int64_t
*
g_randbigint
;
...
@@ -43,7 +41,7 @@ extern char * g_rand_current_buff;
...
@@ -43,7 +41,7 @@ extern char * g_rand_current_buff;
extern
char
*
g_rand_phase_buff
;
extern
char
*
g_rand_phase_buff
;
extern
char
*
g_randdouble_buff
;
extern
char
*
g_randdouble_buff
;
/***** Declare functions *****/
/***** Declare functions *****/
void
init_rand_data
();
int
init_rand_data
();
char
*
rand_bool_str
();
char
*
rand_bool_str
();
int32_t
rand_bool
();
int32_t
rand_bool
();
char
*
rand_tinyint_str
();
char
*
rand_tinyint_str
();
...
...
src/kit/taosdemo/src/demoCommandOpt.c
浏览文件 @
0eb724fc
此差异已折叠。
点击以展开。
src/kit/taosdemo/src/demoData.c
浏览文件 @
0eb724fc
...
@@ -16,10 +16,8 @@
...
@@ -16,10 +16,8 @@
#include "demoData.h"
#include "demoData.h"
#include "demo.h"
#include "demo.h"
char
*
g_sampleDataBuf
=
NULL
;
char
*
g_sampleDataBuf
=
NULL
;
#if STMT_BIND_PARAM_BATCH == 1
char
*
g_sampleBindBatchArray
=
NULL
;
char
*
g_sampleBindBatchArray
=
NULL
;
#endif
int32_t
*
g_randint
=
NULL
;
int32_t
*
g_randint
=
NULL
;
uint32_t
*
g_randuint
=
NULL
;
uint32_t
*
g_randuint
=
NULL
;
int64_t
*
g_randbigint
=
NULL
;
int64_t
*
g_randbigint
=
NULL
;
...
@@ -267,47 +265,128 @@ double rand_double() {
...
@@ -267,47 +265,128 @@ double rand_double() {
return
g_randdouble
[
cursor
];
return
g_randdouble
[
cursor
];
}
}
void
init_rand_data
()
{
int
init_rand_data
()
{
int32_t
code
=
-
1
;
g_randint_buff
=
calloc
(
1
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randint_buff
=
calloc
(
1
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randint_buff
);
if
(
NULL
==
g_randint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_rand_voltage_buff
=
calloc
(
1
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_rand_voltage_buff
=
calloc
(
1
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_rand_voltage_buff
);
if
(
NULL
==
g_randint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randbigint_buff
=
calloc
(
1
,
BIGINT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randbigint_buff
=
calloc
(
1
,
BIGINT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randbigint_buff
);
if
(
NULL
==
g_randbigint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
BIGINT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randsmallint_buff
=
calloc
(
1
,
SMALLINT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randsmallint_buff
=
calloc
(
1
,
SMALLINT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randsmallint_buff
);
if
(
NULL
==
g_randsmallint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
SMALLINT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randtinyint_buff
=
calloc
(
1
,
TINYINT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randtinyint_buff
=
calloc
(
1
,
TINYINT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randtinyint_buff
);
if
(
NULL
==
g_randtinyint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
TINYINT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randbool_buff
=
calloc
(
1
,
BOOL_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randbool_buff
=
calloc
(
1
,
BOOL_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randbool_buff
);
if
(
NULL
==
g_randbool_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
BOOL_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randfloat_buff
=
calloc
(
1
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randfloat_buff
=
calloc
(
1
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randfloat_buff
);
if
(
NULL
==
g_randfloat_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_rand_current_buff
=
calloc
(
1
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_rand_current_buff
=
calloc
(
1
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_rand_current_buff
);
if
(
NULL
==
g_rand_current_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_rand_phase_buff
=
calloc
(
1
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_rand_phase_buff
=
calloc
(
1
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_rand_phase_buff
);
if
(
NULL
==
g_rand_phase_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
FLOAT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randdouble_buff
=
calloc
(
1
,
DOUBLE_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randdouble_buff
=
calloc
(
1
,
DOUBLE_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randdouble_buff
);
if
(
NULL
==
g_randdouble_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
DOUBLE_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randuint_buff
=
calloc
(
1
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randuint_buff
=
calloc
(
1
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randuint_buff
);
if
(
NULL
==
g_randuint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
INT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randutinyint_buff
=
calloc
(
1
,
TINYINT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randutinyint_buff
=
calloc
(
1
,
TINYINT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randutinyint_buff
);
if
(
NULL
==
g_randutinyint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
TINYINT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randusmallint_buff
=
calloc
(
1
,
SMALLINT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randusmallint_buff
=
calloc
(
1
,
SMALLINT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randusmallint_buff
);
if
(
NULL
==
g_randusmallint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
SMALLINT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randubigint_buff
=
calloc
(
1
,
BIGINT_BUFF_LEN
*
g_args
.
prepared_rand
);
g_randubigint_buff
=
calloc
(
1
,
BIGINT_BUFF_LEN
*
g_args
.
prepared_rand
);
assert
(
g_randubigint_buff
);
if
(
NULL
==
g_randubigint_buff
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
BIGINT_BUFF_LEN
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randint
=
calloc
(
1
,
sizeof
(
int32_t
)
*
g_args
.
prepared_rand
);
g_randint
=
calloc
(
1
,
sizeof
(
int32_t
)
*
g_args
.
prepared_rand
);
assert
(
g_randint
);
if
(
NULL
==
g_randint
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
sizeof
(
int32_t
)
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randuint
=
calloc
(
1
,
sizeof
(
uint32_t
)
*
g_args
.
prepared_rand
);
g_randuint
=
calloc
(
1
,
sizeof
(
uint32_t
)
*
g_args
.
prepared_rand
);
assert
(
g_randuint
);
if
(
NULL
==
g_randuint
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
sizeof
(
uint32_t
)
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randbigint
=
calloc
(
1
,
sizeof
(
int64_t
)
*
g_args
.
prepared_rand
);
g_randbigint
=
calloc
(
1
,
sizeof
(
int64_t
)
*
g_args
.
prepared_rand
);
assert
(
g_randbigint
);
if
(
NULL
==
g_randbigint
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
sizeof
(
int64_t
)
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randubigint
=
calloc
(
1
,
sizeof
(
uint64_t
)
*
g_args
.
prepared_rand
);
g_randubigint
=
calloc
(
1
,
sizeof
(
uint64_t
)
*
g_args
.
prepared_rand
);
assert
(
g_randubigint
);
if
(
NULL
==
g_randubigint
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
sizeof
(
uint64_t
)
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randfloat
=
calloc
(
1
,
sizeof
(
float
)
*
g_args
.
prepared_rand
);
g_randfloat
=
calloc
(
1
,
sizeof
(
float
)
*
g_args
.
prepared_rand
);
assert
(
g_randfloat
);
if
(
NULL
==
g_randfloat
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
sizeof
(
float
)
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
g_randdouble
=
calloc
(
1
,
sizeof
(
double
)
*
g_args
.
prepared_rand
);
g_randdouble
=
calloc
(
1
,
sizeof
(
double
)
*
g_args
.
prepared_rand
);
assert
(
g_randdouble
);
if
(
NULL
==
g_randdouble
)
{
errorPrint
(
"failed to allocate %"
PRId64
" size memory
\n
"
,
sizeof
(
double
)
*
g_args
.
prepared_rand
);
goto
end_init_rand_data
;
}
for
(
int
i
=
0
;
i
<
g_args
.
prepared_rand
;
i
++
)
{
for
(
int
i
=
0
;
i
<
g_args
.
prepared_rand
;
i
++
)
{
g_randint
[
i
]
=
(
int
)(
taosRandom
()
%
RAND_MAX
-
(
RAND_MAX
>>
1
));
g_randint
[
i
]
=
(
int
)(
taosRandom
()
%
RAND_MAX
-
(
RAND_MAX
>>
1
));
...
@@ -350,4 +429,7 @@ void init_rand_data() {
...
@@ -350,4 +429,7 @@ void init_rand_data() {
(
taosRandom
()
%
2
>
0
.
5
?
1
:
-
1
);
(
taosRandom
()
%
2
>
0
.
5
?
1
:
-
1
);
sprintf
(
g_randdouble_buff
+
i
*
DOUBLE_BUFF_LEN
,
"%f"
,
g_randdouble
[
i
]);
sprintf
(
g_randdouble_buff
+
i
*
DOUBLE_BUFF_LEN
,
"%f"
,
g_randdouble
[
i
]);
}
}
code
=
0
;
end_init_rand_data:
return
code
;
}
}
\ No newline at end of file
src/kit/taosdemo/src/demoInsert.c
浏览文件 @
0eb724fc
此差异已折叠。
点击以展开。
src/kit/taosdemo/src/demoMain.c
浏览文件 @
0eb724fc
...
@@ -95,8 +95,6 @@ int main(int argc, char *argv[]) {
...
@@ -95,8 +95,6 @@ int main(int argc, char *argv[]) {
}
else
{
}
else
{
testCmdLine
();
testCmdLine
();
}
}
if
(
g_dupstr
)
free
(
g_dupstr
);
}
}
postFreeResource
();
postFreeResource
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录