fix subquery coalesce bug
This commit is contained in:
parent
7ef8b5ebc9
commit
3c16986342
@ -130,7 +130,8 @@ int ObTransformSimplifySubquery::try_trans_subquery_in_expr(ObDMLStmt *stmt,
|
||||
LOG_WARN("too deep recursive", K(ret), K(is_stack_overflow));
|
||||
} else if (IS_SUBQUERY_COMPARISON_OP(expr->get_expr_type()) ||
|
||||
T_OP_EXISTS == expr->get_expr_type() ||
|
||||
T_OP_NOT_EXISTS == expr->get_expr_type()) {
|
||||
T_OP_NOT_EXISTS == expr->get_expr_type() ||
|
||||
expr->is_alias_ref_expr()) {
|
||||
// 如果 expr 的param 必须是 subquery,那么不去改写它包含的子查询
|
||||
//do nothing
|
||||
} else if (expr->is_query_ref_expr()) {
|
||||
|
@ -1962,13 +1962,11 @@ int ObTransformSubqueryCoalesce::inner_coalesce_subquery(ObSelectStmt *subquery,
|
||||
} else if (!coalesce_select->same_as(*subquery_select, &context)) {
|
||||
// do nothing
|
||||
} else if (!is_first_subquery &&
|
||||
!coalesce_select->is_column_ref_expr() &&
|
||||
!coalesce_select->is_const_expr() &&
|
||||
OB_FAIL(ObTransformUtils::create_select_item(*ctx_->allocator_,
|
||||
coalesce_select,
|
||||
coalesce_query))) {
|
||||
LOG_WARN("failed to create column for subquery", K(ret));
|
||||
} else if (OB_FAIL(index_map.push_back(coalesce_query->get_select_item_size() - 1))) {
|
||||
} else if (OB_FAIL(index_map.push_back(is_first_subquery ? j : coalesce_query->get_select_item_size() - 1))) {
|
||||
LOG_WARN("failed to push back index", K(ret));
|
||||
} else {
|
||||
find = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user