Fix: There is a shared expression in the virtual generated column, which causes an error
This commit is contained in:
@ -3440,6 +3440,30 @@ int ObRawExprUtils::extract_col_aggr_exprs(ObRawExpr* expr,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObRawExprUtils::contain_virtual_generated_column(ObRawExpr *&expr, bool &is_contain_vir_gen_column)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_ISNULL(expr)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("expr is null", K(ret));
|
||||
} else if (expr->is_column_ref_expr() &&
|
||||
static_cast<ObColumnRefRawExpr *>(expr)->is_virtual_generated_column() &&
|
||||
!static_cast<ObColumnRefRawExpr *>(expr)->is_xml_column()) {
|
||||
is_contain_vir_gen_column = true;
|
||||
}
|
||||
for (int64_t j = 0; OB_SUCC(ret) && is_contain_vir_gen_column == false && j < expr->get_param_count(); j++) {
|
||||
if (OB_ISNULL(expr->get_param_expr(j))) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("param_expr is NULL", K(j), K(ret));
|
||||
} else if (OB_FAIL(SMART_CALL(contain_virtual_generated_column(expr->get_param_expr(j), is_contain_vir_gen_column)))) {
|
||||
LOG_WARN("fail to contain virtual gen column", K(j), K(ret));
|
||||
} else {
|
||||
LOG_TRACE("conclude virtual generated column", K(is_contain_vir_gen_column));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObRawExprUtils::extract_column_exprs(const ObIArray<ObRawExpr*> &exprs,
|
||||
ObIArray<ObRawExpr*> &column_exprs,
|
||||
bool need_pseudo_column)
|
||||
|
||||
@ -368,6 +368,8 @@ public:
|
||||
ObRawExpr *from,
|
||||
ObRawExpr *to,
|
||||
const ObIArray<ObRawExpr*> *except_exprs = NULL);
|
||||
static int contain_virtual_generated_column(ObRawExpr *&expr,
|
||||
bool &is_contain_vir_gen_column);
|
||||
|
||||
static bool is_all_column_exprs(const common::ObIArray<ObRawExpr*> &exprs);
|
||||
static int extract_set_op_exprs(const ObRawExpr *raw_expr,
|
||||
|
||||
Reference in New Issue
Block a user