diff --git a/tools/ob_error/README.md b/tools/ob_error/README.md index 3f0e545c3..5041e8b04 100644 --- a/tools/ob_error/README.md +++ b/tools/ob_error/README.md @@ -156,7 +156,7 @@ If you want to add the cause and solution info, you can change the define as DEFINE_ERROR(OB_ERROR, -4000, -1, "HY000", "Common error", "CAUSE", "SOLUTION"); ``` -And then regenerate the `src/lib/oberror_errno.h`、`src/oberror_errno.h` and `src/oberror_errno.cpp` by +And then regenerate the `src/lib/ob_errno.h`、`src/share/ob_errno.h` and `src/share/ob_errno.cpp` by ```shell cd src/share diff --git a/tools/ob_error/src/ob_error.cpp b/tools/ob_error/src/ob_error.cpp index 897a500a9..67720e18b 100644 --- a/tools/ob_error/src/ob_error.cpp +++ b/tools/ob_error/src/ob_error.cpp @@ -351,7 +351,7 @@ bool add_ob_info(int error_code, ObErrorInfoMgr* mgr) if (mgr->insert_ob_error(error_name, error_msg, error_cause, error_solution, error_code)) { bret = true; } - } else if (-1 == g_mysql_error[error_code][0]) { + } else { const char* error_usr_msg = ob_errpkt_str_user_error(-error_code, false); if (nullptr != error_usr_msg) { const char* error_msg = ob_errpkt_strerror(-error_code, false); diff --git a/tools/ob_error/test/expect_result.result b/tools/ob_error/test/expect_result.result index ade34a4a1..22dc8be04 100644 --- a/tools/ob_error/test/expect_result.result +++ b/tools/ob_error/test/expect_result.result @@ -101,6 +101,12 @@ OceanBase: Solution: Contact OceanBase Support $ob_error 5133 +OceanBase: + OceanBase Error Code: OB_ERR_NO_GRANT(-5133) + Message: No such grant defined + Cause: Internal Error + Solution: Contact OceanBase Support + MySQL: MySQL Error Code: 5133 (42000) Message: No such grant defined