Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
3ef3fad8
O
oceanbase
项目概览
clmforever
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3ef3fad8
编写于
11月 23, 2022
作者:
Z
zzg19950727
提交者:
wangzelin.wzl
11月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix temp table access location constraint bug
上级
dc95d872
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
1 deletion
+48
-1
src/sql/optimizer/ob_log_temp_table_access.cpp
src/sql/optimizer/ob_log_temp_table_access.cpp
+31
-0
src/sql/optimizer/ob_log_temp_table_access.h
src/sql/optimizer/ob_log_temp_table_access.h
+3
-0
src/sql/optimizer/ob_logical_operator.cpp
src/sql/optimizer/ob_logical_operator.cpp
+13
-0
src/sql/resolver/dml/ob_dml_stmt.cpp
src/sql/resolver/dml/ob_dml_stmt.cpp
+1
-1
未找到文件。
src/sql/optimizer/ob_log_temp_table_access.cpp
浏览文件 @
3ef3fad8
...
...
@@ -159,3 +159,34 @@ int ObLogTempTableAccess::print_my_plan_annotation(char *buf,
}
return
ret
;
}
int
ObLogTempTableAccess
::
get_temp_table_plan
(
ObLogicalOperator
*&
insert_op
)
{
int
ret
=
OB_SUCCESS
;
insert_op
=
NULL
;
ObLogPlan
*
plan
=
get_plan
();
const
uint64_t
temp_table_id
=
get_temp_table_id
();
if
(
OB_ISNULL
(
plan
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_ERROR
(
"unexpected null"
,
K
(
ret
));
}
else
{
ObIArray
<
ObSqlTempTableInfo
*>
&
temp_tables
=
plan
->
get_optimizer_context
().
get_temp_table_infos
();
bool
find
=
false
;
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
!
find
&&
i
<
temp_tables
.
count
();
++
i
)
{
if
(
OB_ISNULL
(
temp_tables
.
at
(
i
)))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_ERROR
(
"unexpected null"
,
K
(
ret
));
}
else
if
(
temp_table_id
!=
temp_tables
.
at
(
i
)
->
temp_table_id_
)
{
/* do nothing */
}
else
{
find
=
true
;
insert_op
=
temp_tables
.
at
(
i
)
->
table_plan_
;
}
}
if
(
OB_SUCC
(
ret
)
&&
!
find
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_ERROR
(
"failed to find table plan"
,
K
(
ret
));
}
}
return
ret
;
}
src/sql/optimizer/ob_log_temp_table_access.h
浏览文件 @
3ef3fad8
...
...
@@ -45,6 +45,9 @@ public:
int64_t
&
buf_len
,
int64_t
&
pos
,
ExplainType
type
);
int
get_temp_table_plan
(
ObLogicalOperator
*&
insert_op
);
private:
DISALLOW_COPY_AND_ASSIGN
(
ObLogTempTableAccess
);
...
...
src/sql/optimizer/ob_logical_operator.cpp
浏览文件 @
3ef3fad8
...
...
@@ -2848,6 +2848,19 @@ int ObLogicalOperator::gen_location_constraint(void *ctx)
loc_cons_ctx
->
base_table_constraints_
.
count
()
-
1
)))
{
LOG_WARN
(
"failed to push back location constraint offset"
,
K
(
ret
));
}
}
else
if
(
log_op_def
::
LOG_TEMP_TABLE_ACCESS
==
get_type
())
{
ObLogTempTableAccess
*
access
=
static_cast
<
ObLogTempTableAccess
*>
(
this
);
ObLogicalOperator
*
insert_op
=
NULL
;
if
(
OB_FAIL
(
access
->
get_temp_table_plan
(
insert_op
)))
{
LOG_WARN
(
"failed to get temp table plan"
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
insert_op
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"unexpect null operator"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
append
(
strict_pwj_constraint_
,
insert_op
->
strict_pwj_constraint_
)))
{
LOG_WARN
(
"failed to append child pwj constraint"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
append
(
non_strict_pwj_constraint_
,
insert_op
->
non_strict_pwj_constraint_
)))
{
LOG_WARN
(
"failed to append child pwj constraint"
,
K
(
ret
));
}
}
}
else
if
(
get_num_of_child
()
>
0
)
{
/**
...
...
src/sql/resolver/dml/ob_dml_stmt.cpp
浏览文件 @
3ef3fad8
...
...
@@ -2119,7 +2119,7 @@ int ObDMLStmt::remove_useless_sharable_expr()
}
else
if
(
OB_FAIL
(
column_items_
.
remove
(
i
)))
{
LOG_WARN
(
"failed to remove column item"
,
K
(
ret
));
}
else
{
LOG_TRACE
(
"succeed to remove column items"
,
K
(
*
expr
),
K
(
lbt
()));
LOG_TRACE
(
"succeed to remove column items"
,
K
(
expr
),
K
(
lbt
()));
}
}
for
(
int64_t
i
=
subquery_exprs_
.
count
()
-
1
;
OB_SUCC
(
ret
)
&&
i
>=
0
;
i
--
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录