fix shared group by subquery bug
This commit is contained in:
@ -1378,7 +1378,8 @@ bool ObQueryRefRawExpr::inner_same_as(
|
||||
// very tricky, check the definition of ref_stmt_ and get_ref_stmt()
|
||||
bool_ret = (get_ref_id() == u_expr.get_ref_id() &&
|
||||
ref_stmt_ == u_expr.ref_stmt_ &&
|
||||
is_multiset_ == is_multiset_);
|
||||
is_set_ == u_expr.is_set_ &&
|
||||
is_multiset_ == u_expr.is_multiset_);
|
||||
}
|
||||
}
|
||||
return bool_ret;
|
||||
@ -1388,7 +1389,9 @@ bool ObExprEqualCheckContext::compare_query(const ObQueryRefRawExpr &left,
|
||||
const ObQueryRefRawExpr &right)
|
||||
{
|
||||
return left.get_ref_id() == right.get_ref_id() &&
|
||||
left.get_ref_stmt() == right.get_ref_stmt();
|
||||
left.get_ref_stmt() == right.get_ref_stmt() &&
|
||||
left.is_set() == right.is_set() &&
|
||||
left.is_multiset() == right.is_multiset();
|
||||
}
|
||||
|
||||
int ObQueryRefRawExpr::do_visit(ObRawExprVisitor &visitor)
|
||||
|
||||
@ -245,6 +245,8 @@ bool ObStmtCompareContext::compare_query(const ObQueryRefRawExpr &first,
|
||||
QueryRelation relation = QueryRelation::QUERY_UNCOMPARABLE;
|
||||
if (&first == &second) {
|
||||
bret = true;
|
||||
} else if (first.is_set() != second.is_set() || first.is_multiset() != second.is_multiset()) {
|
||||
bret = false;
|
||||
} else if (OB_FAIL(ObStmtComparer::check_stmt_containment(first.get_ref_stmt(),
|
||||
second.get_ref_stmt(),
|
||||
stmt_map_info,
|
||||
|
||||
@ -1677,6 +1677,10 @@ int ObTransformSimplifySubquery::eliminate_groupby_distinct_in_any_all(ObRawExpr
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("get unexpected null", K(ret), K(expr));
|
||||
} else if (!expr->has_flag(IS_WITH_ALL) && !expr->has_flag(IS_WITH_ANY)) {
|
||||
} else if (OB_UNLIKELY(2 != expr->get_param_count())
|
||||
|| OB_UNLIKELY(!expr->get_param_expr(1)->is_query_ref_expr())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unexpected expr", K(ret), KPC(expr));
|
||||
} else if (OB_ISNULL(subq_expr = static_cast<ObQueryRefRawExpr *>(expr->get_param_expr(1))) ||
|
||||
OB_ISNULL(static_cast<ObRawExpr *>(expr->get_param_expr(0)))) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
|
||||
Reference in New Issue
Block a user