Fix like '\' bug
This commit is contained in:
@ -4312,7 +4312,8 @@ int ObPreCalcExprConstraint::check_is_match(const ObObjParam &obj_param, bool &i
|
||||
is_match = false;
|
||||
} else if (!pattern_val.empty()) {
|
||||
is_match = OB_ISNULL(pattern_val.find('%')) &&
|
||||
OB_ISNULL(pattern_val.find('_'));
|
||||
OB_ISNULL(pattern_val.find('_')) &&
|
||||
OB_ISNULL(pattern_val.find('\\'));
|
||||
} else {
|
||||
is_match = true;
|
||||
}
|
||||
|
||||
@ -733,8 +733,11 @@ int ObTransformSimplifyExpr::do_check_like_condition(ObRawExpr *&expr,
|
||||
*ctx_->allocator_))) {
|
||||
LOG_WARN("failed to calc const or calculable expr", K(ret));
|
||||
} else if (got_result) {
|
||||
//can't replace if pattern have wildcard or default escape character
|
||||
ObString val = result.get_string();
|
||||
can_replace = OB_ISNULL(val.find('_')) && OB_ISNULL(val.find('%'));
|
||||
can_replace = OB_ISNULL(val.find('_'))
|
||||
&& OB_ISNULL(val.find('%'))
|
||||
&& OB_ISNULL(val.find('\\'));
|
||||
} else {}
|
||||
}
|
||||
if (OB_SUCC(ret) && can_replace) {
|
||||
|
||||
Reference in New Issue
Block a user