Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
06c52b50
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
06c52b50
编写于
8月 26, 2021
作者:
A
a1iive
提交者:
GitHub
8月 26, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(ob_error): add forward mapping information of OB error code (#327)
上级
d1cd5d47
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
86 addition
and
2 deletion
+86
-2
tools/ob_error/src/ob_error.cpp
tools/ob_error/src/ob_error.cpp
+41
-2
tools/ob_error/test/expect_result.result
tools/ob_error/test/expect_result.result
+41
-0
tools/ob_error/test/ob_error_test.test
tools/ob_error/test/ob_error_test.test
+4
-0
未找到文件。
tools/ob_error/src/ob_error.cpp
浏览文件 @
06c52b50
...
...
@@ -156,6 +156,12 @@ void ObErrorInfoMgr::print_oracle_error()
}
}
static
bool
is_special_oracle_error_compatible
(
int
ob_error_code
)
{
// These three errors have no argument in Oracle error msg
return
OB_AUTOINC_SERVICE_BUSY
==
ob_error_code
||
OB_ROWID_TYPE_MISMATCH
==
ob_error_code
||
OB_ROWID_NUM_MISMATCH
==
ob_error_code
;
}
bool
ObErrorInfoMgr
::
insert_ob_error
(
const
char
*
name
,
const
char
*
msg
,
const
char
*
cause
,
const
char
*
solution
,
int
error_code
)
{
...
...
@@ -190,6 +196,40 @@ void ObErrorInfoMgr::print_ob_error()
ob_error_
[
i
].
error_msg_
,
ob_error_
[
i
].
cause_
,
ob_error_
[
i
].
solution_
);
static
const
char
*
compatiable_header
=
"Compatible Error Code:"
;
bool
is_compat_header_printed
=
false
;
int
ob_error_code
=
-
ob_error_
[
i
].
error_code_
;
int
mysql_errno
=
ob_mysql_errno
(
ob_error_code
);
if
(
-
1
!=
mysql_errno
)
{
const
char
*
sqlstate
=
ob_sqlstate
(
ob_error_code
);
printf
(
"
\t
%s
\n
"
,
compatiable_header
);
is_compat_header_printed
=
true
;
printf
(
"
\t\t
MySQL: %d(%s)
\n
"
,
mysql_errno
,
sqlstate
);
}
bool
need_oracle_print
=
false
;
int
oracle_errno
=
ob_errpkt_errno
(
ob_error_code
,
true
);
if
(
oracle_errno
!=
-
ob_error_code
)
{
if
(
ORACLE_SPECIAL_ERROR_CODE
==
oracle_errno
)
{
// Compatible error for ORA-00600
if
(
is_special_oracle_error_compatible
(
ob_error_code
))
{
need_oracle_print
=
true
;
}
}
else
{
need_oracle_print
=
true
;
}
if
(
need_oracle_print
)
{
const
char
*
oracle_err_msg
=
ob_errpkt_strerror
(
ob_error_code
,
true
);
if
(
nullptr
!=
oracle_err_msg
)
{
if
(
false
==
is_compat_header_printed
)
{
printf
(
"
\t
%s
\n
"
,
compatiable_header
);
is_compat_header_printed
=
true
;
}
char
oracle_error_code
[
ORACLE_MSG_PREFIX
]
=
{
0
};
strncpy
(
oracle_error_code
,
oracle_err_msg
,
ORACLE_MSG_PREFIX
-
2
);
printf
(
"
\t\t
Oracle: %s
\n
"
,
oracle_error_code
);
}
}
}
}
}
//////////////////////////////////////////////////////////////
...
...
@@ -630,8 +670,7 @@ static bool insert_oracle_error_slot_ora(int err_map[][OB_MAX_SAME_ERROR_COUNT],
if
(
-
1
==
err_map
[
error_code
][
k
])
{
if
(
ORACLE_SPECIAL_ERROR_CODE
==
error_code
)
{
// Compatible error for ORA-00600
if
(
OB_AUTOINC_SERVICE_BUSY
==
-
ob_error
||
OB_ROWID_TYPE_MISMATCH
==
-
ob_error
||
OB_ROWID_NUM_MISMATCH
==
-
ob_error
)
{
if
(
is_special_oracle_error_compatible
(
-
ob_error
))
{
err_map
[
error_code
][
k
]
=
ob_error
;
}
}
else
{
...
...
tools/ob_error/test/expect_result.result
浏览文件 @
06c52b50
...
...
@@ -47,6 +47,8 @@ OceanBase:
Message: Conflicting declarations
Cause: Internal Error
Solution: Contact OceanBase Support
Compatible Error Code:
MySQL: 1302(42000)
$ob_error 4001
OceanBase:
...
...
@@ -123,6 +125,43 @@ MySQL:
OB_INVALID_ARGUMENT(-4002)
OB_MISS_ARGUMENT(-4277)
INCORRECT_ARGUMENTS_TO_ESCAPE(-5832)
$ob_error 5794
OceanBase:
OceanBase Error Code: OB_AUTOINC_SERVICE_BUSY(-5794)
Message: auto increment service busy
Cause: Internal Error
Solution: Contact OceanBase Support
Compatible Error Code:
Oracle: ORA-00600
$ob_error 5870
OceanBase:
OceanBase Error Code: OB_ROWID_TYPE_MISMATCH(-5870)
Message: rowid type mismatch
Cause: Internal Error
Solution: Contact OceanBase Support
Compatible Error Code:
Oracle: ORA-00600
$ob_error 5871
OceanBase:
OceanBase Error Code: OB_ROWID_NUM_MISMATCH(-5871)
Message: rowid num mismatch
Cause: Internal Error
Solution: Contact OceanBase Support
Compatible Error Code:
Oracle: ORA-00600
$ob_error 4228
OceanBase:
OceanBase Error Code: OB_ERR_FIELD_SPECIFIED_TWICE(-4228)
Message: Column specified twice
Cause: Internal Error
Solution: Contact OceanBase Support
Compatible Error Code:
MySQL: 1110(42000)
Oracle: ORA-00957
$ob_error 700 -a 1000
error: '-a ARG' is unsupport in this scene
Use 'ob_error ora 600 -a ARG'.
...
...
@@ -179,6 +218,8 @@ OceanBase:
Message: Conflicting declarations
Cause: Internal Error
Solution: Contact OceanBase Support
Compatible Error Code:
MySQL: 1302(42000)
Oracle:
Oracle Error Code: ORA-00600
...
...
tools/ob_error/test/ob_error_test.test
浏览文件 @
06c52b50
...
...
@@ -10,6 +10,10 @@ ob_error 24761
ob_error
5727
ob_error
5133
ob_error
1210
ob_error
5794
ob_error
5870
ob_error
5871
ob_error
4228
ob_error
700
-
a
1000
ob_error
my
6000
ob_error
my
4000
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录