Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
9875d033
O
oceanbase
项目概览
野花太放肆
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
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,体验更适合开发者的 AI 搜索 >>
提交
9875d033
编写于
11月 14, 2022
作者:
H
Hongqin-Li
提交者:
wangzelin.wzl
11月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix forgot to switch status and errcode overwrite
上级
8aa5f184
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
55 addition
and
39 deletion
+55
-39
src/rootserver/ddl_task/ob_column_redefinition_task.cpp
src/rootserver/ddl_task/ob_column_redefinition_task.cpp
+9
-1
src/rootserver/ddl_task/ob_table_redefinition_task.cpp
src/rootserver/ddl_task/ob_table_redefinition_task.cpp
+41
-33
src/sql/engine/expr/ob_expr_to_outfile_row.cpp
src/sql/engine/expr/ob_expr_to_outfile_row.cpp
+5
-5
未找到文件。
src/rootserver/ddl_task/ob_column_redefinition_task.cpp
浏览文件 @
9875d033
...
...
@@ -419,6 +419,7 @@ int ObColumnRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
int
ret
=
OB_SUCCESS
;
ObRootService
*
root_service
=
GCTX
.
root_service_
;
int64_t
finished_task_cnt
=
0
;
bool
state_finish
=
false
;
ObSchemaGetterGuard
schema_guard
;
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
...
...
@@ -436,7 +437,11 @@ int ObColumnRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
}
else
if
(
OB_FAIL
(
copy_table_foreign_keys
()))
{
LOG_WARN
(
"fail to copy table foreign keys"
,
K
(
ret
));
}
}
if
(
OB_FAIL
(
ret
))
{
state_finish
=
true
;
}
else
{
// wait copy dependent objects to be finished
ObAddr
unused_addr
;
for
(
common
::
hash
::
ObHashMap
<
ObDDLTaskKey
,
DependTaskStatus
>::
const_iterator
iter
=
dependent_task_result_map_
.
begin
();
...
...
@@ -471,8 +476,11 @@ int ObColumnRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
}
}
}
if
(
finished_task_cnt
==
dependent_task_result_map_
.
size
())
{
state_finish
=
true
;
}
}
if
(
finished_task_cnt
==
dependent_task_result_map_
.
size
()
)
{
if
(
state_finish
)
{
if
(
OB_FAIL
(
switch_status
(
next_task_status
,
ret
)))
{
LOG_WARN
(
"fail to switch status"
,
K
(
ret
));
}
...
...
src/rootserver/ddl_task/ob_table_redefinition_task.cpp
浏览文件 @
9875d033
...
...
@@ -524,6 +524,7 @@ int ObTableRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
int
ret
=
OB_SUCCESS
;
ObRootService
*
root_service
=
GCTX
.
root_service_
;
int64_t
finished_task_cnt
=
0
;
bool
state_finish
=
false
;
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObTableRedefinitionTask has not been inited"
,
K
(
ret
));
...
...
@@ -541,47 +542,54 @@ int ObTableRedefinitionTask::copy_table_dependent_objects(const ObDDLTaskStatus
LOG_WARN
(
"copy table foreign keys failed"
,
K
(
ret
));
}
else
{
// copy triggers(at current, not supported, skip it)
}
}
// wait copy dependent objects to be finished
ObAddr
unused_addr
;
for
(
common
::
hash
::
ObHashMap
<
ObDDLTaskKey
,
DependTaskStatus
>::
const_iterator
iter
=
dependent_task_result_map_
.
begin
();
iter
!=
dependent_task_result_map_
.
end
();
++
iter
)
{
const
int64_t
table_id
=
iter
->
first
.
object_id_
;
const
int64_t
schema_version
=
iter
->
first
.
schema_version_
;
const
int64_t
target_object_id
=
-
1
;
const
int64_t
child_task_id
=
iter
->
second
.
task
_id_
;
if
(
iter
->
second
.
ret_code_
==
INT64_MAX
)
{
// maybe ddl already finish when switching rs
HEAP_VAR
(
ObDDLErrorMessageTableOperator
::
ObBuildDDLErrorMessage
,
error_message
)
{
int64_t
unused_user_msg_len
=
0
;
if
(
OB_FAIL
(
ObDDLErrorMessageTableOperator
::
get_ddl_error_message
(
tenant_id_
,
child_task_id
,
target_object_id
,
unused_addr
,
false
/* is_ddl_retry_task */
,
*
GCTX
.
sql_proxy_
,
error_message
,
unused_user_msg_len
))
)
{
if
(
OB_ENTRY_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
LOG_INFO
(
"ddl task not finish"
,
K
(
table_id
),
K
(
child_task_id
),
K
(
schema_version
),
K
(
target_object_id
));
}
else
{
LOG_WARN
(
"fail to get ddl error message"
,
K
(
ret
),
K
(
table_id
),
K
(
child_task_id
),
K
(
schema_version
),
K
(
target_object_id
))
;
}
if
(
OB_FAIL
(
ret
))
{
state_finish
=
true
;
}
else
{
// wait copy dependent objects to be finished
ObAddr
unused_addr
;
for
(
common
::
hash
::
ObHashMap
<
ObDDLTaskKey
,
DependTaskStatus
>::
const_iterator
iter
=
dependent_task_result_map_
.
begin
()
;
iter
!=
dependent_task_result_map_
.
end
();
++
iter
)
{
const
int64_t
table_id
=
iter
->
first
.
object
_id_
;
const
int64_t
schema_version
=
iter
->
first
.
schema_version_
;
const
int64_t
target_object_id
=
-
1
;
const
int64_t
child_task_id
=
iter
->
second
.
task_id_
;
if
(
iter
->
second
.
ret_code_
==
INT64_MAX
)
{
// maybe ddl already finish when switching rs
HEAP_VAR
(
ObDDLErrorMessageTableOperator
::
ObBuildDDLErrorMessage
,
error_message
)
{
int64_t
unused_user_msg_len
=
0
;
if
(
OB_FAIL
(
ObDDLErrorMessageTableOperator
::
get_ddl_error_message
(
tenant_id_
,
child_task_id
,
target_object_id
,
unused_addr
,
false
/* is_ddl_retry_task */
,
*
GCTX
.
sql_proxy_
,
error_message
,
unused_user_msg_len
)))
{
if
(
OB_ENTRY_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
LOG_INFO
(
"ddl task not finish"
,
K
(
table_id
),
K
(
child_task_id
),
K
(
schema_version
),
K
(
target_object_id
));
}
else
{
finished_task_cnt
++
;
if
(
error_message
.
ret_code_
!=
OB_SUCCESS
)
{
ret
=
error_message
.
ret_code_
;
}
LOG_WARN
(
"fail to get ddl error message"
,
K
(
ret
),
K
(
table_id
),
K
(
child_task_id
),
K
(
schema_version
),
K
(
target_object_id
));
}
}
else
{
finished_task_cnt
++
;
if
(
error_message
.
ret_code_
!=
OB_SUCCESS
)
{
ret
=
error_message
.
ret_code_
;
}
}
}
else
{
finished_task_cnt
++
;
if
(
iter
->
second
.
ret_code_
!=
OB_SUCCESS
)
{
ret
=
iter
->
second
.
ret_code_
;
}
}
}
if
(
finished_task_cnt
==
dependent_task_result_map_
.
size
())
{
if
(
OB_FAIL
(
switch_status
(
next_task_status
,
ret
))
)
{
LOG_WARN
(
"fail to switch status"
,
K
(
ret
))
;
}
else
{
finished_task_cnt
++
;
if
(
iter
->
second
.
ret_code_
!=
OB_SUCCESS
)
{
ret
=
iter
->
second
.
ret_code_
;
}
}
}
if
(
finished_task_cnt
==
dependent_task_result_map_
.
size
())
{
state_finish
=
true
;
}
}
if
(
state_finish
)
{
if
(
OB_FAIL
(
switch_status
(
next_task_status
,
ret
)))
{
LOG_WARN
(
"fail to switch status"
,
K
(
ret
));
}
}
return
ret
;
}
...
...
src/sql/engine/expr/ob_expr_to_outfile_row.cpp
浏览文件 @
9875d033
...
...
@@ -67,8 +67,8 @@ int ObExprToOutfileRow::calc_result_typeN(ObExprResType &type,
types
[
PARAM_ENCLOSED
].
set_calc_type
(
ObVarcharType
);
types
[
PARAM_ENCLOSED
].
set_calc_collation_type
(
types
[
PARAM_ENCLOSED
].
get_collation_type
());
// is_optional
types
[
PARAM_OPTIONAL
].
set_calc_type
(
ObTinyIntType
);
// escaped_cht
types
[
PARAM_OPTIONAL
].
set_calc_type
(
ObTinyIntType
);
// escaped_cht
types
[
PARAM_ESCAPED
].
set_calc_type
(
ObVarcharType
);
types
[
PARAM_ESCAPED
].
set_calc_collation_type
(
types
[
PARAM_ESCAPED
].
get_collation_type
());
}
...
...
@@ -184,9 +184,9 @@ int ObExprToOutfileRow::to_outfile_str(const ObExpr &expr, ObEvalCtx &ctx, ObDat
// print field terminator
if
(
OB_SUCC
(
ret
)
&&
i
!=
expr
.
arg_cnt_
-
1
)
{
OZ
(
out_info
->
field_
.
print_plain_str_literal
(
buf
,
buf_len
,
pos
,
out_info
->
print_params_
));
}
}
OZ
(
out_info
->
line_
.
print_plain_str_literal
(
buf
,
buf_len
,
pos
,
out_info
->
print_params_
));
}
}
OZ
(
out_info
->
line_
.
print_plain_str_literal
(
buf
,
buf_len
,
pos
,
out_info
->
print_params_
));
if
(
OB_SUCC
(
ret
))
{
char
*
res_buf
=
NULL
;
if
(
OB_ISNULL
(
res_buf
=
expr
.
get_str_res_mem
(
ctx
,
pos
)))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录