Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
35b82a64
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
35b82a64
编写于
8月 18, 2021
作者:
W
wpan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix nested query bug
上级
89028123
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
48 deletion
+19
-48
src/client/inc/tscSubquery.h
src/client/inc/tscSubquery.h
+0
-2
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+9
-33
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+10
-13
未找到文件。
src/client/inc/tscSubquery.h
浏览文件 @
35b82a64
...
...
@@ -52,8 +52,6 @@ int tsInsertInitialCheck(SSqlObj *pSql);
void
doCleanupSubqueries
(
SSqlObj
*
pSql
,
int32_t
numOfSubs
);
void
tscFreeRetrieveSupporters
(
SSqlObj
*
pSql
);
void
tscFreeRetrieveSup
(
SSqlObj
*
pSql
);
...
...
src/client/src/tscSubquery.c
浏览文件 @
35b82a64
...
...
@@ -2040,11 +2040,8 @@ void doCleanupSubqueries(SSqlObj *pSql, int32_t numOfSubs) {
for
(
int32_t
i
=
0
;
i
<
numOfSubs
;
++
i
)
{
SSqlObj
*
pSub
=
pSql
->
pSubs
[
i
];
assert
(
pSub
!=
NULL
);
SRetrieveSupport
*
pSupport
=
pSub
->
param
;
tfree
(
pSupport
->
localBuffer
);
tfree
(
pSupport
);
tscFreeRetrieveSup
(
pSub
);
taos_free_result
(
pSub
);
}
...
...
@@ -2576,18 +2573,6 @@ void tscFreeRetrieveSup(SSqlObj *pSql) {
tfree
(
trsupport
);
}
void
tscFreeRetrieveSupporters
(
SSqlObj
*
pSql
)
{
for
(
int32_t
i
=
0
;
i
<
pSql
->
subState
.
numOfSub
;
++
i
)
{
SSqlObj
*
pSub
=
pSql
->
pSubs
[
i
];
assert
(
pSub
!=
NULL
);
tscFreeRetrieveSup
(
pSub
);
}
}
static
void
tscRetrieveFromDnodeCallBack
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
);
static
void
tscHandleSubqueryError
(
SRetrieveSupport
*
trsupport
,
SSqlObj
*
pSql
,
int
numOfRows
);
...
...
@@ -2732,30 +2717,21 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO
if
(
!
TSDB_QUERY_HAS_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_JOIN_SEC_STAGE
))
{
int32_t
code
=
pParentSql
->
res
.
code
;
if
((
code
==
TSDB_CODE_TDB_INVALID_TABLE_ID
||
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
)
&&
pParentSql
->
retry
<
pParentSql
->
maxRetry
)
{
// remove the cached tableMeta and vgroup id list, and then parse the sql again
SSqlCmd
*
pParentCmd
=
&
pParentSql
->
cmd
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pParentCmd
,
0
);
tscRemoveTableMetaBuf
(
pTableMetaInfo
,
pParentSql
->
self
);
pParentCmd
->
pTableMetaMap
=
tscCleanupTableMetaMap
(
pParentCmd
->
pTableMetaMap
);
pParentCmd
->
pTableMetaMap
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_NO_LOCK
);
SSqlObj
*
userSql
=
((
SRetrieveSupport
*
)
pParentSql
->
param
)
->
pParentSql
;
SSqlObj
*
userSql
=
((
SRetrieveSupport
*
)
pParentSql
->
param
)
->
pParentSql
;
if
((
code
==
TSDB_CODE_TDB_INVALID_TABLE_ID
||
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
)
&&
userSql
->
retry
<
userSql
->
maxRetry
)
{
tscFreeRetrieveSup
(
pParentSql
);
tscFreeRetrieveSup
(
userSql
);
tscFreeSubobj
(
userSql
);
tfree
(
userSql
->
pSubs
);
pParent
Sql
->
res
.
code
=
TSDB_CODE_SUCCESS
;
pParent
Sql
->
retry
++
;
user
Sql
->
res
.
code
=
TSDB_CODE_SUCCESS
;
user
Sql
->
retry
++
;
tscDebug
(
"0x%"
PRIx64
" retry parse sql and send query, prev error: %s, retry:%d"
,
pParent
Sql
->
self
,
tstrerror
(
code
),
pParent
Sql
->
retry
);
tscDebug
(
"0x%"
PRIx64
" retry parse sql and send query, prev error: %s, retry:%d"
,
user
Sql
->
self
,
tstrerror
(
code
),
user
Sql
->
retry
);
tscResetSqlCmd
(
&
userSql
->
cmd
,
fals
e
);
tscResetSqlCmd
(
&
userSql
->
cmd
,
tru
e
);
code
=
tsParseSql
(
userSql
,
true
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
return
;
...
...
src/client/src/tscUtil.c
浏览文件 @
35b82a64
...
...
@@ -3758,29 +3758,26 @@ static void tscSubqueryCompleteCallback(void* param, TAOS_RES* tres, int code) {
// todo refactor
tscDebug
(
"0x%"
PRIx64
" all subquery response received, retry"
,
pParentSql
->
self
);
SSqlCmd
*
pParentCmd
=
&
pParentSql
->
cmd
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pParentCmd
,
0
);
tscRemoveTableMetaBuf
(
pTableMetaInfo
,
pParentSql
->
self
);
pParentCmd
->
pTableMetaMap
=
tscCleanupTableMetaMap
(
pParentCmd
->
pTableMetaMap
);
pParentCmd
->
pTableMetaMap
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_NO_LOCK
);
SSqlObj
*
userSql
=
((
SRetrieveSupport
*
)
pParentSql
->
param
)
->
pParentSql
;
tscFreeRetrieveSup
(
pParentSql
);
tscFreeRetrieveSup
(
userSql
);
if
(
code
&&
!
((
code
==
TSDB_CODE_TDB_INVALID_TABLE_ID
||
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
)
&&
userSql
->
retry
<
userSql
->
maxRetry
))
{
tscAsyncResultOnError
(
pParentSql
);
return
;
}
tscFreeSubobj
(
userSql
);
tfree
(
userSql
->
pSubs
);
pParent
Sql
->
res
.
code
=
TSDB_CODE_SUCCESS
;
pParent
Sql
->
retry
++
;
user
Sql
->
res
.
code
=
TSDB_CODE_SUCCESS
;
user
Sql
->
retry
++
;
tscDebug
(
"0x%"
PRIx64
" retry parse sql and send query, prev error: %s, retry:%d"
,
pParent
Sql
->
self
,
tstrerror
(
code
),
pParent
Sql
->
retry
);
tscDebug
(
"0x%"
PRIx64
" retry parse sql and send query, prev error: %s, retry:%d"
,
user
Sql
->
self
,
tstrerror
(
code
),
user
Sql
->
retry
);
tscResetSqlCmd
(
&
userSql
->
cmd
,
fals
e
);
tscResetSqlCmd
(
&
userSql
->
cmd
,
tru
e
);
code
=
tsParseSql
(
userSql
,
true
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录