Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
092da369
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看板
提交
092da369
编写于
10月 27, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] fix bugs by regression test.
上级
00ecc593
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
33 deletion
+36
-33
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+26
-25
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+10
-8
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
092da369
...
...
@@ -219,6 +219,11 @@ static void tscDestroyJoinSupporter(SJoinSupporter* pSupporter) {
pSupporter
->
f
=
NULL
;
}
if
(
pSupporter
->
pVgroupTables
!=
NULL
)
{
taosArrayDestroy
(
pSupporter
->
pVgroupTables
);
pSupporter
->
pVgroupTables
=
NULL
;
}
taosTFree
(
pSupporter
->
pIdTagList
);
tscTagCondRelease
(
&
pSupporter
->
tagCond
);
free
(
pSupporter
);
...
...
@@ -327,6 +332,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pNewQueryInfo
,
0
);
pTableMetaInfo
->
pVgroupTables
=
pSupporter
->
pVgroupTables
;
pSupporter
->
pVgroupTables
=
NULL
;
/*
* When handling the projection query, the offset value will be modified for table-table join, which is changed
...
...
@@ -359,7 +365,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
int16_t
colId
=
tscGetJoinTagColIdByUid
(
&
pQueryInfo
->
tagCond
,
pTableMetaInfo
->
pTableMeta
->
id
.
uid
);
// set the tag column id for executor to extract correct tag value
pExpr
->
param
[
0
]
.
i64Key
=
colId
;
pExpr
->
param
[
0
]
=
(
tVariant
)
{.
i64Key
=
colId
,
.
nType
=
TSDB_DATA_TYPE_BIGINT
,
.
nLen
=
sizeof
(
int64_t
)}
;
pExpr
->
numOfParams
=
1
;
}
...
...
@@ -388,25 +394,6 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
assert
(
taosArrayGetSize
(
pTableMetaInfo
->
pVgroupTables
)
>
0
);
TSDB_QUERY_SET_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_MULTITABLE_QUERY
);
}
else
{
// TODO remove unnecessarily accessed vnode
// pTableMetaInfo->vgroupList->
// for(int32_t k = 0; k < taosArrayGetSize(pTableMetaInfo->pVgroupTables);) {
// SVgroupTableInfo* p = taosArrayGet(pTableMetaInfo->pVgroupTables, k);
//
// bool found = false;
// for(int32_t f = 0; f < num; ++f) {
// if (p->vgInfo.vgId == list[f]) {
// found = true;
// break;
// }
// }
//
// if (!found) {
// tscRemoveVgroupTableGroup(pTableMetaInfo->pVgroupTables, k);
// } else {
// k++;
// }
// }
}
taosTFree
(
list
);
...
...
@@ -1023,15 +1010,28 @@ void tscFetchDatablockFromSubquery(SSqlObj* pSql) {
// If at least one subquery is completed in current vnode, try the next vnode in case of multi-vnode
// super table projection query.
if
(
numOfFetch
<=
0
&&
!
reachLimit
)
{
if
(
reachLimit
)
{
pSql
->
res
.
completed
=
true
;
freeJoinSubqueryObj
(
pSql
);
if
(
pSql
->
res
.
code
==
TSDB_CODE_SUCCESS
)
{
(
*
pSql
->
fp
)(
pSql
->
param
,
pSql
,
0
);
}
else
{
tscQueueAsyncRes
(
pSql
);
}
return
;
}
if
(
numOfFetch
<=
0
)
{
bool
tryNextVnode
=
false
;
SSqlObj
*
pp
=
pSql
->
pSubs
[
0
];
SSqlObj
*
pp
=
pSql
->
pSubs
[
0
];
SQueryInfo
*
pi
=
tscGetQueryInfoDetail
(
&
pp
->
cmd
,
0
);
// get the number of subquery that need to retrieve the next vnode.
if
(
tscNonOrderedProjectionQueryOnSTable
(
pi
,
0
))
{
for
(
int32_t
i
=
0
;
i
<
pSql
->
subState
.
numOfSub
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pSql
->
subState
.
numOfSub
;
++
i
)
{
SSqlObj
*
pSub
=
pSql
->
pSubs
[
i
];
if
(
pSub
!=
NULL
&&
pSub
->
res
.
row
>=
pSub
->
res
.
numOfRows
&&
pSub
->
res
.
completed
)
{
pSql
->
subState
.
numOfRemain
++
;
...
...
@@ -1047,7 +1047,8 @@ void tscFetchDatablockFromSubquery(SSqlObj* pSql) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pSub
->
cmd
,
0
);
if
(
tscNonOrderedProjectionQueryOnSTable
(
pQueryInfo
,
0
)
&&
pSub
->
res
.
row
>=
pSub
->
res
.
numOfRows
&&
pSub
->
res
.
completed
)
{
if
(
tscNonOrderedProjectionQueryOnSTable
(
pQueryInfo
,
0
)
&&
pSub
->
res
.
row
>=
pSub
->
res
.
numOfRows
&&
pSub
->
res
.
completed
)
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
assert
(
pQueryInfo
->
numOfTables
==
1
);
...
...
@@ -1085,7 +1086,7 @@ void tscFetchDatablockFromSubquery(SSqlObj* pSql) {
}
else
{
tscQueueAsyncRes
(
pSql
);
}
return
;
}
...
...
src/query/src/qExecutor.c
浏览文件 @
092da369
...
...
@@ -2631,17 +2631,19 @@ void setTagVal(SQueryRuntimeEnv *pRuntimeEnv, void *pTable, void *tsdb) {
pFuncMsg
->
colInfo
.
colIndex
==
PRIMARYKEY_TIMESTAMP_COL_INDEX
)
{
assert
(
pFuncMsg
->
numOfParams
==
1
);
int16_t
tagColId
=
(
int16_t
)
pExprInfo
->
base
.
arg
->
argValue
.
i64
;
SColumnInfo
*
pColInfo
=
doGetTagColumnInfoById
(
pQuery
->
tagColList
,
pQuery
->
numOfTags
,
tagColId
);
int16_t
tagColId
=
(
int16_t
)
pExprInfo
->
base
.
arg
->
argValue
.
i64
;
SColumnInfo
*
pColInfo
=
doGetTagColumnInfoById
(
pQuery
->
tagColList
,
pQuery
->
numOfTags
,
tagColId
);
doSetTagValueInParam
(
tsdb
,
pTable
,
tagColId
,
&
pRuntimeEnv
->
pCtx
[
0
].
tag
,
pColInfo
->
type
,
pColInfo
->
bytes
);
if
(
pRuntimeEnv
->
pCtx
[
0
].
tag
.
nType
==
TSDB_DATA_TYPE_BINARY
||
pRuntimeEnv
->
pCtx
[
0
].
tag
.
nType
==
TSDB_DATA_TYPE_NCHAR
)
{}
qDebug
(
"QInfo:%p set tag value for join comparison, colId:%"
PRId64
", val:%s"
,
pQInfo
,
pExprInfo
->
base
.
arg
->
argValue
.
i64
,
pRuntimeEnv
->
pCtx
[
0
].
tag
.
pz
);
}
else
{
qDebug
(
"QInfo:%p set tag value for join comparison, colId:%"
PRId64
", val:%"
PRId64
,
pQInfo
,
pExprInfo
->
base
.
arg
->
argValue
.
i64
,
pRuntimeEnv
->
pCtx
[
0
].
tag
.
i64Key
);
int16_t
tagType
=
pRuntimeEnv
->
pCtx
[
0
].
tag
.
nType
;
if
(
tagType
==
TSDB_DATA_TYPE_BINARY
||
tagType
==
TSDB_DATA_TYPE_NCHAR
)
{
qDebug
(
"QInfo:%p set tag value for join comparison, colId:%"
PRId64
", val:%s"
,
pQInfo
,
pExprInfo
->
base
.
arg
->
argValue
.
i64
,
pRuntimeEnv
->
pCtx
[
0
].
tag
.
pz
);
}
else
{
qDebug
(
"QInfo:%p set tag value for join comparison, colId:%"
PRId64
", val:%"
PRId64
,
pQInfo
,
pExprInfo
->
base
.
arg
->
argValue
.
i64
,
pRuntimeEnv
->
pCtx
[
0
].
tag
.
i64Key
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录