From b634193e00f19cb9cedd45cc4624563cb934668f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Villemain?= Date: Sun, 9 Mar 2025 14:39:45 +0100 Subject: [PATCH] Rearrange code when managing privileges on tables. Precisely, I moved the check for cols presence a bit later. It's safe to exit with ERROR after having append to the string and it will ease the reading of next commit. --- src/backend/distributed/commands/grant.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/distributed/commands/grant.c b/src/backend/distributed/commands/grant.c index c4278cee1..765ca06c9 100644 --- a/src/backend/distributed/commands/grant.c +++ b/src/backend/distributed/commands/grant.c @@ -90,16 +90,16 @@ PreprocessGrantStmt(Node *node, const char *queryString, } isFirst = false; + Assert(priv->priv_name != NULL); + + appendStringInfo(&privsString, "%s", priv->priv_name); + if (priv->cols != NIL) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("grant/revoke on column list is currently " "unsupported"))); } - - Assert(priv->priv_name != NULL); - - appendStringInfo(&privsString, "%s", priv->priv_name); } }