Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
a5e0319a
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看板
提交
a5e0319a
编写于
8月 07, 2021
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mac compile error.
上级
f29b0c84
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
7 deletion
+14
-7
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+14
-7
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
a5e0319a
...
@@ -2890,7 +2890,8 @@ static int createSuperTable(
...
@@ -2890,7 +2890,8 @@ static int createSuperTable(
TAOS
*
taos
,
char
*
dbName
,
TAOS
*
taos
,
char
*
dbName
,
SSuperTable
*
superTbl
)
{
SSuperTable
*
superTbl
)
{
char
command
[
1024
]
=
"
\0
"
;
char
*
command
=
calloc
(
1
,
BUFFER_SIZE
);
assert
(
command
);
char
cols
[
COL_BUFFER_LEN
]
=
"
\0
"
;
char
cols
[
COL_BUFFER_LEN
]
=
"
\0
"
;
int
colIndex
;
int
colIndex
;
...
@@ -2901,6 +2902,7 @@ static int createSuperTable(
...
@@ -2901,6 +2902,7 @@ static int createSuperTable(
if
(
superTbl
->
columnCount
==
0
)
{
if
(
superTbl
->
columnCount
==
0
)
{
errorPrint
(
"%s() LN%d, super table column count is %d
\n
"
,
errorPrint
(
"%s() LN%d, super table column count is %d
\n
"
,
__func__
,
__LINE__
,
superTbl
->
columnCount
);
__func__
,
__LINE__
,
superTbl
->
columnCount
);
free
(
command
);
return
-
1
;
return
-
1
;
}
}
...
@@ -2963,6 +2965,7 @@ static int createSuperTable(
...
@@ -2963,6 +2965,7 @@ static int createSuperTable(
taos_close
(
taos
);
taos_close
(
taos
);
errorPrint
(
"%s() LN%d, config error data type : %s
\n
"
,
errorPrint
(
"%s() LN%d, config error data type : %s
\n
"
,
__func__
,
__LINE__
,
dataType
);
__func__
,
__LINE__
,
dataType
);
free
(
command
);
exit
(
-
1
);
exit
(
-
1
);
}
}
}
}
...
@@ -2975,6 +2978,7 @@ static int createSuperTable(
...
@@ -2975,6 +2978,7 @@ static int createSuperTable(
errorPrint
(
"%s() LN%d, Failed when calloc, size:%d"
,
errorPrint
(
"%s() LN%d, Failed when calloc, size:%d"
,
__func__
,
__LINE__
,
len
+
1
);
__func__
,
__LINE__
,
len
+
1
);
taos_close
(
taos
);
taos_close
(
taos
);
free
(
command
);
exit
(
-
1
);
exit
(
-
1
);
}
}
...
@@ -2985,6 +2989,7 @@ static int createSuperTable(
...
@@ -2985,6 +2989,7 @@ static int createSuperTable(
if
(
superTbl
->
tagCount
==
0
)
{
if
(
superTbl
->
tagCount
==
0
)
{
errorPrint
(
"%s() LN%d, super table tag count is %d
\n
"
,
errorPrint
(
"%s() LN%d, super table tag count is %d
\n
"
,
__func__
,
__LINE__
,
superTbl
->
tagCount
);
__func__
,
__LINE__
,
superTbl
->
tagCount
);
free
(
command
);
return
-
1
;
return
-
1
;
}
}
...
@@ -3050,6 +3055,7 @@ static int createSuperTable(
...
@@ -3050,6 +3055,7 @@ static int createSuperTable(
taos_close
(
taos
);
taos_close
(
taos
);
errorPrint
(
"%s() LN%d, config error tag type : %s
\n
"
,
errorPrint
(
"%s() LN%d, config error tag type : %s
\n
"
,
__func__
,
__LINE__
,
dataType
);
__func__
,
__LINE__
,
dataType
);
free
(
command
);
exit
(
-
1
);
exit
(
-
1
);
}
}
}
}
...
@@ -3059,15 +3065,18 @@ static int createSuperTable(
...
@@ -3059,15 +3065,18 @@ static int createSuperTable(
superTbl
->
lenOfTagOfOneRow
=
lenOfTagOfOneRow
;
superTbl
->
lenOfTagOfOneRow
=
lenOfTagOfOneRow
;
snprintf
(
command
,
1024
,
snprintf
(
command
,
BUFFER_SIZE
,
"create table if not exists %s.%s (ts timestamp%s) tags %s"
,
"create table if not exists %s.%s (ts timestamp%s) tags %s"
,
dbName
,
superTbl
->
sTblName
,
cols
,
tags
);
dbName
,
superTbl
->
sTblName
,
cols
,
tags
);
if
(
0
!=
queryDbExec
(
taos
,
command
,
NO_INSERT_TYPE
,
false
))
{
if
(
0
!=
queryDbExec
(
taos
,
command
,
NO_INSERT_TYPE
,
false
))
{
errorPrint
(
"create supertable %s failed!
\n\n
"
,
errorPrint
(
"create supertable %s failed!
\n\n
"
,
superTbl
->
sTblName
);
superTbl
->
sTblName
);
free
(
command
);
return
-
1
;
return
-
1
;
}
}
debugPrint
(
"create supertable %s success!
\n\n
"
,
superTbl
->
sTblName
);
debugPrint
(
"create supertable %s success!
\n\n
"
,
superTbl
->
sTblName
);
free
(
command
);
return
0
;
return
0
;
}
}
...
@@ -7679,7 +7688,7 @@ static void *superTableQuery(void *sarg) {
...
@@ -7679,7 +7688,7 @@ static void *superTableQuery(void *sarg) {
st
=
taosGetTimestampMs
();
st
=
taosGetTimestampMs
();
for
(
int
i
=
pThreadInfo
->
start_table_from
;
i
<=
pThreadInfo
->
end_table_to
;
i
++
)
{
for
(
int
i
=
pThreadInfo
->
start_table_from
;
i
<=
pThreadInfo
->
end_table_to
;
i
++
)
{
for
(
int
j
=
0
;
j
<
g_queryInfo
.
superQueryInfo
.
sqlCount
;
j
++
)
{
for
(
int
j
=
0
;
j
<
g_queryInfo
.
superQueryInfo
.
sqlCount
;
j
++
)
{
memset
(
sqlstr
,
0
,
sizeof
(
sqlstr
)
);
memset
(
sqlstr
,
0
,
BUFFER_SIZE
);
replaceChildTblName
(
g_queryInfo
.
superQueryInfo
.
sql
[
j
],
sqlstr
,
i
);
replaceChildTblName
(
g_queryInfo
.
superQueryInfo
.
sql
[
j
],
sqlstr
,
i
);
if
(
g_queryInfo
.
superQueryInfo
.
result
[
j
][
0
]
!=
'\0'
)
{
if
(
g_queryInfo
.
superQueryInfo
.
result
[
j
][
0
]
!=
'\0'
)
{
sprintf
(
pThreadInfo
->
filePath
,
"%s-%d"
,
sprintf
(
pThreadInfo
->
filePath
,
"%s-%d"
,
...
@@ -7994,7 +8003,7 @@ static void *superSubscribe(void *sarg) {
...
@@ -7994,7 +8003,7 @@ static void *superSubscribe(void *sarg) {
pThreadInfo
->
end_table_to
,
i
);
pThreadInfo
->
end_table_to
,
i
);
sprintf
(
topic
,
"taosdemo-subscribe-%"
PRIu64
"-%"
PRIu64
""
,
sprintf
(
topic
,
"taosdemo-subscribe-%"
PRIu64
"-%"
PRIu64
""
,
i
,
pThreadInfo
->
querySeq
);
i
,
pThreadInfo
->
querySeq
);
memset
(
subSqlStr
,
0
,
sizeof
(
subSqlStr
)
);
memset
(
subSqlStr
,
0
,
BUFFER_SIZE
);
replaceChildTblName
(
replaceChildTblName
(
g_queryInfo
.
superQueryInfo
.
sql
[
pThreadInfo
->
querySeq
],
g_queryInfo
.
superQueryInfo
.
sql
[
pThreadInfo
->
querySeq
],
subSqlStr
,
i
);
subSqlStr
,
i
);
...
@@ -8399,9 +8408,7 @@ static void setParaFromArg() {
...
@@ -8399,9 +8408,7 @@ static void setParaFromArg() {
tstrncpy
(
g_Dbs
.
user
,
g_args
.
user
,
MAX_USERNAME_SIZE
);
tstrncpy
(
g_Dbs
.
user
,
g_args
.
user
,
MAX_USERNAME_SIZE
);
}
}
if
(
g_args
.
password
)
{
tstrncpy
(
g_Dbs
.
password
,
g_args
.
password
,
MAX_PASSWORD_SIZE
);
tstrncpy
(
g_Dbs
.
password
,
g_args
.
password
,
MAX_PASSWORD_SIZE
);
}
if
(
g_args
.
port
)
{
if
(
g_args
.
port
)
{
g_Dbs
.
port
=
g_args
.
port
;
g_Dbs
.
port
=
g_args
.
port
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录