fix mysql system view cast collation problem
This commit is contained in:
@ -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_)) {
|
||||
|
||||
Reference in New Issue
Block a user