Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
06ff862b
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看板
未验证
提交
06ff862b
编写于
6月 09, 2021
作者:
H
haojun Liao
提交者:
GitHub
6月 09, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6418 from jiaoqiyuan/develop
[TD-6240] <fix>: init an array before used by `taos_fetch_row`
上级
81e3ec8d
e42a8bc6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
8 addition
and
11 deletion
+8
-11
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+1
-1
tests/examples/c/apitest.c
tests/examples/c/apitest.c
+4
-6
tests/examples/c/demo.c
tests/examples/c/demo.c
+1
-1
tests/examples/c/prepare.c
tests/examples/c/prepare.c
+1
-1
tests/examples/c/subscribe.c
tests/examples/c/subscribe.c
+1
-2
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
06ff862b
...
@@ -1213,7 +1213,6 @@ static void fetchResult(TAOS_RES *res, threadInfo* pThreadInfo) {
...
@@ -1213,7 +1213,6 @@ static void fetchResult(TAOS_RES *res, threadInfo* pThreadInfo) {
}
}
int
totalLen
=
0
;
int
totalLen
=
0
;
char
temp
[
16000
];
// fetch the records row by row
// fetch the records row by row
while
((
row
=
taos_fetch_row
(
res
)))
{
while
((
row
=
taos_fetch_row
(
res
)))
{
...
@@ -1224,6 +1223,7 @@ static void fetchResult(TAOS_RES *res, threadInfo* pThreadInfo) {
...
@@ -1224,6 +1223,7 @@ static void fetchResult(TAOS_RES *res, threadInfo* pThreadInfo) {
memset
(
databuf
,
0
,
100
*
1024
*
1024
);
memset
(
databuf
,
0
,
100
*
1024
*
1024
);
}
}
num_rows
++
;
num_rows
++
;
char
temp
[
16000
]
=
{
0
};
int
len
=
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
int
len
=
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
len
+=
sprintf
(
temp
+
len
,
"
\n
"
);
len
+=
sprintf
(
temp
+
len
,
"
\n
"
);
//printf("query result:%s\n", temp);
//printf("query result:%s\n", temp);
...
...
tests/examples/c/apitest.c
浏览文件 @
06ff862b
...
@@ -86,7 +86,7 @@ static int print_result(TAOS_RES* res, int blockFetch) {
...
@@ -86,7 +86,7 @@ static int print_result(TAOS_RES* res, int blockFetch) {
}
}
}
else
{
}
else
{
while
((
row
=
taos_fetch_row
(
res
)))
{
while
((
row
=
taos_fetch_row
(
res
)))
{
char
temp
[
256
];
char
temp
[
256
]
=
{
0
}
;
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
puts
(
temp
);
puts
(
temp
);
nRows
++
;
nRows
++
;
...
@@ -391,10 +391,10 @@ void verify_prepare(TAOS* taos) {
...
@@ -391,10 +391,10 @@ void verify_prepare(TAOS* taos) {
int
rows
=
0
;
int
rows
=
0
;
int
num_fields
=
taos_num_fields
(
result
);
int
num_fields
=
taos_num_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
char
temp
[
256
];
// fetch the records row by row
// fetch the records row by row
while
((
row
=
taos_fetch_row
(
result
)))
{
while
((
row
=
taos_fetch_row
(
result
)))
{
char
temp
[
256
]
=
{
0
};
rows
++
;
rows
++
;
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
printf
(
"%s
\n
"
,
temp
);
printf
(
"%s
\n
"
,
temp
);
...
@@ -614,10 +614,10 @@ void verify_prepare2(TAOS* taos) {
...
@@ -614,10 +614,10 @@ void verify_prepare2(TAOS* taos) {
int
rows
=
0
;
int
rows
=
0
;
int
num_fields
=
taos_num_fields
(
result
);
int
num_fields
=
taos_num_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
char
temp
[
256
];
// fetch the records row by row
// fetch the records row by row
while
((
row
=
taos_fetch_row
(
result
)))
{
while
((
row
=
taos_fetch_row
(
result
)))
{
char
temp
[
256
]
=
{
0
};
rows
++
;
rows
++
;
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
printf
(
"%s
\n
"
,
temp
);
printf
(
"%s
\n
"
,
temp
);
...
@@ -866,12 +866,10 @@ void verify_prepare3(TAOS* taos) {
...
@@ -866,12 +866,10 @@ void verify_prepare3(TAOS* taos) {
int
rows
=
0
;
int
rows
=
0
;
int
num_fields
=
taos_num_fields
(
result
);
int
num_fields
=
taos_num_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
char
temp
[
256
]
=
{
0
};
// fetch the records row by row
// fetch the records row by row
while
((
row
=
taos_fetch_row
(
result
)))
{
while
((
row
=
taos_fetch_row
(
result
)))
{
memset
(
temp
,
0
,
sizeof
(
temp
)
/
sizeof
(
temp
[
0
]));
char
temp
[
256
]
=
{
0
};
rows
++
;
rows
++
;
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
printf
(
"%s
\n
"
,
temp
);
printf
(
"%s
\n
"
,
temp
);
...
...
tests/examples/c/demo.c
浏览文件 @
06ff862b
...
@@ -116,12 +116,12 @@ void Test(TAOS *taos, char *qstr, int index) {
...
@@ -116,12 +116,12 @@ void Test(TAOS *taos, char *qstr, int index) {
int
rows
=
0
;
int
rows
=
0
;
int
num_fields
=
taos_field_count
(
result
);
int
num_fields
=
taos_field_count
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
char
temp
[
1024
];
printf
(
"num_fields = %d
\n
"
,
num_fields
);
printf
(
"num_fields = %d
\n
"
,
num_fields
);
printf
(
"select * from table, result:
\n
"
);
printf
(
"select * from table, result:
\n
"
);
// fetch the records row by row
// fetch the records row by row
while
((
row
=
taos_fetch_row
(
result
)))
{
while
((
row
=
taos_fetch_row
(
result
)))
{
char
temp
[
1024
]
=
{
0
};
rows
++
;
rows
++
;
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
printf
(
"%s
\n
"
,
temp
);
printf
(
"%s
\n
"
,
temp
);
...
...
tests/examples/c/prepare.c
浏览文件 @
06ff862b
...
@@ -184,10 +184,10 @@ int main(int argc, char *argv[])
...
@@ -184,10 +184,10 @@ int main(int argc, char *argv[])
int
rows
=
0
;
int
rows
=
0
;
int
num_fields
=
taos_num_fields
(
result
);
int
num_fields
=
taos_num_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
result
);
char
temp
[
256
];
// fetch the records row by row
// fetch the records row by row
while
((
row
=
taos_fetch_row
(
result
)))
{
while
((
row
=
taos_fetch_row
(
result
)))
{
char
temp
[
256
]
=
{
0
};
rows
++
;
rows
++
;
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
taos_print_row
(
temp
,
row
,
fields
,
num_fields
);
printf
(
"%s
\n
"
,
temp
);
printf
(
"%s
\n
"
,
temp
);
...
...
tests/examples/c/subscribe.c
浏览文件 @
06ff862b
...
@@ -14,8 +14,6 @@ void print_result(TAOS_RES* res, int blockFetch) {
...
@@ -14,8 +14,6 @@ void print_result(TAOS_RES* res, int blockFetch) {
int
num_fields
=
taos_num_fields
(
res
);
int
num_fields
=
taos_num_fields
(
res
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
res
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
res
);
int
nRows
=
0
;
int
nRows
=
0
;
char
buf
[
4096
];
if
(
blockFetch
)
{
if
(
blockFetch
)
{
nRows
=
taos_fetch_block
(
res
,
&
row
);
nRows
=
taos_fetch_block
(
res
,
&
row
);
...
@@ -25,6 +23,7 @@ void print_result(TAOS_RES* res, int blockFetch) {
...
@@ -25,6 +23,7 @@ void print_result(TAOS_RES* res, int blockFetch) {
//}
//}
}
else
{
}
else
{
while
((
row
=
taos_fetch_row
(
res
)))
{
while
((
row
=
taos_fetch_row
(
res
)))
{
char
buf
[
4096
]
=
{
0
};
taos_print_row
(
buf
,
row
,
fields
,
num_fields
);
taos_print_row
(
buf
,
row
,
fields
,
num_fields
);
puts
(
buf
);
puts
(
buf
);
nRows
++
;
nRows
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录