!1911 issue修复:ignore在bypass场景下insert,当插入失败时回显错误问题修复

Merge pull request !1911 from zhangzhixian/fix_insert_fusion_echo_error
This commit is contained in:
opengauss-bot
2022-07-21 02:22:48 +00:00
committed by Gitee
2 changed files with 10 additions and 9 deletions

View File

@ -1852,12 +1852,12 @@ TupleTableSlot* ExecUpdate(ItemPointer tupleid,
if (result_rel_info->ri_FdwRoutine->GetFdwType && result_rel_info->ri_FdwRoutine->GetFdwType() == MOT_ORC) {
if (result_relation_desc->rd_att->constr) {
TupleTableSlot *tmp_slot = node->mt_insert_constr_slot == NULL ? slot : node->mt_insert_constr_slot;
if (!ExecConstraints(result_rel_info, slot, estate)) {
if (!ExecConstraints(result_rel_info, tmp_slot, estate)) {
if (u_sess->utils_cxt.sql_ignore_strategy_val == SQL_OVERWRITE_NULL) {
tuple = ReplaceTupleNullCol(RelationGetDescr(result_relation_desc), slot);
tuple = ReplaceTupleNullCol(RelationGetDescr(result_relation_desc), tmp_slot);
/* Double check constraints in case that new val in column with not null constraints
* violated check constraints */
ExecConstraints(result_rel_info, slot, estate);
ExecConstraints(result_rel_info, tmp_slot, estate);
} else {
return NULL;
}