Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7cbff7c2
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7cbff7c2
编写于
5月 25, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]fix bugs in empty super table query.
上级
6f524d20
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
12 deletion
+23
-12
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-2
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+20
-9
未找到文件。
src/client/src/tscAsync.c
浏览文件 @
7cbff7c2
...
...
@@ -165,7 +165,7 @@ static void tscProcessAsyncRetrieveImpl(void *param, TAOS_RES *tres, int numOfRo
SSqlRes
*
pRes
=
&
pSql
->
res
;
if
((
pRes
->
qhandle
==
0
||
numOfRows
!=
0
)
&&
pCmd
->
command
<
TSDB_SQL_LOCAL
)
{
if
(
pRes
->
qhandle
==
0
)
{
if
(
pRes
->
qhandle
==
0
&&
numOfRows
!=
0
)
{
tscError
(
"qhandle is NULL"
);
}
else
{
pRes
->
code
=
numOfRows
;
...
...
src/client/src/tscUtil.c
浏览文件 @
7cbff7c2
...
...
@@ -2010,7 +2010,7 @@ bool hasMoreVnodesToTry(SSqlObj* pSql) {
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
assert
(
pRes
->
completed
);
// for normal table,
do not try any more if result are exhausted
// for normal table,
no need to try any more if results are all retrieved from one vnode
if
(
!
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
)
||
(
pTableMetaInfo
->
vgroupList
==
NULL
))
{
return
false
;
}
...
...
@@ -2036,7 +2036,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
int32_t
totalVgroups
=
pTableMetaInfo
->
vgroupList
->
numOfVgroups
;
while
(
++
pTableMetaInfo
->
vgroupIndex
<
totalVgroups
)
{
tscTrace
(
"%p
current vnode:%d exhausted, try next:%d. total vnode
:%d. current numOfRes:%d"
,
pSql
,
tscTrace
(
"%p
results from vgroup index:%d completed, try next:%d. total vgroups
:%d. current numOfRes:%d"
,
pSql
,
pTableMetaInfo
->
vgroupIndex
-
1
,
pTableMetaInfo
->
vgroupIndex
,
totalVgroups
,
pRes
->
numOfClauseTotal
);
/*
...
...
src/query/src/qExecutor.c
浏览文件 @
7cbff7c2
...
...
@@ -4234,7 +4234,6 @@ static void setupQueryHandle(void* tsdb, SQInfo* pQInfo, bool isSTableQuery) {
}
}
static
SFillColInfo
*
taosCreateFillColInfo
(
SQuery
*
pQuery
)
{
int32_t
numOfCols
=
pQuery
->
numOfOutput
;
int32_t
offset
=
0
;
...
...
@@ -5875,6 +5874,14 @@ static int32_t initQInfo(SQueryTableMsg *pQueryMsg, void *tsdb, int32_t vgId, SQ
sem_post
(
&
pQInfo
->
dataReady
);
return
TSDB_CODE_SUCCESS
;
}
if
(
pQInfo
->
groupInfo
.
numOfTables
==
0
)
{
qTrace
(
"QInfo:%p no table qualified for tag filter, abort query"
,
pQInfo
);
setQueryStatus
(
pQuery
,
QUERY_COMPLETED
);
sem_post
(
&
pQInfo
->
dataReady
);
return
TSDB_CODE_SUCCESS
;
}
// filter the qualified
if
((
code
=
doInitQInfo
(
pQInfo
,
pTSBuf
,
tsdb
,
vgId
,
isSTable
))
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -6108,12 +6115,14 @@ int32_t qCreateQueryInfo(void *tsdb, int32_t vgId, SQueryTableMsg *pQueryMsg, qi
// todo handle the error
/*int32_t ret =*/
tsdbQuerySTableByTagCond
(
tsdb
,
id
->
uid
,
tagCond
,
pQueryMsg
->
tagCondLen
,
pQueryMsg
->
tagNameRelType
,
tbnameCond
,
&
groupInfo
,
pGroupColIndex
,
numOfGroupByCols
);
if
(
groupInfo
.
numOfTables
==
0
)
{
// no qualified tables no need to do query
code
=
TSDB_CODE_SUCCESS
;
goto
_over
;
}
// if (groupInfo.numOfTables == 0) { // no qualified tables no need to do query
// code = TSDB_CODE_SUCCESS;
// qTrace("qmsg:%p no results to produce by tag filters, return directly", pQueryMsg);
// goto _over;
// }
}
else
{
groupInfo
.
numOfTables
=
taosArrayGetSize
(
pTableIdList
);
//
groupInfo.numOfTables = taosArrayGetSize(pTableIdList);
SArray
*
pTableGroup
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SArray
*
sa
=
taosArrayInit
(
groupInfo
.
numOfTables
,
sizeof
(
STableId
));
...
...
@@ -6142,7 +6151,6 @@ _over:
taosArrayDestroy
(
pTableIdList
);
// if failed to add ref for all meters in this query, abort current query
// atomic_fetch_add_32(&vnodeSelectReqNum, 1);
return
code
;
}
...
...
@@ -6155,7 +6163,7 @@ void qTableQuery(qinfo_t qinfo) {
SQInfo
*
pQInfo
=
(
SQInfo
*
)
qinfo
;
if
(
pQInfo
==
NULL
||
pQInfo
->
signature
!=
pQInfo
)
{
qTrace
(
"
%p freed abort query
"
,
pQInfo
);
qTrace
(
"
QInfo:%p has been freed, no need to execute
"
,
pQInfo
);
return
;
}
...
...
@@ -6268,7 +6276,10 @@ static void buildTagQueryResult(SQInfo* pQInfo) {
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
size_t
num
=
taosArrayGetSize
(
pQInfo
->
groupInfo
.
pGroupList
);
assert
(
num
==
1
);
// only one group
assert
(
num
==
0
||
num
==
1
);
if
(
num
==
0
)
{
return
;
}
SArray
*
pa
=
taosArrayGetP
(
pQInfo
->
groupInfo
.
pGroupList
,
0
);
num
=
taosArrayGetSize
(
pa
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录