Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
45a0ba86
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
45a0ba86
编写于
12月 02, 2015
作者:
H
Heikki Linnakangas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove kludge used to pull typmod from subquery.
It's no longer needed, as Params carry a typmod now.
上级
424460c9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
32 deletion
+6
-32
src/backend/cdb/cdbsubselect.c
src/backend/cdb/cdbsubselect.c
+2
-5
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/plan/subselect.c
+3
-25
src/include/optimizer/subselect.h
src/include/optimizer/subselect.h
+1
-2
未找到文件。
src/backend/cdb/cdbsubselect.c
浏览文件 @
45a0ba86
...
...
@@ -1131,8 +1131,7 @@ convert_IN_to_join(PlannerInfo *root, List** rtrlist_inout, SubLink *sublink)
return
convert_testexpr
(
root
,
sublink
->
testexpr
,
rtindex
,
&
ininfo
->
sub_targetlist
,
subselect
->
targetList
);
&
ininfo
->
sub_targetlist
);
}
/* convert_IN_to_join */
...
...
@@ -1417,7 +1416,6 @@ static Node *
make_lasj_quals
(
PlannerInfo
*
root
,
SubLink
*
sublink
,
int
subquery_indx
)
{
Expr
*
join_pred
;
Query
*
subselect
=
(
Query
*
)
sublink
->
subselect
;
List
*
subtlist
=
NIL
;
Assert
(
sublink
->
subLinkType
==
ALL_SUBLINK
);
...
...
@@ -1425,8 +1423,7 @@ make_lasj_quals(PlannerInfo *root, SubLink * sublink, int subquery_indx)
join_pred
=
(
Expr
*
)
convert_testexpr
(
root
,
sublink
->
testexpr
,
subquery_indx
,
&
subtlist
,
subselect
->
targetList
);
&
subtlist
);
join_pred
=
canonicalize_qual
(
make_notclause
(
join_pred
));
...
...
src/backend/optimizer/plan/subselect.c
浏览文件 @
45a0ba86
...
...
@@ -42,7 +42,6 @@ typedef struct convert_testexpr_context
PlannerInfo
*
root
;
int
rtindex
;
/* RT index for Vars, or 0 for Params */
List
*
righthandIds
;
/* accumulated list of Vars or Param IDs */
List
*
sub_tlist
;
/* subselect targetlist (if given) */
}
convert_testexpr_context
;
typedef
struct
process_sublinks_context
...
...
@@ -561,8 +560,7 @@ build_subplan(PlannerInfo *root, Plan *plan, List *rtable,
result
=
convert_testexpr
(
root
,
testexpr
,
0
,
&
splan
->
paramIds
,
NIL
);
&
splan
->
paramIds
);
splan
->
setParam
=
list_copy
(
splan
->
paramIds
);
splan
->
is_initplan
=
true
;
...
...
@@ -596,8 +594,7 @@ build_subplan(PlannerInfo *root, Plan *plan, List *rtable,
splan
->
testexpr
=
convert_testexpr
(
root
,
testexpr
,
0
,
&
splan
->
paramIds
,
NIL
);
&
splan
->
paramIds
);
result
=
(
Node
*
)
splan
;
...
...
@@ -666,10 +663,6 @@ build_subplan(PlannerInfo *root, Plan *plan, List *rtable,
* of the Var nodes are returned in *righthandIds (this is a bit of a type
* cheat, but we can get away with it).
*
* The subquery targetlist need be supplied only if rtindex is not 0.
* We consult it to extract the correct typmods for the created Vars.
* (XXX this is a kluge that could go away if Params carried typmod.)
*
* The given testexpr has already been recursively processed by
* process_sublinks_mutator. Hence it can no longer contain any
* PARAM_SUBLINK Params for lower SubLink nodes; we can safely assume that
...
...
@@ -678,8 +671,7 @@ build_subplan(PlannerInfo *root, Plan *plan, List *rtable,
Node
*
convert_testexpr
(
PlannerInfo
*
root
,
Node
*
testexpr
,
int
rtindex
,
List
**
righthandIds
,
List
*
sub_tlist
)
List
**
righthandIds
)
{
Node
*
result
;
convert_testexpr_context
context
;
...
...
@@ -687,7 +679,6 @@ convert_testexpr(PlannerInfo *root, Node *testexpr,
context
.
root
=
root
;
context
.
rtindex
=
rtindex
;
context
.
righthandIds
=
NIL
;
context
.
sub_tlist
=
sub_tlist
;
result
=
convert_testexpr_mutator
(
testexpr
,
&
context
);
*
righthandIds
=
context
.
righthandIds
;
return
result
;
...
...
@@ -719,19 +710,6 @@ convert_testexpr_mutator(Node *node,
/* Make the Var node representing the subplan's result */
Var
*
newvar
;
/*
* XXX kluge: since Params don't carry typmod, we have to
* look into the subquery targetlist to find out the right
* typmod to assign to the Var.
*/
TargetEntry
*
ste
=
get_tle_by_resno
(
context
->
sub_tlist
,
param
->
paramid
);
if
(
ste
==
NULL
||
ste
->
resjunk
)
elog
(
ERROR
,
"subquery output %d not found"
,
param
->
paramid
);
Assert
(
param
->
paramtype
==
exprType
((
Node
*
)
ste
->
expr
));
newvar
=
makeVar
(
context
->
rtindex
,
param
->
paramid
,
param
->
paramtype
,
...
...
src/include/optimizer/subselect.h
浏览文件 @
45a0ba86
...
...
@@ -16,8 +16,7 @@
#include "nodes/plannodes.h"
#include "nodes/relation.h"
extern
Node
*
convert_testexpr
(
PlannerInfo
*
root
,
Node
*
testexpr
,
int
rtindex
,
List
**
righthandIds
,
List
*
sub_tlist
);
extern
Node
*
convert_testexpr
(
PlannerInfo
*
root
,
Node
*
testexpr
,
int
rtindex
,
List
**
righthandIds
);
extern
Node
*
SS_replace_correlation_vars
(
PlannerInfo
*
root
,
Node
*
expr
);
extern
Node
*
SS_process_sublinks
(
PlannerInfo
*
root
,
Node
*
expr
,
bool
isQual
);
extern
void
SS_finalize_plan
(
PlannerInfo
*
root
,
List
*
rtable
,
Plan
*
plan
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录