[CP] disable rewriting happened on a values clause as subquery temporarily

This commit is contained in:
jingtaoye35 2023-11-09 13:17:34 +00:00 committed by ob-robot
parent a399421cc0
commit 18b2b12ceb

View File

@ -1268,7 +1268,7 @@ int ObTransformSimplifySubquery::eliminate_subquery(ObDMLStmt *stmt,
} else if (OB_ISNULL(subquery = subq_expr->get_ref_stmt())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("Subquery stmt is NULL", K(ret));
} else if (subquery->is_contains_assignment()) {
} else if (subquery->is_contains_assignment() || subquery->is_values_table_query()) {
// do nothing
} else if (OB_FAIL(subquery_can_be_eliminated_in_exists(expr->get_expr_type(),
subquery,
@ -1457,7 +1457,8 @@ int ObTransformSimplifySubquery::groupby_can_be_eliminated_in_any_all(const ObSe
} else if (stmt->has_group_by()
&& !stmt->has_having()
&& !stmt->has_limit()
&& 0 == stmt->get_aggr_item_size()) {
&& 0 == stmt->get_aggr_item_size()
&& !stmt->is_values_table_query()) {
// Check if select list is involved in group exprs
ObRawExpr *s_expr = NULL;
bool all_in_group_exprs = true;
@ -1498,7 +1499,8 @@ int ObTransformSimplifySubquery::eliminate_subquery_in_exists(ObDMLStmt *stmt,
} else if (OB_ISNULL(subquery = subq_expr->get_ref_stmt())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("Subquery stmt is NULL", K(ret));
//Just in case different parameters hit same plan, firstly we need add const param constraint
} else if (subquery->is_values_table_query()) { /* do nothing */
//Just in case different parameters hit same plan, firstly we need add const param constraint
} else if (OB_FAIL(need_add_limit_constraint(expr->get_expr_type(), subquery, add_limit_constraint))){
LOG_WARN("failed to check limit constraints", K(ret));
} else if (add_limit_constraint &&
@ -2261,10 +2263,11 @@ int ObTransformSimplifySubquery::check_stmt_can_trans_as_exists(ObSelectStmt *st
} else if (stmt->is_contains_assignment() ||
stmt->is_hierarchical_query() ||
stmt->has_window_function() ||
stmt->has_rollup()) {
stmt->has_rollup() ||
stmt->is_values_table_query()) {
LOG_TRACE("stmt not support trans in as exists", K(stmt->is_contains_assignment()),
K(stmt->is_hierarchical_query()), K(stmt->has_window_function()),
K(stmt->has_rollup()));
K(stmt->has_rollup()), K(stmt->is_values_table_query()));
} else if (is_correlated) {
is_valid = true;
} else if (stmt->has_group_by() ||