未验证 提交 7d12bb9b 编写于 作者: Z Zhenghua Lyu 提交者: GitHub

Throw an error when updating hash columns on utility mode. (#5978)

This commit fix Github Issue 5976.
Co-authored-by: NZhenghua Lyu <zlv@pivotal.io>
Co-authored-by: NShujie Zhang <shzhang@pivotal.io>
上级 f8a78c25
......@@ -6776,6 +6776,13 @@ adjust_modifytable_flow(PlannerInfo *root, ModifyTable *node)
List *hashExpr;
Plan *new_subplan;
if (Gp_role == GP_ROLE_UTILITY)
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("Cannot update distribution key columns in utility mode")));
}
new_subplan = (Plan *) make_splitupdate(root, (ModifyTable *) node, subplan, rte, rti);
hashExpr = getExprListFromTargetList(new_subplan->targetlist,
targetPolicy->nattrs,
......
create table t_update_hash_col_utilitymode(c int) distributed by (c);
CREATE
1U: update t_update_hash_col_utilitymode set c = c + 1;
ERROR: Cannot update distribution key columns in utility mode
drop table t_update_hash_col_utilitymode;
DROP
# test update hash col under utility mode
test: update_hash_col_utilitymode
# Tests on global deadlock detector
test: select_for_update
test: gdd/prepare
......
create table t_update_hash_col_utilitymode(c int) distributed by (c);
1U: update t_update_hash_col_utilitymode set c = c + 1;
drop table t_update_hash_col_utilitymode;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册