fix:query bug,under multivalue index created,create access path report errorcode
This commit is contained in:
@ -619,6 +619,9 @@ ObRawExpr* ObRawExpr::get_json_domain_param_expr()
|
||||
param_expr = get_param_expr(0);
|
||||
} else if (get_expr_type() == T_FUN_SYS_JSON_OVERLAPS) {
|
||||
param_expr = get_param_expr(0);
|
||||
if (OB_NOT_NULL(param_expr) && param_expr->is_const_expr()) {
|
||||
param_expr = get_param_expr(1);
|
||||
}
|
||||
}
|
||||
|
||||
return param_expr;
|
||||
@ -4092,21 +4095,34 @@ bool ObSysFunRawExpr::inner_json_expr_same_as(
|
||||
&& r_expr->is_domain_json_expr()) {
|
||||
const ObRawExpr *r_param_expr = nullptr;
|
||||
const ObRawExpr *l_param_expr = l_expr->get_param_expr(1);
|
||||
|
||||
const ObRawExpr *r_column_expr = nullptr;
|
||||
const ObRawExpr *l_column_expr = l_expr->get_param_expr(0);
|
||||
|
||||
if (r_expr->get_expr_type() == T_FUN_SYS_JSON_MEMBER_OF) {
|
||||
r_param_expr = r_expr->get_param_expr(1);
|
||||
} else {
|
||||
r_param_expr = r_expr->get_param_expr(0);
|
||||
if (r_expr->get_expr_type() == T_FUN_SYS_JSON_OVERLAPS && OB_NOT_NULL(r_param_expr) && r_param_expr->is_const_expr()) {
|
||||
r_param_expr = r_expr->get_param_expr(1);
|
||||
}
|
||||
}
|
||||
if (OB_ISNULL(r_param_expr)) {
|
||||
} else if (r_param_expr->is_wrappered_json_extract()) {
|
||||
r_param_expr = r_param_expr->get_param_expr(0)->get_param_expr(1);
|
||||
r_column_expr = r_param_expr->get_param_expr(0)->get_param_expr(0);
|
||||
} else if (r_param_expr->get_expr_type() == T_FUN_SYS_JSON_EXTRACT) {
|
||||
r_column_expr = r_param_expr->get_param_expr(0);
|
||||
r_param_expr = r_param_expr->get_param_expr(1);
|
||||
}
|
||||
|
||||
if (OB_NOT_NULL(r_param_expr)) {
|
||||
bool_ret = l_param_expr->same_as(*r_param_expr, check_context);
|
||||
}
|
||||
|
||||
if (bool_ret) {
|
||||
bool_ret = r_column_expr == l_column_expr;
|
||||
}
|
||||
} else if (l_expr->get_expr_type() == r_expr->get_expr_type()) {
|
||||
bool_ret = l_expr->same_as(*r_expr, check_context);
|
||||
} else if (l_expr->is_wrappered_json_extract()
|
||||
|
||||
@ -4613,6 +4613,8 @@ int ObRawExprUtils::replace_qual_param_if_need(ObRawExpr* qual,
|
||||
{
|
||||
INIT_SUCC(ret);
|
||||
ObRawExpr* qual_expr = nullptr;
|
||||
const ObRawExpr* param_expr = nullptr;
|
||||
int32_t idx = 0;
|
||||
|
||||
if (qual->get_expr_type() == T_OP_BOOL
|
||||
&& OB_NOT_NULL(qual_expr = qual->get_param_expr(0))
|
||||
@ -4621,8 +4623,14 @@ int ObRawExprUtils::replace_qual_param_if_need(ObRawExpr* qual,
|
||||
if (OB_FAIL(static_cast<ObOpRawExpr *>(qual_expr)->replace_param_expr(1, col_expr))) {
|
||||
LOG_WARN("replace const int expr failed", K(ret));
|
||||
}
|
||||
} else if (OB_FAIL(static_cast<ObOpRawExpr *>(qual_expr)->replace_param_expr(0, col_expr))) {
|
||||
LOG_WARN("replace const int expr failed", K(ret));
|
||||
} else {
|
||||
if (OB_NOT_NULL(param_expr = qual_expr->get_param_expr(0)) && param_expr->is_const_expr()) {
|
||||
idx = 1;
|
||||
}
|
||||
|
||||
if (OB_FAIL(static_cast<ObOpRawExpr *>(qual_expr)->replace_param_expr(idx, col_expr))) {
|
||||
LOG_WARN("replace const int expr failed", K(ret));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user