fix distinct fd judgement bug

This commit is contained in:
yinyj17
2023-11-06 09:39:30 +00:00
committed by ob-robot
parent f4542583e7
commit d76e2df6ef
5 changed files with 73 additions and 48 deletions

View File

@ -1900,6 +1900,8 @@ int ObTransformSimplifyGroupby::check_can_convert_to_distinct(ObSelectStmt *stmt
LOG_WARN("unexpected null", K(ret), K(select_exprs.at(i)));
} else if (OB_FAIL(ObOptimizerUtil::expr_calculable_by_exprs(select_exprs.at(i),
stmt->get_group_exprs(),
true, // need_check_contain
true, // used_in_compare
is_calculable))) {
LOG_WARN("fail to check if select expr is const or exist", K(ret));
} else {
@ -1912,6 +1914,8 @@ int ObTransformSimplifyGroupby::check_can_convert_to_distinct(ObSelectStmt *stmt
LOG_WARN("unexpected null", K(ret), K(stmt->get_having_exprs().at(i)));
} else if (OB_FAIL(ObOptimizerUtil::expr_calculable_by_exprs(stmt->get_having_exprs().at(i),
stmt->get_group_exprs(),
true, // need_check_contain
true, // used_in_compare
is_calculable))) {
LOG_WARN("fail to check if having expr is const or exist", K(ret));
} else {