Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzh_me
TDengine
提交
3ab2d86a
TDengine
项目概览
lzh_me
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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,发现更多精彩内容 >>
提交
3ab2d86a
编写于
8月 03, 2019
作者:
S
StoneT2000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code pruning, fix bug with infinite row async fetching when using insert
上级
bd526d22
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
8 deletion
+6
-8
src/connector/nodejs/nodetaos/cursor.js
src/connector/nodejs/nodetaos/cursor.js
+4
-4
src/connector/nodejs/nodetaos/taosquery.js
src/connector/nodejs/nodetaos/taosquery.js
+2
-4
未找到文件。
src/connector/nodejs/nodetaos/cursor.js
浏览文件 @
3ab2d86a
...
...
@@ -268,7 +268,7 @@ TDengineCursor.prototype.execute_a = function execute_a (operation, options, cal
if
(
resCode
>=
0
)
{
let
fieldCount
=
cr
.
_chandle
.
numFields
(
res2
);
if
(
fieldCount
==
0
)
{
cr
.
_chandle
.
freeResult
(
res2
);
//result will no longer be needed
}
else
{
return
res2
;
...
...
@@ -339,15 +339,14 @@ TDengineCursor.prototype.fetchall_a = function fetchall_a(result, options, callb
// object which holds accumulated data in the data key.
let
asyncCallbackWrapper
=
function
asyncCallbackWrapper
(
param2
,
result2
,
numOfRows2
,
rowData
)
{
param2
=
ref
.
readObject
(
param2
);
//return the object back from the pointer
// Keep fetching until now rows left.
if
(
numOfRows2
>
0
)
{
if
(
numOfRows2
>
0
&&
rowData
.
length
!=
0
)
{
// Keep fetching until now rows left.
let
buf2
=
ref
.
alloc
(
'
Object
'
);
param2
.
data
.
push
(
rowData
);
ref
.
writeObject
(
buf2
,
0
,
param2
);
cr
.
_chandle
.
fetch_rows_a
(
result2
,
asyncCallbackWrapper
,
buf2
);
}
else
{
let
finalData
=
param2
.
data
;
let
fields
=
cr
.
_chandle
.
fetchFields_a
(
result2
);
let
data
=
[];
...
...
@@ -365,6 +364,7 @@ TDengineCursor.prototype.fetchall_a = function fetchall_a(result, options, callb
}
cr
.
_chandle
.
freeResult
(
result2
);
// free result, avoid seg faults and mem leaks!
callback
(
param2
,
result2
,
numOfRows2
,
{
data
:
data
,
fields
:
fields
});
}
}
ref
.
writeObject
(
buf
,
0
,
param
);
...
...
src/connector/nodejs/nodetaos/taosquery.js
浏览文件 @
3ab2d86a
...
...
@@ -69,11 +69,9 @@ TaosQuery.prototype.execute_a = async function execute_a(options = {}) {
frej
=
reject
;
});
let
asyncCallbackFetchall
=
async
function
(
param
,
res
,
numOfRows
,
blocks
)
{
//param is expected to be the fetchPromise variable;
//keep fetching until completion, possibly an issue though
if
(
numOfRows
>
0
)
{
frej
(
"
cursor.fetchall_a didn't fetch all data properly
"
);
// Likely a query like insert
fres
();
}
else
{
fres
(
new
TaosResult
(
blocks
.
data
,
blocks
.
fields
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录