[CP] [CP] fix incorrect construct sql from update statement
This commit is contained in:
@ -630,7 +630,7 @@ int ObDelUpdResolver::add_assignment(common::ObIArray<ObTableAssignment> &assign
|
|||||||
ObTableAssignment *table_assign = NULL;
|
ObTableAssignment *table_assign = NULL;
|
||||||
int64_t N = assigns.count();
|
int64_t N = assigns.count();
|
||||||
if (OB_ISNULL(schema_checker_) || OB_ISNULL(table_item) || OB_ISNULL(assign.column_expr_)
|
if (OB_ISNULL(schema_checker_) || OB_ISNULL(table_item) || OB_ISNULL(assign.column_expr_)
|
||||||
|| OB_ISNULL(get_stmt())) {
|
|| OB_ISNULL(get_stmt()) || OB_ISNULL(get_stmt()->get_query_ctx())) {
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("invalid argument", K(ret), K_(schema_checker), K(table_item), K_(assign.column_expr));
|
LOG_WARN("invalid argument", K(ret), K_(schema_checker), K(table_item), K_(assign.column_expr));
|
||||||
} else if (assign.column_expr_->get_result_type().is_lob()
|
} else if (assign.column_expr_->get_result_type().is_lob()
|
||||||
@ -672,6 +672,9 @@ int ObDelUpdResolver::add_assignment(common::ObIArray<ObTableAssignment> &assign
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
if (get_stmt()->get_query_ctx()->is_prepare_stmt()) {
|
||||||
|
// do nothing
|
||||||
|
} else {
|
||||||
for (int64_t i = 0; OB_SUCC(ret) && !found && i < table_assign->assignments_.count(); ++i) {
|
for (int64_t i = 0; OB_SUCC(ret) && !found && i < table_assign->assignments_.count(); ++i) {
|
||||||
if (assign.column_expr_ == table_assign->assignments_.at(i).column_expr_) {
|
if (assign.column_expr_ == table_assign->assignments_.at(i).column_expr_) {
|
||||||
table_assign->assignments_.at(i) = assign;
|
table_assign->assignments_.at(i) = assign;
|
||||||
@ -679,6 +682,7 @@ int ObDelUpdResolver::add_assignment(common::ObIArray<ObTableAssignment> &assign
|
|||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (OB_SUCC(ret) && !found) {
|
if (OB_SUCC(ret) && !found) {
|
||||||
if (OB_FAIL(table_assign->assignments_.push_back(assign))) {
|
if (OB_FAIL(table_assign->assignments_.push_back(assign))) {
|
||||||
|
Reference in New Issue
Block a user