Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
adminstrot
TDengine
提交
4a064830
TDengine
项目概览
adminstrot
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4a064830
编写于
3月 08, 2021
作者:
S
Shuduo Sang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-3202] <fix>: fix incorrect number of table issue.
上级
1d9d7569
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
12 deletion
+14
-12
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+14
-12
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
4a064830
...
...
@@ -998,7 +998,7 @@ static int printfInsertMeta() {
printf
(
"database count:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
dbCount
);
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
printf
(
"database[
\033
[33m%d
\033
[0m]:
\n
"
,
i
);
printf
(
" database
name:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
dbName
);
printf
(
" database
[%d] name:
\033
[33m%s
\033
[0m
\n
"
,
i
,
g_Dbs
.
db
[
i
].
dbName
);
if
(
0
==
g_Dbs
.
db
[
i
].
drop
)
{
printf
(
" drop:
\033
[33mno
\033
[0m
\n
"
);
}
else
{
...
...
@@ -1147,7 +1147,7 @@ static void printfInsertMetaToFile(FILE* fp) {
fprintf
(
fp
,
"database count: %d
\n
"
,
g_Dbs
.
dbCount
);
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
fprintf
(
fp
,
"database[%d]:
\n
"
,
i
);
fprintf
(
fp
,
" database
name: %s
\n
"
,
g_Dbs
.
db
[
i
].
dbName
);
fprintf
(
fp
,
" database
[%d] name: %s
\n
"
,
i
,
g_Dbs
.
db
[
i
].
dbName
);
if
(
0
==
g_Dbs
.
db
[
i
].
drop
)
{
fprintf
(
fp
,
" drop: no
\n
"
);
}
else
{
...
...
@@ -2140,7 +2140,7 @@ static int createDatabases() {
}
printf
(
"
\n
create database %s success!
\n\n
"
,
g_Dbs
.
db
[
i
].
dbName
);
debugPrint
(
"DEBUG %s() %d count:%d
\n
"
,
__func__
,
__LINE__
,
g_Dbs
.
db
[
i
].
superTblCount
);
debugPrint
(
"DEBUG %s() %d
supertbl
count:%d
\n
"
,
__func__
,
__LINE__
,
g_Dbs
.
db
[
i
].
superTblCount
);
for
(
int
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
// describe super table, if exists
sprintf
(
command
,
"describe %s.%s;"
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sTblName
);
...
...
@@ -2285,6 +2285,7 @@ int startMultiThreadCreateChildTable(
t_info
->
threadID
=
i
;
tstrncpy
(
t_info
->
db_name
,
db_name
,
MAX_DB_NAME_SIZE
);
t_info
->
superTblInfo
=
superTblInfo
;
debugPrint
(
"DEBUG %s() %d db_name: %s
\n
"
,
__func__
,
__LINE__
,
db_name
);
t_info
->
taos
=
taos_connect
(
g_Dbs
.
host
,
g_Dbs
.
user
,
...
...
@@ -2347,25 +2348,26 @@ static void createChildTables() {
}
else
{
// normal table
len
=
snprintf
(
tblColsBuf
,
MAX_SQL_SIZE
,
"(TS TIMESTAMP"
);
int
i
=
0
;
while
(
g_args
.
datatype
[
i
])
{
if
((
strncasecmp
(
g_args
.
datatype
[
i
],
"BINARY"
,
strlen
(
"BINARY"
))
==
0
)
||
(
strncasecmp
(
g_args
.
datatype
[
i
],
"NCHAR"
,
strlen
(
"NCHAR"
))
==
0
))
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s(60)"
,
i
,
g_args
.
datatype
[
i
]);
int
j
=
0
;
while
(
g_args
.
datatype
[
j
])
{
if
((
strncasecmp
(
g_args
.
datatype
[
j
],
"BINARY"
,
strlen
(
"BINARY"
))
==
0
)
||
(
strncasecmp
(
g_args
.
datatype
[
j
],
"NCHAR"
,
strlen
(
"NCHAR"
))
==
0
))
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s(60)"
,
j
,
g_args
.
datatype
[
j
]);
}
else
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s"
,
i
,
g_args
.
datatype
[
i
]);
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s"
,
j
,
g_args
.
datatype
[
j
]);
}
len
=
strlen
(
tblColsBuf
);
j
++
;
}
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
-
len
,
")"
);
debugPrint
(
"DEBUG - %s() LN%d: %s
\n
"
,
__func__
,
__LINE__
,
tblColsBuf
);
debugPrint
(
"DEBUG - %s() LN%d:
dbName: %s num of tb: %d schema:
%s
\n
"
,
__func__
,
__LINE__
,
g_Dbs
.
db
[
i
].
dbName
,
g_args
.
num_of_tables
,
tblColsBuf
);
startMultiThreadCreateChildTable
(
tblColsBuf
,
g_Dbs
.
threadCountByCreateTbl
,
g_args
.
num_of_
DPT
,
g_args
.
num_of_
tables
,
g_Dbs
.
db
[
i
].
dbName
,
NULL
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录