Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
d123d800
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d123d800
编写于
9月 22, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1415
上级
a1ce0a26
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
16 deletion
+42
-16
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+9
-2
tests/test/c/CMakeLists.txt
tests/test/c/CMakeLists.txt
+6
-6
tests/test/c/createNormalTable.c
tests/test/c/createNormalTable.c
+27
-8
未找到文件。
src/vnode/src/vnodeWrite.c
浏览文件 @
d123d800
...
...
@@ -130,8 +130,15 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
int
code
=
TSDB_CODE_SUCCESS
;
STableCfg
*
pCfg
=
tsdbCreateTableCfgFromMsg
((
SMDCreateTableMsg
*
)
pCont
);
if
(
pCfg
==
NULL
)
return
terrno
;
if
(
tsdbCreateTable
(
pVnode
->
tsdb
,
pCfg
)
<
0
)
code
=
terrno
;
if
(
pCfg
==
NULL
)
{
ASSERT
(
terrno
!=
0
);
return
terrno
;
}
if
(
tsdbCreateTable
(
pVnode
->
tsdb
,
pCfg
)
<
0
)
{
code
=
terrno
;
ASSERT
(
code
!=
0
);
}
tsdbClearTableCfg
(
pCfg
);
return
code
;
...
...
tests/test/c/CMakeLists.txt
浏览文件 @
d123d800
...
...
@@ -31,16 +31,16 @@ IF (TD_LINUX)
#add_executable(createTablePerformance createTablePerformance.c)
#target_link_libraries(createTablePerformance taos_static tutil common pthread)
#
add_executable(createNormalTable createNormalTable.c)
#
target_link_libraries(createNormalTable taos_static tutil common pthread)
add_executable
(
createNormalTable createNormalTable.c
)
target_link_libraries
(
createNormalTable taos_static tutil common pthread
)
#add_executable(queryPerformance queryPerformance.c)
#target_link_libraries(queryPerformance taos_static tutil common pthread)
add_executable
(
httpTest httpTest.c
)
target_link_libraries
(
httpTest taos_static tutil common pthread mnode monitor http tsdb twal vnode cJson lz4
)
#
add_executable(httpTest httpTest.c)
#
target_link_libraries(httpTest taos_static tutil common pthread mnode monitor http tsdb twal vnode cJson lz4)
add_executable
(
cacheTest cacheTest.c
)
target_link_libraries
(
cacheTest taos_static tutil common pthread mnode monitor http tsdb twal vnode cJson lz4
)
#
add_executable(cacheTest cacheTest.c)
#
target_link_libraries(cacheTest taos_static tutil common pthread mnode monitor http tsdb twal vnode cJson lz4)
ENDIF
()
tests/test/c/createNormalTable.c
浏览文件 @
d123d800
...
...
@@ -50,7 +50,9 @@ void createDbAndSTable();
int
main
(
int
argc
,
char
*
argv
[])
{
shellParseArgument
(
argc
,
argv
);
taos_init
();
createDbAndSTable
();
if
(
replica
!=
0
)
{
createDbAndSTable
();
}
pPrint
(
"%d threads are spawned to create table"
,
numOfThreads
);
...
...
@@ -134,14 +136,31 @@ void *threadFunc(void *param) {
int64_t
startMs
=
taosGetTimestampMs
();
for
(
int32_t
t
=
pInfo
->
tableBeginIndex
;
t
<
pInfo
->
tableEndIndex
;
++
t
)
{
sprintf
(
qstr
,
"create table %s%d (ts timestamp, i int)"
,
stableName
,
t
);
TAOS_RES
*
pSql
=
taos_query
(
con
,
qstr
);
code
=
taos_errno
(
pSql
);
if
(
code
!=
0
)
{
pError
(
"failed to create table %s%d, reason:%s"
,
stableName
,
t
,
tstrerror
(
code
));
if
(
replica
!=
0
)
{
for
(
int32_t
t
=
pInfo
->
tableBeginIndex
;
t
<
pInfo
->
tableEndIndex
;
++
t
)
{
sprintf
(
qstr
,
"create table %s%d (ts timestamp, i int)"
,
stableName
,
t
);
TAOS_RES
*
pSql
=
taos_query
(
con
,
qstr
);
code
=
taos_errno
(
pSql
);
if
(
code
!=
0
)
{
pError
(
"failed to create table %s%d, reason:%s"
,
stableName
,
t
,
tstrerror
(
code
));
}
taos_free_result
(
pSql
);
}
}
else
{
for
(
int32_t
t
=
pInfo
->
tableBeginIndex
;
t
<
pInfo
->
tableEndIndex
;
++
t
)
{
sprintf
(
qstr
,
"insert into %s%d values(now, 1)"
,
stableName
,
t
);
TAOS_RES
*
pSql
=
taos_query
(
con
,
qstr
);
code
=
taos_errno
(
pSql
);
if
(
code
!=
0
)
{
if
(
code
!=
TSDB_CODE_MND_INVALID_TABLE_NAME
)
{
pError
(
"failed to create table %s%d, reason:%s"
,
stableName
,
t
,
tstrerror
(
code
));
}
if
(
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
)
{
exit
(
0
);
}
}
taos_free_result
(
pSql
);
}
taos_free_result
(
pSql
);
}
float
createTableSpeed
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录