[to #55289503]case/when not support cursor expr
This commit is contained in:
parent
e17bb817f5
commit
820414c560
File diff suppressed because one or more lines are too long
@ -2564,6 +2564,7 @@ DEFINE_ERROR(OB_ERR_CLIENT_LOCAL_FILES_DISABLED, -9762, ER_CLIENT_LOCAL_FILES_DI
|
||||
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");
|
||||
DEFINE_ORACLE_ERROR_EXT(OB_ERR_TIME_EARLIER_THAN_SYSDATE, -9764, -1, "HY000", "the parameter must evaluate to a time in the future", "the parameter %s must evaluate to a time in the future", 23420, "the parameter must evaluate to a time in the future", "the parameter %s must evaluate to a time in the future");
|
||||
DEFINE_PLS_ERROR_EXT(OB_ERR_NOT_FUNC_NAME, -9765, -1, "HY000", "object 'string' must be of type function or array to be used this way", "object '%.*s' must be of type function or array to be used this way", 224, "object 'string' must be of type function or array to be used this way", "object '%.*s' must be of type function or array to be used this way");
|
||||
DEFINE_ORACLE_ERROR(OB_ERR_INVALID_CURSOR_EXPR, -9766, -1, "HY000", "CURSOR expression not allowed", 22902, "CURSOR expression not allowed");
|
||||
|
||||
// 余留位置
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
@ -1820,6 +1820,7 @@ constexpr int OB_ERR_CLIENT_LOCAL_FILES_DISABLED = -9762;
|
||||
constexpr int OB_ERR_OUT_PARAM_NOT_BIND_VAR = -9763;
|
||||
constexpr int OB_ERR_TIME_EARLIER_THAN_SYSDATE = -9764;
|
||||
constexpr int OB_ERR_NOT_FUNC_NAME = -9765;
|
||||
constexpr int OB_ERR_INVALID_CURSOR_EXPR = -9766;
|
||||
constexpr int OB_ERR_KV_GLOBAL_INDEX_ROUTE = -10500;
|
||||
constexpr int OB_TTL_NOT_ENABLE = -10501;
|
||||
constexpr int OB_TTL_COLUMN_NOT_EXIST = -10502;
|
||||
@ -4052,6 +4053,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
|
||||
#define OB_ERR_OUT_PARAM_NOT_BIND_VAR__USER_ERROR_MSG "output parameter not a bind variable"
|
||||
#define OB_ERR_TIME_EARLIER_THAN_SYSDATE__USER_ERROR_MSG "the parameter %s must evaluate to a time in the future"
|
||||
#define OB_ERR_NOT_FUNC_NAME__USER_ERROR_MSG "object '%.*s' must be of type function or array to be used this way"
|
||||
#define OB_ERR_INVALID_CURSOR_EXPR__USER_ERROR_MSG "CURSOR expression not allowed"
|
||||
#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"
|
||||
@ -6284,6 +6286,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
|
||||
#define OB_ERR_OUT_PARAM_NOT_BIND_VAR__ORA_USER_ERROR_MSG "ORA-06577: output parameter not a bind variable"
|
||||
#define OB_ERR_TIME_EARLIER_THAN_SYSDATE__ORA_USER_ERROR_MSG "ORA-23420: the parameter %s must evaluate to a time in the future"
|
||||
#define OB_ERR_NOT_FUNC_NAME__ORA_USER_ERROR_MSG "PLS-00224: object '%.*s' must be of type function or array to be used this way"
|
||||
#define OB_ERR_INVALID_CURSOR_EXPR__ORA_USER_ERROR_MSG "ORA-22902: CURSOR expression not allowed"
|
||||
#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_TTL_NOT_ENABLE__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -10501, TTL feature is not enabled"
|
||||
#define OB_TTL_COLUMN_NOT_EXIST__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -10502, TTL column '%.*s' not exists"
|
||||
@ -6326,7 +6329,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[2228];
|
||||
extern int g_all_ob_errnos[2229];
|
||||
|
||||
const char *ob_error_name(const int oberr);
|
||||
const char* ob_error_cause(const int oberr);
|
||||
|
@ -3962,6 +3962,9 @@ int ObRawExprResolverImpl::process_case_node(const ParseNode *node, ObRawExpr *&
|
||||
LOG_WARN("fail to recursive resolver", K(ret), K(when_node->children_[0]));
|
||||
} else if (OB_FAIL(SMART_CALL(recursive_resolve(when_node->children_[1], then_expr)))) {
|
||||
LOG_WARN("fail to recursive resolve", K(ret), K(when_node->children_[1]));
|
||||
} else if (T_REF_QUERY == then_expr->get_expr_type() && static_cast<ObQueryRefRawExpr*>(then_expr)->is_cursor()) {
|
||||
ret = OB_ERR_INVALID_CURSOR_EXPR;
|
||||
LOG_WARN("CURSOR expression not allowed in then.", K(ret));
|
||||
} else if (OB_FAIL(case_expr->add_when_param_expr(when_expr))) {
|
||||
LOG_WARN("Add when expression failed", K(ret));
|
||||
} else if (OB_FAIL(case_expr->add_then_param_expr(then_expr))) {
|
||||
@ -3993,6 +3996,9 @@ int ObRawExprResolverImpl::process_case_node(const ParseNode *node, ObRawExpr *&
|
||||
}
|
||||
} else if (OB_FAIL(SMART_CALL(recursive_resolve(node->children_[2], default_expr)))) {
|
||||
LOG_WARN("fail to recursive resolve", K(ret), K(node->children_[2]));
|
||||
} else if (T_REF_QUERY == default_expr->get_expr_type() && static_cast<ObQueryRefRawExpr*>(default_expr)->is_cursor()) {
|
||||
ret = OB_ERR_INVALID_CURSOR_EXPR;
|
||||
LOG_WARN("CURSOR expression not allowed in else.", K(ret));
|
||||
}
|
||||
if (OB_SUCC(ret)){
|
||||
if (T_QUESTIONMARK == default_expr->get_expr_type()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user