[FEAT MERGE] [CP] Improve the rowcount estimation
Co-authored-by: akaError <lzg020616@163.com>
This commit is contained in:
@ -198,10 +198,12 @@ int ObOptEstUtils::if_expr_start_with_patten_sign(const ParamStore *params,
|
||||
const ObRawExpr *esp_expr,
|
||||
ObExecContext *exec_ctx,
|
||||
ObIAllocator &allocator,
|
||||
bool &is_start_with)
|
||||
bool &is_start_with,
|
||||
bool &all_is_percent_sign)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
is_start_with = false;
|
||||
all_is_percent_sign = false;
|
||||
bool get_value = false;
|
||||
bool empty_escape = false;
|
||||
char escape;
|
||||
@ -234,6 +236,15 @@ int ObOptEstUtils::if_expr_start_with_patten_sign(const ParamStore *params,
|
||||
}
|
||||
} else { /* do nothing */ }
|
||||
}
|
||||
if (OB_SUCC(ret) && is_start_with) {
|
||||
all_is_percent_sign = true;
|
||||
const ObString &expr_str = value.get_string();
|
||||
for (int64_t i = 0; all_is_percent_sign && i < expr_str.length(); i++) {
|
||||
if (expr_str[i] != '%') {
|
||||
all_is_percent_sign = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user