Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d147cf29
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看板
提交
d147cf29
编写于
11月 12, 2021
作者:
Z
zhaoyanggh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix return
上级
2549b72b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
62 deletion
+21
-62
src/kit/taosdemo/inc/demo.h
src/kit/taosdemo/inc/demo.h
+6
-5
src/kit/taosdemo/src/demoInsert.c
src/kit/taosdemo/src/demoInsert.c
+9
-29
src/kit/taosdemo/src/demoJsonOpt.c
src/kit/taosdemo/src/demoJsonOpt.c
+3
-15
src/kit/taosdemo/src/demoMain.c
src/kit/taosdemo/src/demoMain.c
+3
-13
未找到文件。
src/kit/taosdemo/inc/demo.h
浏览文件 @
d147cf29
...
...
@@ -183,11 +183,12 @@ extern char configDir[];
fprintf(stderr, "PERF: " fmt, __VA_ARGS__); \
} while (0)
#define errorPrint(fmt, ...) \
do { \
fprintf(stderr, " \033[31m"); \
fprintf(stderr, "ERROR: " fmt, __VA_ARGS__); \
fprintf(stderr, " \033[0m"); \
#define errorPrint(fmt, ...) \
do { \
fprintf(stderr, "\033[31m"); \
fprintf(stderr, "%s(%d) ", __FILE__, __LINE__); \
fprintf(stderr, "ERROR: " fmt, __VA_ARGS__); \
fprintf(stderr, "\033[0m"); \
} while (0)
enum
TEST_MODE
{
...
...
src/kit/taosdemo/src/demoInsert.c
浏览文件 @
d147cf29
...
...
@@ -5534,26 +5534,17 @@ int insertTestProcess() {
// create database and super tables
char
*
cmdBuffer
=
calloc
(
1
,
BUFFER_SIZE
);
assert
(
cmdBuffer
);
code
=
createDatabasesAndStables
(
cmdBuffer
);
if
(
code
)
{
errorPrint
(
"%s() LN%d, createDatabasesAndStables() failed
\n
"
,
__func__
,
__LINE__
);
if
(
createDatabasesAndStables
(
cmdBuffer
))
{
goto
end_insert_process
;
}
// pretreatment
code
=
prepareSampleData
();
if
(
code
)
{
errorPrint
(
"%s() LN%d, prepareSampleData() failed
\n
"
,
__func__
,
__LINE__
);
if
(
prepareSampleData
())
{
goto
end_insert_process
;
}
if
(
g_args
.
iface
!=
SML_IFACE
&&
g_totalChildTables
>
0
)
{
code
=
createChildTables
();
if
(
code
)
{
errorPrint
(
"%s() LN%d, createChildTables() failed
\n
"
,
__func__
,
__LINE__
);
if
(
createChildTables
())
{
goto
end_insert_process
;
}
}
...
...
@@ -5566,14 +5557,9 @@ int insertTestProcess() {
SSuperTable
*
stbInfo
=
&
g_Dbs
.
db
[
i
].
superTbls
[
j
];
if
(
stbInfo
&&
(
stbInfo
->
insertRows
>
0
))
{
code
=
startMultiThreadInsertData
(
g_Dbs
.
threadCount
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
stbInfo
);
if
(
code
)
{
errorPrint
(
"%s() LN%d, startMultiThreadInsertData failed "
"for db %d stb %"
PRIu64
"
\n
"
,
__func__
,
__LINE__
,
i
,
j
);
if
(
startMultiThreadInsertData
(
g_Dbs
.
threadCount
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
stbInfo
))
{
goto
end_insert_process
;
}
}
...
...
@@ -5585,12 +5571,9 @@ int insertTestProcess() {
errorPrint
(
"%s
\n
"
,
"Schemaless insertion must include stable"
);
goto
end_insert_process
;
}
else
{
code
=
startMultiThreadInsertData
(
g_Dbs
.
threadCount
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
NULL
);
if
(
code
)
{
errorPrint
(
"%s() LN%d, startMultiThreadInsertData failed
\n
"
,
__func__
,
__LINE__
);
if
(
startMultiThreadInsertData
(
g_Dbs
.
threadCount
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
dbCfg
.
precision
,
NULL
))
{
goto
end_insert_process
;
}
}
...
...
@@ -5598,8 +5581,5 @@ int insertTestProcess() {
}
end_insert_process:
tmfree
(
cmdBuffer
);
if
(
g_fpOfInsertResult
)
{
fclose
(
g_fpOfInsertResult
);
}
return
code
;
}
\ No newline at end of file
src/kit/taosdemo/src/demoJsonOpt.c
浏览文件 @
d147cf29
...
...
@@ -674,7 +674,7 @@ int getMetaFromInsertJsonFile(cJSON *root) {
}
else
if
(
!
quorum
)
{
g_Dbs
.
db
[
i
].
dbCfg
.
quorum
=
1
;
}
else
{
printf
(
"failed to read json, quorum input mistake"
);
errorPrint
(
"%s"
,
"failed to read json, quorum input mistake"
);
goto
PARSE_OVER
;
}
...
...
@@ -1144,9 +1144,8 @@ int getMetaFromInsertJsonFile(cJSON *root) {
goto
PARSE_OVER
;
}
int
retVal
=
getColumnAndTagTypeFromInsertJsonFile
(
stbInfo
,
&
g_Dbs
.
db
[
i
].
superTbls
[
j
]);
if
(
false
==
retVal
)
{
if
(
getColumnAndTagTypeFromInsertJsonFile
(
stbInfo
,
&
g_Dbs
.
db
[
i
].
superTbls
[
j
]))
{
goto
PARSE_OVER
;
}
}
...
...
@@ -1705,21 +1704,10 @@ int getInfoFromJsonFile(char *file) {
memset
(
&
g_Dbs
,
0
,
sizeof
(
SDbs
));
g_Dbs
.
use_metric
=
g_args
.
use_metric
;
code
=
getMetaFromInsertJsonFile
(
root
);
if
(
code
)
{
errorPrint
(
"%s() LN%d, getMetaFromInsertJsonFile() failed
\n
"
,
__func__
,
__LINE__
);
goto
PARSE_OVER
;
}
}
else
if
((
QUERY_TEST
==
g_args
.
test_mode
)
||
(
SUBSCRIBE_TEST
==
g_args
.
test_mode
))
{
memset
(
&
g_queryInfo
,
0
,
sizeof
(
SQueryMetaInfo
));
code
=
getMetaFromQueryJsonFile
(
root
);
if
(
code
)
{
errorPrint
(
"%s() LN%d, getMetaFromQueryJsonFile() failed
\n
"
,
__func__
,
__LINE__
);
goto
PARSE_OVER
;
}
}
else
{
errorPrint
(
"%s"
,
"input json file type error! please input correct file "
...
...
src/kit/taosdemo/src/demoMain.c
浏览文件 @
d147cf29
...
...
@@ -66,26 +66,17 @@ SArguments g_args = {
};
int
main
(
int
argc
,
char
*
argv
[])
{
int32_t
code
=
parse_args
(
argc
,
argv
,
&
g_args
);
if
(
code
)
{
errorPrint
(
"%s() LN%d, parse_args() failed
\n
"
,
__func__
,
__LINE__
);
if
(
parse_args
(
argc
,
argv
,
&
g_args
))
{
exit
(
EXIT_FAILURE
);
}
debugPrint
(
"meta file: %s
\n
"
,
g_args
.
metaFile
);
if
(
g_args
.
metaFile
)
{
g_totalChildTables
=
0
;
code
=
getInfoFromJsonFile
(
g_args
.
metaFile
);
if
(
code
)
{
errorPrint
(
"%s() LN%d, getInfoFromJsonFile(%s) failed
\n
"
,
__func__
,
__LINE__
,
g_args
.
metaFile
);
if
(
getInfoFromJsonFile
(
g_args
.
metaFile
))
{
exit
(
EXIT_FAILURE
);
}
code
=
testMetaFile
();
if
(
code
)
{
errorPrint
(
"%s() LN%d, testMetaFile() failed
\n
"
,
__func__
,
__LINE__
);
if
(
testMetaFile
())
{
exit
(
EXIT_FAILURE
);
}
}
else
{
...
...
@@ -101,7 +92,6 @@ int main(int argc, char *argv[]) {
g_Dbs
.
db
[
0
].
dbName
,
g_Dbs
.
port
);
querySqlFile
(
qtaos
,
g_args
.
sqlFile
);
taos_close
(
qtaos
);
}
else
{
testCmdLine
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录