Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c9860ac5
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c9860ac5
编写于
6月 19, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 19, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2357 from taosdata/feature/query
[td-225] add cancel query support, fix bugs in load file blocks when …
上级
0101bc6e
bdee045c
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
71 addition
and
31 deletion
+71
-31
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+6
-5
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-2
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-1
src/inc/trpc.h
src/inc/trpc.h
+1
-1
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+61
-22
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
c9860ac5
...
...
@@ -294,11 +294,12 @@ typedef struct STscObj {
}
STscObj
;
typedef
struct
SSqlObj
{
void
*
signature
;
void
*
signature
;
STscObj
*
pTscObj
;
void
*
SRpcReqContext
;
void
(
*
fp
)();
void
(
*
fetchFp
)();
void
*
param
;
void
*
param
;
int64_t
stime
;
uint32_t
queryId
;
void
*
pStream
;
...
...
src/client/src/tscServer.c
浏览文件 @
c9860ac5
...
...
@@ -196,8 +196,8 @@ int tscSendMsgToServer(SSqlObj *pSql) {
.
handle
=
pSql
,
.
code
=
0
};
rpcSendRequest
(
pObj
->
pDnodeConn
,
&
pSql
->
ipList
,
&
rpcMsg
);
pSql
->
SRpcReqContext
=
rpcSendRequest
(
pObj
->
pDnodeConn
,
&
pSql
->
ipList
,
&
rpcMsg
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -422,7 +422,7 @@ void tscKillSTableQuery(SSqlObj *pSql) {
* sub-queries not correctly released and master sql object of super table query reaches an abnormal state.
*/
pSql
->
pSubs
[
i
]
->
res
.
code
=
TSDB_CODE_TSC_QUERY_CANCELLED
;
// taosStopRpcConn(pSql->pSubs[i]->
);
rpcCancelRequest
(
pSql
->
pSubs
[
i
]
->
SRpcReqContext
);
}
/*
...
...
src/client/src/tscSql.c
浏览文件 @
c9860ac5
...
...
@@ -627,7 +627,7 @@ void taos_stop_query(TAOS_RES *res) {
return
;
}
//taosStopRpcConn(pSql->thandle
);
rpcCancelRequest
(
pSql
->
SRpcReqContext
);
tscTrace
(
"%p query is cancelled"
,
res
);
}
...
...
src/inc/trpc.h
浏览文件 @
c9860ac5
...
...
@@ -84,7 +84,7 @@ void rpcSendRedirectRsp(void *pConn, const SRpcIpSet *pIpSet);
int
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
void
rpcSendRecv
(
void
*
shandle
,
SRpcIpSet
*
pIpSet
,
const
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
);
int
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
void
rpcCanelRequest
(
void
*
pContext
);
void
rpcCan
c
elRequest
(
void
*
pContext
);
#ifdef __cplusplus
}
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
c9860ac5
...
...
@@ -792,8 +792,16 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap
int32_t
requiredNumOfCols
=
taosArrayGetSize
(
pQueryHandle
->
pColumns
);
//data in buffer has greater timestamp, copy data in file block
for
(
int32_t
i
=
0
;
i
<
requiredNumOfCols
;
++
i
)
{
int32_t
i
=
0
,
j
=
0
;
while
(
i
<
requiredNumOfCols
&&
j
<
pCols
->
numOfCols
)
{
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
i
);
SDataCol
*
src
=
&
pCols
->
cols
[
j
];
if
(
src
->
colId
<
pColInfo
->
info
.
colId
)
{
j
++
;
continue
;
}
int32_t
bytes
=
pColInfo
->
info
.
bytes
;
if
(
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
))
{
...
...
@@ -802,9 +810,6 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap
pData
=
pColInfo
->
pData
+
(
capacity
-
numOfRows
-
num
)
*
pColInfo
->
info
.
bytes
;
}
for
(
int32_t
j
=
0
;
j
<
pCols
->
numOfCols
;
++
j
)
{
// todo opt performance
SDataCol
*
src
=
&
pCols
->
cols
[
j
];
if
(
pColInfo
->
info
.
colId
==
src
->
colId
)
{
if
(
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_BINARY
&&
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_NCHAR
)
{
...
...
@@ -820,9 +825,43 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap
}
}
break
;
j
++
;
i
++
;
}
else
{
// pColInfo->info.colId < src->colId, it is a NULL data
if
(
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_BINARY
||
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_NCHAR
)
{
char
*
dst
=
pData
;
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
setVardataNull
(
dst
,
pColInfo
->
info
.
type
);
dst
+=
bytes
;
}
}
else
{
setNullN
(
pData
,
pColInfo
->
info
.
type
,
pColInfo
->
info
.
bytes
,
num
);
}
i
++
;
}
}
while
(
i
<
requiredNumOfCols
)
{
// the remain columns are all null data
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
i
);
if
(
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
))
{
pData
=
pColInfo
->
pData
+
numOfRows
*
pColInfo
->
info
.
bytes
;
}
else
{
pData
=
pColInfo
->
pData
+
(
capacity
-
numOfRows
-
num
)
*
pColInfo
->
info
.
bytes
;
}
if
(
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_BINARY
||
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_NCHAR
)
{
char
*
dst
=
pData
;
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
setVardataNull
(
dst
,
pColInfo
->
info
.
type
);
dst
+=
pColInfo
->
info
.
bytes
;
}
}
else
{
setNullN
(
pData
,
pColInfo
->
info
.
type
,
pColInfo
->
info
.
bytes
,
num
);
}
i
++
;
}
pQueryHandle
->
cur
.
win
.
ekey
=
tsArray
[
end
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录