[to #2024071000103617366]In MySQL mode, if pl objects cannot be added to the cache, a warning will be displayed.

This commit is contained in:
swjtu-wenxiang 2024-10-08 21:15:58 +00:00 committed by ob-robot
parent 7c655f1ea0
commit 52bb0d5b29
4 changed files with 27 additions and 5 deletions

View File

@ -1599,7 +1599,10 @@ int ObPL::execute(ObExecContext &ctx,
CK (OB_NOT_NULL(result));
OX (*result = local_result);
}
if(OB_SUCC(ret) && lib::is_mysql_mode() && !routine.get_can_cached()) {
LOG_USER_WARN(OB_ERR_COMPILE_RESULT_NOT_ADD_CACHE, routine.get_function_name().length(), routine.get_function_name().ptr());
LOG_WARN("The compilation result cannot be added to the cache", K(routine.get_function_name()));
}
//当前层 pl 执行时间
int64_t execute_end = ObTimeUtility::current_time();
pl.add_pl_exec_time(execute_end - execute_start - pl.get_pure_sql_exec_time(), is_called_from_sql);

File diff suppressed because one or more lines are too long

View File

@ -2667,7 +2667,7 @@ DEFINE_ORACLE_ERROR_EXT(OB_UTL_SMTP_PERMANENT_ERROR, -9796, -1, "HY000", "SMTP p
DEFINE_ORACLE_ERROR_EXT(OB_UTL_SMTP_UNSUPPORTED_SCHEME, -9797, -1, "HY000", "Authentication scheme '' not supported", "Authentication scheme '%.*s' not supported", 24249, "Authentication scheme '' not supported", "Authentication scheme '%.*s' not supported");
DEFINE_ORACLE_ERROR(OB_UTL_SMTP_NO_SUPPORTED_SCHEME, -9798, -1, "HY000", "No supported authentication scheme found", 24250, "No supported authentication scheme found");
DEFINE_ERROR(OB_DTL_WAIT_EAGAIN, -9799, -1, "HY000", "Px wait for dtl message again");
DEFINE_ERROR_EXT(OB_ERR_COMPILE_RESULT_NOT_ADD_CACHE, -9800, -1, "HY000", "Throw this warning means that the user has handled some MySQL exceptions which may cause performance problems.", "To be compatible with MySQL, if an exception occurs when compiling an OB PL object (such as the object does not exist or a parameter mismatch), the relevant statement will be converted to a statement that throws an exception, and compiled object cannot be added to the cache, which may cause performance problems. User should create or redefine the pl object of the problem indicated in the warning until the warning is eliminated. Problem object name: '%.*s'");
//
////////////////////////////////////////////////////////////////
// PL/SQL错误码值域 [-9500, -10000)

View File

@ -1888,6 +1888,7 @@ constexpr int OB_UTL_SMTP_PERMANENT_ERROR = -9796;
constexpr int OB_UTL_SMTP_UNSUPPORTED_SCHEME = -9797;
constexpr int OB_UTL_SMTP_NO_SUPPORTED_SCHEME = -9798;
constexpr int OB_DTL_WAIT_EAGAIN = -9799;
constexpr int OB_ERR_COMPILE_RESULT_NOT_ADD_CACHE = -9800;
constexpr int OB_ERR_KV_GLOBAL_INDEX_ROUTE = -10500;
constexpr int OB_TTL_NOT_ENABLE = -10501;
constexpr int OB_TTL_COLUMN_NOT_EXIST = -10502;
@ -4213,6 +4214,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_UTL_SMTP_UNSUPPORTED_SCHEME__USER_ERROR_MSG "Authentication scheme '%.*s' not supported"
#define OB_UTL_SMTP_NO_SUPPORTED_SCHEME__USER_ERROR_MSG "No supported authentication scheme found"
#define OB_DTL_WAIT_EAGAIN__USER_ERROR_MSG "Px wait for dtl message again"
#define OB_ERR_COMPILE_RESULT_NOT_ADD_CACHE__USER_ERROR_MSG "To be compatible with MySQL, if an exception occurs when compiling an OB PL object (such as the object does not exist or a parameter mismatch), the relevant statement will be converted to a statement that throws an exception, and compiled object cannot be added to the cache, which may cause performance problems. User should create or redefine the pl object of the problem indicated in the warning until the warning is eliminated. Problem object name: '%.*s'"
#define OB_ERR_KV_GLOBAL_INDEX_ROUTE__USER_ERROR_MSG "incorrect route for obkv global index, client router should refresh."
#define OB_TTL_NOT_ENABLE__USER_ERROR_MSG "TTL feature is not enabled"
#define OB_TTL_COLUMN_NOT_EXIST__USER_ERROR_MSG "TTL column '%.*s' not exists"
@ -8842,6 +8844,8 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_UTL_SMTP_NO_SUPPORTED_SCHEME__OBE_USER_ERROR_MSG "OBE-24250: No supported authentication scheme found"
#define OB_DTL_WAIT_EAGAIN__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9799, Px wait for dtl message again"
#define OB_DTL_WAIT_EAGAIN__OBE_USER_ERROR_MSG "OBE-00600: internal error code, arguments: -9799, Px wait for dtl message again"
#define OB_ERR_COMPILE_RESULT_NOT_ADD_CACHE__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9800, To be compatible with MySQL, if an exception occurs when compiling an OB PL object (such as the object does not exist or a parameter mismatch), the relevant statement will be converted to a statement that throws an exception, and compiled object cannot be added to the cache, which may cause performance problems. User should create or redefine the pl object of the problem indicated in the warning until the warning is eliminated. Problem object name: '%.*s'"
#define OB_ERR_COMPILE_RESULT_NOT_ADD_CACHE__OBE_USER_ERROR_MSG "OBE-00600: internal error code, arguments: -9800, To be compatible with MySQL, if an exception occurs when compiling an OB PL object (such as the object does not exist or a parameter mismatch), the relevant statement will be converted to a statement that throws an exception, and compiled object cannot be added to the cache, which may cause performance problems. User should create or redefine the pl object of the problem indicated in the warning until the warning is eliminated. Problem object name: '%.*s'"
#define OB_ERR_KV_GLOBAL_INDEX_ROUTE__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -10500, incorrect route for obkv global index, client router should refresh."
#define OB_ERR_KV_GLOBAL_INDEX_ROUTE__OBE_USER_ERROR_MSG "OBE-00600: internal error code, arguments: -10500, incorrect route for obkv global index, client router should refresh."
#define OB_TTL_NOT_ENABLE__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -10501, TTL feature is not enabled"
@ -9025,7 +9029,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld"
#define OB_ERR_INVALID_DATE_MSG_FMT_V2__OBE_USER_ERROR_MSG "OBE-01861: Incorrect datetime value for column '%.*s' at row %ld"
extern int g_all_ob_errnos[2357];
extern int g_all_ob_errnos[2358];
const char *ob_error_name(const int oberr);
const char* ob_error_cause(const int oberr);