[CP] Fix a dblink bug
This commit is contained in:
@ -503,7 +503,23 @@ int ObTransformDBlink::has_invalid_link_expr(ObDMLStmt &stmt, bool &has_invalid_
|
|||||||
has_invalid_expr = false;
|
has_invalid_expr = false;
|
||||||
if (OB_FAIL(stmt.get_relation_exprs(exprs))) {
|
if (OB_FAIL(stmt.get_relation_exprs(exprs))) {
|
||||||
LOG_WARN("failed to get relation exprs", K(ret));
|
LOG_WARN("failed to get relation exprs", K(ret));
|
||||||
} else {
|
} else if (OB_FAIL(has_invalid_link_expr(exprs, has_invalid_expr))) {
|
||||||
|
LOG_WARN("failed to check has invalid link expr", K(ret));
|
||||||
|
} else if (has_invalid_expr) {
|
||||||
|
// do nothing
|
||||||
|
} else if (stmt.is_insert_stmt()) {
|
||||||
|
// get_relation_exprs can not get all exprs in values vector
|
||||||
|
if (OB_FAIL(has_invalid_link_expr(static_cast<ObInsertStmt &>(stmt).get_values_vector(), has_invalid_expr))) {
|
||||||
|
LOG_WARN("failed to check has invalid link expr", K(ret));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ObTransformDBlink::has_invalid_link_expr(ObIArray<ObRawExpr *> &exprs, bool &has_invalid_expr)
|
||||||
|
{
|
||||||
|
int ret = OB_SUCCESS;
|
||||||
|
has_invalid_expr = false;
|
||||||
for (int64_t i = 0; OB_SUCC(ret) && !has_invalid_expr && i < exprs.count(); i++) {
|
for (int64_t i = 0; OB_SUCC(ret) && !has_invalid_expr && i < exprs.count(); i++) {
|
||||||
bool is_valid = false;
|
bool is_valid = false;
|
||||||
if (OB_FAIL(check_link_expr_valid(exprs.at(i), is_valid))) {
|
if (OB_FAIL(check_link_expr_valid(exprs.at(i), is_valid))) {
|
||||||
@ -512,7 +528,6 @@ int ObTransformDBlink::has_invalid_link_expr(ObDMLStmt &stmt, bool &has_invalid_
|
|||||||
has_invalid_expr = true;
|
has_invalid_expr = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,6 +175,8 @@ private:
|
|||||||
|
|
||||||
int has_invalid_link_expr(ObDMLStmt &stmt, bool &has_invalid_expr);
|
int has_invalid_link_expr(ObDMLStmt &stmt, bool &has_invalid_expr);
|
||||||
|
|
||||||
|
int has_invalid_link_expr(ObIArray<ObRawExpr *> &exprs, bool &has_invalid_expr);
|
||||||
|
|
||||||
static int check_link_expr_valid(ObRawExpr *expr, bool &is_valid);
|
static int check_link_expr_valid(ObRawExpr *expr, bool &is_valid);
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ObTransformDBlink);
|
DISALLOW_COPY_AND_ASSIGN(ObTransformDBlink);
|
||||||
|
Reference in New Issue
Block a user