Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
ce5da320
O
oceanbase
项目概览
Metz
/
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看板
提交
ce5da320
编写于
8月 12, 2021
作者:
R
rq0
提交者:
wangzelin.wzl
8月 12, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix size_overflow bug in distributed update
上级
ce819f8b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
19 addition
and
11 deletion
+19
-11
src/sql/optimizer/ob_log_update.cpp
src/sql/optimizer/ob_log_update.cpp
+4
-2
src/sql/resolver/expr/ob_raw_expr_util.cpp
src/sql/resolver/expr/ob_raw_expr_util.cpp
+10
-6
src/sql/resolver/expr/ob_raw_expr_util.h
src/sql/resolver/expr/ob_raw_expr_util.h
+5
-3
未找到文件。
src/sql/optimizer/ob_log_update.cpp
浏览文件 @
ce5da320
...
...
@@ -204,20 +204,22 @@ int ObLogUpdate::allocate_exchange_post(AllocExchContext* ctx)
LOG_WARN
(
"fail to copy subpart expr"
,
K
(
ret
));
}
else
{
CK
(
PARTITION_LEVEL_MAX
!=
part_level
);
ObArray
<
ObRawExpr
*>
value_exprs
;
for
(
int64_t
assign_idx
=
0
;
OB_SUCC
(
ret
)
&&
assign_idx
<
index_infos
.
at
(
i
).
assignments_
.
count
();
assign_idx
++
)
{
ObColumnRefRawExpr
*
col
=
index_infos
.
at
(
i
).
assignments_
.
at
(
assign_idx
).
column_expr_
;
ObRawExpr
*
value
=
index_infos
.
at
(
i
).
assignments_
.
at
(
assign_idx
).
expr_
;
if
(
PARTITION_LEVEL_ZERO
!=
part_level
)
{
if
(
OB_FAIL
(
ObRawExprUtils
::
replace_ref_column
(
new_part_expr
,
col
,
value
)))
{
if
(
OB_FAIL
(
ObRawExprUtils
::
replace_ref_column
(
new_part_expr
,
col
,
value
,
NULL
,
&
value_exprs
)))
{
LOG_WARN
(
"fail to replace ref column"
,
K
(
ret
));
}
}
if
(
PARTITION_LEVEL_TWO
==
part_level
)
{
if
(
OB_FAIL
(
ObRawExprUtils
::
replace_ref_column
(
new_subpart_expr
,
col
,
value
)))
{
if
(
OB_FAIL
(
ObRawExprUtils
::
replace_ref_column
(
new_subpart_expr
,
col
,
value
,
NULL
,
&
value_exprs
)))
{
LOG_WARN
(
"fail to replace ref column"
,
K
(
ret
));
}
}
OZ
(
value_exprs
.
push_back
(
index_infos
.
at
(
i
).
assignments_
.
at
(
assign_idx
).
expr_
));
}
// for assignments end
}
if
(
OB_SUCC
(
ret
))
{
...
...
src/sql/resolver/expr/ob_raw_expr_util.cpp
浏览文件 @
ce5da320
...
...
@@ -1412,8 +1412,9 @@ int ObRawExprUtils::replace_all_ref_column(
}
// if %expr_factory is not NULL, will deep copy %to expr. default behavior is shallow copy
int
ObRawExprUtils
::
replace_ref_column
(
ObRawExpr
*&
raw_expr
,
ObRawExpr
*
from
,
ObRawExpr
*
to
,
ObRawExprFactory
*
expr_factory
)
// if except_exprs is not NULL, will skip the expr in except_exprs
int
ObRawExprUtils
::
replace_ref_column
(
ObRawExpr
*&
raw_expr
,
ObRawExpr
*
from
,
ObRawExpr
*
to
,
ObRawExprFactory
*
expr_factory
,
const
ObIArray
<
ObRawExpr
*>*
except_exprs
)
{
int
ret
=
OB_SUCCESS
;
if
(
OB_ISNULL
(
raw_expr
)
||
OB_ISNULL
(
from
)
||
OB_ISNULL
(
to
))
{
...
...
@@ -1423,6 +1424,8 @@ int ObRawExprUtils::replace_ref_column(
// do nothing
// in case: parent(child) = to (from)
// replace as: parenet(child) = to (to)
}
else
if
(
NULL
!=
except_exprs
&&
is_contain
(
*
except_exprs
,
raw_expr
))
{
// do nothing
}
else
if
(
raw_expr
==
from
)
{
if
(
NULL
!=
expr_factory
)
{
ObRawExpr
*
new_to
=
NULL
;
...
...
@@ -1446,14 +1449,14 @@ int ObRawExprUtils::replace_ref_column(
LOG_WARN
(
"get unexpected null"
,
K
(
ret
),
K
(
ref_stmt
));
}
else
if
(
OB_FAIL
(
ref_stmt
->
get_relation_exprs
(
relation_exprs
)))
{
LOG_WARN
(
"failed to get relation exprs"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
SMART_CALL
(
replace_ref_column
(
relation_exprs
,
from
,
to
))))
{
}
else
if
(
OB_FAIL
(
SMART_CALL
(
replace_ref_column
(
relation_exprs
,
from
,
to
,
except_exprs
))))
{
LOG_WARN
(
"replace reference column failed"
,
K
(
ret
));
}
}
else
{
int64_t
N
=
raw_expr
->
get_param_count
();
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
N
;
++
i
)
{
ObRawExpr
*&
child_expr
=
raw_expr
->
get_param_expr
(
i
);
if
(
OB_FAIL
(
SMART_CALL
(
replace_ref_column
(
child_expr
,
from
,
to
,
expr_factory
))))
{
if
(
OB_FAIL
(
SMART_CALL
(
replace_ref_column
(
child_expr
,
from
,
to
,
expr_factory
,
except_exprs
))))
{
LOG_WARN
(
"replace reference column failed"
,
K
(
ret
));
}
}
// end for
...
...
@@ -1461,7 +1464,8 @@ int ObRawExprUtils::replace_ref_column(
return
ret
;
}
int
ObRawExprUtils
::
replace_ref_column
(
ObIArray
<
ObRawExpr
*>&
exprs
,
ObRawExpr
*
from
,
ObRawExpr
*
to
)
int
ObRawExprUtils
::
replace_ref_column
(
ObIArray
<
ObRawExpr
*>&
exprs
,
ObRawExpr
*
from
,
ObRawExpr
*
to
,
const
ObIArray
<
ObRawExpr
*>*
except_exprs
)
{
int
ret
=
OB_SUCCESS
;
bool
is_stack_overflow
=
false
;
...
...
@@ -1479,7 +1483,7 @@ int ObRawExprUtils::replace_ref_column(ObIArray<ObRawExpr*>& exprs, ObRawExpr* f
ObRawExpr
*&
raw_expr
=
tmp_raw_expr
;
if
(
OB_FAIL
(
exprs
.
at
(
i
,
raw_expr
)))
{
LOG_WARN
(
"failed to get raw expr"
,
K
(
i
),
K
(
ret
));
}
else
if
(
OB_FAIL
(
SMART_CALL
(
replace_ref_column
(
raw_expr
,
from
,
to
))))
{
}
else
if
(
OB_FAIL
(
SMART_CALL
(
replace_ref_column
(
raw_expr
,
from
,
to
,
NULL
,
except_exprs
))))
{
LOG_WARN
(
"failed to replace_ref_column"
,
K
(
from
),
K
(
to
),
K
(
ret
));
}
else
{
/*do nothing*/
}
...
...
src/sql/resolver/expr/ob_raw_expr_util.h
浏览文件 @
ce5da320
...
...
@@ -211,10 +211,12 @@ public:
/// replace all `from' to `to' in the raw_expr
static
int
replace_all_ref_column
(
ObRawExpr
*&
raw_expr
,
const
common
::
ObIArray
<
ObRawExpr
*>&
exprs
,
int64_t
&
offset
);
// if %expr_factory is not NULL, will deep copy %to expr. default behavior is shallow copy
static
int
replace_ref_column
(
ObRawExpr
*&
raw_expr
,
ObRawExpr
*
from
,
ObRawExpr
*
to
,
ObRawExprFactory
*
expr_factory
=
NULL
);
// if except_exprs is not NULL, will skip the expr in except_exprs
static
int
replace_ref_column
(
ObRawExpr
*&
raw_expr
,
ObRawExpr
*
from
,
ObRawExpr
*
to
,
ObRawExprFactory
*
expr_factory
=
NULL
,
const
ObIArray
<
ObRawExpr
*>*
except_exprs
=
NULL
);
static
int
replace_level_column
(
ObRawExpr
*&
raw_expr
,
ObRawExpr
*
to
,
bool
&
replaced
);
static
int
replace_ref_column
(
common
::
ObIArray
<
ObRawExpr
*>&
exprs
,
ObRawExpr
*
from
,
ObRawExpr
*
to
);
static
int
replace_ref_column
(
common
::
ObIArray
<
ObRawExpr
*>&
exprs
,
ObRawExpr
*
from
,
ObRawExpr
*
to
,
const
ObIArray
<
ObRawExpr
*>*
except_exprs
=
NULL
);
static
bool
all_column_exprs
(
const
common
::
ObIArray
<
ObRawExpr
*>&
exprs
);
/// extract column exprs from the raw expr
static
int
extract_column_exprs
(
const
ObRawExpr
*
raw_expr
,
common
::
ObIArray
<
ObRawExpr
*>&
column_exprs
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录