Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
ab2791ab
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看板
未验证
提交
ab2791ab
编写于
12月 28, 2020
作者:
H
haojun Liao
提交者:
GitHub
12月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4744 from taosdata/feature/query
[TD-2587]<fix>: fix bugs introduced by refactor.
上级
c907346e
b451e685
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
1 deletion
+16
-1
src/client/src/tscSub.c
src/client/src/tscSub.c
+5
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+11
-0
未找到文件。
src/client/src/tscSub.c
浏览文件 @
ab2791ab
...
...
@@ -69,14 +69,17 @@ TSKEY tscGetSubscriptionProgress(void* sub, int64_t uid, TSKEY dflt) {
}
void
tscUpdateSubscriptionProgress
(
void
*
sub
,
int64_t
uid
,
TSKEY
ts
)
{
if
(
sub
==
NULL
)
if
(
sub
==
NULL
)
{
return
;
}
SSub
*
pSub
=
(
SSub
*
)
sub
;
SSubscriptionProgress
target
=
{.
uid
=
uid
,
.
key
=
ts
};
SSubscriptionProgress
*
p
=
taosArraySearch
(
pSub
->
progress
,
&
target
,
tscCompareSubscriptionProgress
);
if
(
p
!=
NULL
)
{
p
->
key
=
ts
;
tscDebug
(
"subscribe:%s, uid:%"
PRIu64
" update sub start ts:%"
PRId64
,
pSub
->
topic
,
p
->
uid
,
p
->
key
);
}
}
...
...
@@ -502,6 +505,7 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
if
(
taosArrayGetSize
(
pSub
->
progress
)
>
0
)
{
// fix crash in single tabel subscription
pQueryInfo
->
window
.
skey
=
((
SSubscriptionProgress
*
)
taosArrayGet
(
pSub
->
progress
,
0
))
->
key
;
tscDebug
(
"subscribe:%s set subscribe skey:%"
PRId64
,
pSub
->
topic
,
pQueryInfo
->
window
.
skey
);
}
if
(
pSub
->
pTimer
==
NULL
)
{
...
...
src/query/src/qExecutor.c
浏览文件 @
ab2791ab
...
...
@@ -1722,6 +1722,10 @@ static int32_t tableApplyFunctionsOnBlock(SQueryRuntimeEnv *pRuntimeEnv, SDataBl
blockwiseApplyFunctions
(
pRuntimeEnv
,
pStatis
,
pDataBlockInfo
,
pResultRowInfo
,
searchFn
,
pDataBlock
);
}
// update the lastkey of current table for projection/aggregation query
TSKEY
lastKey
=
QUERY_IS_ASC_QUERY
(
pQuery
)
?
pDataBlockInfo
->
window
.
ekey
:
pDataBlockInfo
->
window
.
skey
;
pTableQueryInfo
->
lastKey
=
lastKey
+
GET_FORWARD_DIRECTION_FACTOR
(
pQuery
->
order
.
order
);
// interval query with limit applied
int32_t
numOfRes
=
0
;
if
(
QUERY_IS_INTERVAL_QUERY
(
pQuery
)
||
pRuntimeEnv
->
groupbyNormalCol
)
{
...
...
@@ -4299,7 +4303,9 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data
*
(
int32_t
*
)
data
=
htonl
(
numOfTables
);
data
+=
sizeof
(
int32_t
);
int32_t
total
=
0
;
STableIdInfo
*
item
=
taosHashIterate
(
pQInfo
->
arrTableIdInfo
,
NULL
);
while
(
item
)
{
STableIdInfo
*
pDst
=
(
STableIdInfo
*
)
data
;
pDst
->
uid
=
htobe64
(
item
->
uid
);
...
...
@@ -4307,9 +4313,14 @@ static void doCopyQueryResultToMsg(SQInfo *pQInfo, int32_t numOfRows, char *data
pDst
->
key
=
htobe64
(
item
->
key
);
data
+=
sizeof
(
STableIdInfo
);
total
++
;
qDebug
(
"QInfo:%p set subscribe info, tid:%d, uid:%"
PRIu64
", skey:%"
PRId64
,
pQInfo
,
item
->
tid
,
item
->
uid
,
item
->
key
);
item
=
taosHashIterate
(
pQInfo
->
arrTableIdInfo
,
item
);
}
qDebug
(
"QInfo:%p set %d subscribe info"
,
pQInfo
,
total
);
// Check if query is completed or not for stable query or normal table query respectively.
if
(
Q_STATUS_EQUAL
(
pQuery
->
status
,
QUERY_COMPLETED
))
{
if
(
pQInfo
->
runtimeEnv
.
stableQuery
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录