fix mysql system view cast collation problem

This commit is contained in:
wjhh2008
2024-04-09 12:33:07 +00:00
committed by ob-robot
parent 781b365061
commit 0ea78d4b60
3 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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_)) {