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