Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
114dd6ea
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看板
提交
114dd6ea
编写于
1月 15, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs and refactor code
上级
7021d3f6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
18 deletion
+34
-18
src/client/src/tscJoinProcess.c
src/client/src/tscJoinProcess.c
+20
-8
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+11
-5
src/util/src/hash.c
src/util/src/hash.c
+3
-5
未找到文件。
src/client/src/tscJoinProcess.c
浏览文件 @
114dd6ea
...
...
@@ -390,7 +390,7 @@ static void doQuitSubquery(SSqlObj* pParentSql) {
}
static
void
quitAllSubquery
(
SSqlObj
*
pSqlObj
,
SJoinSubquerySupporter
*
pSupporter
)
{
int32_t
numOfTotal
=
pSupporter
->
pState
->
numOf
Completed
;
int32_t
numOfTotal
=
pSupporter
->
pState
->
numOf
Total
;
int32_t
finished
=
atomic_add_fetch_32
(
&
pSupporter
->
pState
->
numOfCompleted
,
1
);
if
(
finished
>=
numOfTotal
)
{
...
...
@@ -479,8 +479,13 @@ static void joinRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) {
return
;
}
}
if
(
atomic_add_fetch_32
(
&
pSupporter
->
pState
->
numOfCompleted
,
1
)
>=
pSupporter
->
pState
->
numOfTotal
)
{
int32_t
numOfTotal
=
pSupporter
->
pState
->
numOfTotal
;
int32_t
finished
=
atomic_add_fetch_32
(
&
pSupporter
->
pState
->
numOfCompleted
,
1
);
if
(
finished
>=
numOfTotal
)
{
assert
(
finished
==
numOfTotal
);
if
(
pSupporter
->
pState
->
code
!=
TSDB_CODE_SUCCESS
)
{
tscTrace
(
"%p sub:%p, numOfSub:%d, quit from further procedure due to other queries failure"
,
pParentSql
,
tres
,
pSupporter
->
subqueryIndex
);
...
...
@@ -538,10 +543,12 @@ static void joinRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) {
return
;
}
}
if
(
atomic_add_fetch_32
(
&
pSupporter
->
pState
->
numOfCompleted
,
1
)
>=
pSupporter
->
pState
->
numOfTotal
)
{
assert
(
pSupporter
->
pState
->
numOfCompleted
==
pSupporter
->
pState
->
numOfTotal
);
int32_t
numOfTotal
=
pSupporter
->
pState
->
numOfTotal
;
int32_t
finished
=
atomic_add_fetch_32
(
&
pSupporter
->
pState
->
numOfCompleted
,
1
);
if
(
finished
>=
numOfTotal
)
{
assert
(
finished
==
numOfTotal
);
tscTrace
(
"%p all %d secondary retrieves are completed, global code:%d"
,
tres
,
pSupporter
->
pState
->
numOfTotal
,
pParentSql
->
res
.
code
);
...
...
@@ -756,7 +763,12 @@ void tscJoinQueryCallback(void* param, TAOS_RES* tres, int code) {
quitAllSubquery
(
pParentSql
,
pSupporter
);
}
else
{
if
(
atomic_add_fetch_32
(
&
pSupporter
->
pState
->
numOfCompleted
,
1
)
>=
pSupporter
->
pState
->
numOfTotal
)
{
int32_t
numOfTotal
=
pSupporter
->
pState
->
numOfTotal
;
int32_t
finished
=
atomic_add_fetch_32
(
&
pSupporter
->
pState
->
numOfCompleted
,
1
);
if
(
finished
>=
numOfTotal
)
{
assert
(
finished
==
numOfTotal
);
tscSetupOutputColumnIndex
(
pParentSql
);
SMeterMetaInfo
*
pMeterMetaInfo
=
tscGetMeterMetaInfoFromQueryInfo
(
pQueryInfo
,
0
);
...
...
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
114dd6ea
...
...
@@ -2006,9 +2006,9 @@ int32_t getNextDataFileCompInfo(SQueryRuntimeEnv *pRuntimeEnv, SMeterObj *pMeter
// no files left, abort
if
(
fileIndex
<
0
)
{
if
(
step
==
QUERY_ASC_FORWARD_STEP
)
{
dTrace
(
"QInfo:%p no file to access, try data in cache"
,
GET_QINFO_ADDR
(
pQuery
));
dTrace
(
"QInfo:%p no
more
file to access, try data in cache"
,
GET_QINFO_ADDR
(
pQuery
));
}
else
{
dTrace
(
"QInfo:%p no file to access in desc order, query completed"
,
GET_QINFO_ADDR
(
pQuery
));
dTrace
(
"QInfo:%p no
more
file to access in desc order, query completed"
,
GET_QINFO_ADDR
(
pQuery
));
}
vnodeFreeFieldsEx
(
pRuntimeEnv
);
...
...
@@ -2596,6 +2596,7 @@ int64_t getQueryStartPositionInCache(SQueryRuntimeEnv *pRuntimeEnv, int32_t *slo
// cache block has been flushed to disk, no required data block in cache.
SCacheBlock
*
pBlock
=
getCacheDataBlock
(
pMeterObj
,
pRuntimeEnv
,
pQuery
->
slot
);
if
(
pBlock
==
NULL
)
{
pQuery
->
skey
=
rawskey
;
// restore the skey
return
-
1
;
}
...
...
@@ -2868,8 +2869,8 @@ static bool doGetQueryPos(TSKEY key, SMeterQuerySupportObj *pSupporter, SPointIn
}
}
static
bool
doSetDataInfo
(
SMeterQuerySupportObj
*
pSupporter
,
S
PointInterpoSupporter
*
pPointInterpSupporter
,
S
MeterObj
*
pMeterObj
,
TSKEY
nextKey
)
{
static
bool
doSetDataInfo
(
SMeterQuerySupportObj
*
pSupporter
,
SPointInterpoSupporter
*
pPointInterpSupporter
,
SMeterObj
*
pMeterObj
,
TSKEY
nextKey
)
{
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pSupporter
->
runtimeEnv
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
...
...
@@ -5441,6 +5442,9 @@ static void queryStatusSave(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatus *pStatus
pStatus
->
overStatus
=
pQuery
->
over
;
pStatus
->
lastKey
=
pQuery
->
lastKey
;
pStatus
->
skey
=
pQuery
->
skey
;
pStatus
->
ekey
=
pQuery
->
ekey
;
pStatus
->
start
=
pRuntimeEnv
->
startPos
;
pStatus
->
next
=
pRuntimeEnv
->
nextPos
;
...
...
@@ -5465,7 +5469,9 @@ static void queryStatusRestore(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatus *pSta
SWAP
(
pQuery
->
skey
,
pQuery
->
ekey
,
TSKEY
);
pQuery
->
lastKey
=
pStatus
->
lastKey
;
pQuery
->
skey
=
pStatus
->
skey
;
pQuery
->
ekey
=
pStatus
->
ekey
;
pQuery
->
over
=
pStatus
->
overStatus
;
pRuntimeEnv
->
startPos
=
pStatus
->
start
;
...
...
src/util/src/hash.c
浏览文件 @
114dd6ea
...
...
@@ -339,13 +339,11 @@ static void doAddToHashTable(HashObj *pObj, SHashNode *pNode) {
pNode
->
prev1
=
pEntry
;
pEntry
->
num
++
;
pObj
->
size
++
;
char
key
[
512
]
=
{
0
};
memcpy
(
key
,
pNode
->
key
,
MIN
(
512
,
pNode
->
keyLen
));
pTrace
(
"key:%s %p add to hash table"
,
key
,
pNode
);
// char key[512] = {0};
// memcpy(key, pNode->key, MIN(512, pNode->keyLen));
// pTrace("key:%s %p add to hash table", key, pNode);
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录