fix mysql system view cast collation problem
This commit is contained in:
parent
781b365061
commit
0ea78d4b60
@ -1692,6 +1692,7 @@ int ObDMLResolver::resolve_sql_expr(const ParseNode &node, ObRawExpr *&expr,
|
||||
ctx.view_ref_id_ = view_ref_id_;
|
||||
ctx.is_variable_allowed_ = !(is_mysql_mode() && params_.is_from_create_view_);
|
||||
ctx.is_expanding_view_ = params_.is_expanding_view_;
|
||||
ctx.is_in_system_view_ = params_.is_in_sys_view_;
|
||||
ObRawExprResolverImpl expr_resolver(ctx);
|
||||
ObIArray<ObUserVarIdentRawExpr *> &user_var_exprs = get_stmt()->get_user_vars();
|
||||
bool is_multi_stmt = session_info_->get_cur_exec_ctx() != NULL &&
|
||||
|
@ -1613,7 +1613,8 @@ struct ObResolveContext
|
||||
tg_timing_event_(TG_TIMING_EVENT_INVALID),
|
||||
view_ref_id_(OB_INVALID_ID),
|
||||
is_variable_allowed_(true),
|
||||
is_expanding_view_(false)
|
||||
is_expanding_view_(false),
|
||||
is_in_system_view_(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1660,6 +1661,7 @@ struct ObResolveContext
|
||||
uint64_t view_ref_id_;
|
||||
bool is_variable_allowed_;
|
||||
bool is_expanding_view_;
|
||||
bool is_in_system_view_;
|
||||
};
|
||||
|
||||
typedef ObResolveContext<ObRawExprFactory> ObExprResolveContext;
|
||||
|
@ -443,6 +443,9 @@ int ObRawExprResolverImpl::do_recursive_resolve(const ParseNode *node, ObRawExpr
|
||||
} else {
|
||||
coll_type = ObCharset::get_default_collation(charset_type);
|
||||
}
|
||||
} else if (ctx_.is_in_system_view_) {
|
||||
//for mysql system view, cast char type always has default collation
|
||||
coll_type = ObCharset::get_system_collation();
|
||||
} else {
|
||||
// use connection_collation. for cast('a' as char)
|
||||
if (OB_ISNULL(ctx_.session_info_)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user