[to #53127984]out param bind to const value need report error

This commit is contained in:
LiuYoung00
2023-11-17 02:45:36 +00:00
committed by ob-robot
parent 565ab7b15b
commit 761938037c
5 changed files with 25 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -2371,6 +2371,7 @@ DEFINE_ORACLE_ERROR_EXT(OB_ERR_MLOG_IS_YOUNGER, -9759, -1, "HY000", "materialize
DEFINE_ORACLE_ERROR_EXT(OB_ERR_MVIEW_CAN_NOT_FAST_REFRESH, -9760, -1, "HY000", "cannot fast refresh materialized view", "cannot fast refresh materialized view `%s`.`%s`", 12052, "cannot fast refresh materialized view", "cannot fast refresh materialized view %s.%s");
DEFINE_ORACLE_ERROR_EXT(OB_ERR_MVIEW_NEVER_REFRESH, -9761, -1, "HY000", "cannot explicitly refresh a NEVER REFRESH materialized view", "cannot explicitly refresh a NEVER REFRESH materialized view (`%s`)", 23538, "cannot explicitly refresh a NEVER REFRESH materialized view", "cannot explicitly refresh a NEVER REFRESH materialized view (%s)");
DEFINE_ERROR(OB_ERR_CLIENT_LOCAL_FILES_DISABLED, -9762, ER_CLIENT_LOCAL_FILES_DISABLED, "42000", "Loading local data is disabled; this must be enabled on both the client and server sides");
DEFINE_ORACLE_ERROR(OB_ERR_OUT_PARAM_NOT_BIND_VAR, -9763, -1, "HY000", "output parameter not a bind variable", 6577, "output parameter not a bind variable");
////////////////////////////////////////////////////////////////
//error code for SQL [-11000 ---- -12000)

View File

@ -1800,6 +1800,7 @@ constexpr int OB_ERR_MLOG_IS_YOUNGER = -9759;
constexpr int OB_ERR_MVIEW_CAN_NOT_FAST_REFRESH = -9760;
constexpr int OB_ERR_MVIEW_NEVER_REFRESH = -9761;
constexpr int OB_ERR_CLIENT_LOCAL_FILES_DISABLED = -9762;
constexpr int OB_ERR_OUT_PARAM_NOT_BIND_VAR = -9763;
constexpr int OB_ERR_VALUES_CLAUSE_NEED_HAVE_COLUMN = -11000;
constexpr int OB_ERR_VALUES_CLAUSE_CANNOT_USE_DEFAULT_VALUES = -11001;
constexpr int OB_WRONG_PARTITION_NAME = -11002;
@ -3965,6 +3966,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_MVIEW_CAN_NOT_FAST_REFRESH__USER_ERROR_MSG "cannot fast refresh materialized view `%s`.`%s`"
#define OB_ERR_MVIEW_NEVER_REFRESH__USER_ERROR_MSG "cannot explicitly refresh a NEVER REFRESH materialized view (`%s`)"
#define OB_ERR_CLIENT_LOCAL_FILES_DISABLED__USER_ERROR_MSG "Loading local data is disabled; this must be enabled on both the client and server sides"
#define OB_ERR_OUT_PARAM_NOT_BIND_VAR__USER_ERROR_MSG "output parameter not a bind variable"
#define OB_ERR_VALUES_CLAUSE_NEED_HAVE_COLUMN__USER_ERROR_MSG "Each row of a VALUES clause must have at least one column, unless when used as source in an INSERT statement."
#define OB_ERR_VALUES_CLAUSE_CANNOT_USE_DEFAULT_VALUES__USER_ERROR_MSG "A VALUES clause cannot use DEFAULT values, unless used as a source in an INSERT statement."
#define OB_WRONG_PARTITION_NAME__USER_ERROR_MSG "Incorrect partition name '%.*s'"
@ -6130,6 +6132,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_MVIEW_CAN_NOT_FAST_REFRESH__ORA_USER_ERROR_MSG "ORA-12052: cannot fast refresh materialized view %s.%s"
#define OB_ERR_MVIEW_NEVER_REFRESH__ORA_USER_ERROR_MSG "ORA-23538: cannot explicitly refresh a NEVER REFRESH materialized view (%s)"
#define OB_ERR_CLIENT_LOCAL_FILES_DISABLED__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -9762, Loading local data is disabled; this must be enabled on both the client and server sides"
#define OB_ERR_OUT_PARAM_NOT_BIND_VAR__ORA_USER_ERROR_MSG "ORA-06577: output parameter not a bind variable"
#define OB_ERR_VALUES_CLAUSE_NEED_HAVE_COLUMN__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -11000, Each row of a VALUES clause must have at least one column, unless when used as source in an INSERT statement."
#define OB_ERR_VALUES_CLAUSE_CANNOT_USE_DEFAULT_VALUES__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -11001, A VALUES clause cannot use DEFAULT values, unless used as a source in an INSERT statement."
#define OB_WRONG_PARTITION_NAME__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -11002, Incorrect partition name '%.*s'"
@ -6146,7 +6149,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-12899: value too large for column %.*s (actual: %ld, maximum: %ld)"
#define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld"
extern int g_all_ob_errnos[2161];
extern int g_all_ob_errnos[2162];
const char *ob_error_name(const int oberr);
const char* ob_error_cause(const int oberr);

View File

@ -276,8 +276,8 @@ int ObCallProcedureExecutor::execute(ObExecContext &ctx, ObCallProcedureStmt &st
}
}
} else {
ret = OB_ERR_CALL_WRONG_ARG;
LOG_WARN("PLS-00306: wrong number or types of arguments in call stmt", K(ret));
ret = OB_ERR_OUT_PARAM_NOT_BIND_VAR;
LOG_WARN("output parameter not a bind variable", K(ret));
}
} else {
ctx.get_physical_plan_ctx()->get_param_store_for_update().at(i) = params.at(i);

View File

@ -478,11 +478,11 @@ int ObCallProcedureResolver::resolve(const ParseNode &parse_tree)
param->get_expr_type() != T_QUESTIONMARK &&
param->get_expr_type() != T_OP_GET_PACKAGE_VAR &&
!param->is_obj_access_expr()) {
ret = OB_ERR_CALL_WRONG_ARG;
LOG_WARN("PLS-00306: wrong number or types of arguments in call stmt", K(ret));
ret = OB_ERR_OUT_PARAM_NOT_BIND_VAR;
LOG_WARN("output parameter not a bind variable", K(ret));
} else if (param->is_obj_access_expr() && !(static_cast<const ObObjAccessRawExpr *>(param))->for_write()) {
ret = OB_ERR_CALL_WRONG_ARG;
LOG_WARN("PLS-00306: wrong number or types of arguments in call stmt", K(ret));
ret = OB_ERR_OUT_PARAM_NOT_BIND_VAR;
LOG_WARN("output parameter not a bind variable", K(ret));
} else if (param_info->is_sys_refcursor_type()
|| (param_info->is_pkg_type() && pl_type.is_cursor_type())) {
OZ (call_proc_info->add_out_param(i,