fix t_op_row share bug
This commit is contained in:
@ -219,43 +219,6 @@ int ObRawExprCopier::add_skipped_expr(const ObIArray<T *> &targets, bool include
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* ReplaceExprByType is used to generate new expr when contain some special type node
|
||||
* as following case, when we need to copy a medium expr: T_OP_ROW, need to deep copy parents
|
||||
* expr:(c1,c2)!=(1,2)
|
||||
* ReplaceExprByType(T_OP_ROW)
|
||||
* old expr:(c1,c2)!=(1,2) new expr:(c1,c2)!=(1,2)
|
||||
* T_OP_NE T_OP_NE(new)
|
||||
* T_OP_ROW T_OP_ROW (new)T_OP_ROW T_OP_ROW(new)
|
||||
* c1 c2 const(1) const(2) (old)c1 (old)c2 (old)const(1) const(2)(old)
|
||||
*/
|
||||
class ReplaceExprByType : public ObIRawExprReplacer
|
||||
{
|
||||
public:
|
||||
ReplaceExprByType(ObItemType expr_type) : expr_type_(expr_type) {}
|
||||
virtual int generate_new_expr(ObRawExprFactory &expr_factory,
|
||||
ObRawExpr *old_expr,
|
||||
ObRawExpr *&new_expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_ISNULL(old_expr)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SQL_RESV_LOG(WARN, "old expr is null", K(ret));
|
||||
} else if (old_expr->get_expr_type() == expr_type_) {
|
||||
if (OB_FAIL(ObRawExprCopier::copy_expr_node(expr_factory,
|
||||
old_expr,
|
||||
new_expr))) {
|
||||
SQL_RESV_LOG(WARN, "failed to copy calc urowid expr", K(ret));
|
||||
} else if (OB_ISNULL(new_expr)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
SQL_RESV_LOG(WARN, "failed to build new calc rowid expr", K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
ObItemType expr_type_;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9137,5 +9137,23 @@ int ObRawExprUtils::ora_cmp_integer(const ObConstRawExpr &const_expr, const int6
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObRawExprUtils::check_contain_op_row_expr(const ObRawExpr *raw_expr, bool &contain)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_ISNULL(raw_expr)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected NULL pointer", K(ret));
|
||||
} else if (raw_expr->get_expr_type() == T_OP_ROW && !raw_expr->is_const_expr()) {
|
||||
contain = true;
|
||||
} else {
|
||||
for (int64_t i = 0; OB_SUCC(ret) && !contain && i < raw_expr->get_param_count(); i++) {
|
||||
if (OB_FAIL(SMART_CALL(check_contain_op_row_expr(raw_expr->get_param_expr(i), contain)))) {
|
||||
LOG_WARN("failed to replace_ref_column", KPC(raw_expr), K(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1195,6 +1195,7 @@ public:
|
||||
static int extract_local_vars_for_gencol(ObRawExpr *expr,
|
||||
const ObSQLMode sql_mode,
|
||||
ObColumnSchemaV2 &gen_col);
|
||||
static int check_contain_op_row_expr(const ObRawExpr *raw_expr, bool &contain);
|
||||
|
||||
private :
|
||||
static int create_real_cast_expr(ObRawExprFactory &expr_factory,
|
||||
|
||||
Reference in New Issue
Block a user