Re: New patch for Column-level privileges - Mailing list pgsql-hackers

From Alex Hunsaker
Subject Re: New patch for Column-level privileges
Date
Msg-id 34d269d40901031328m3f2df2f6w1ac5da3569805fc0@mail.gmail.com
Whole thread Raw
In response to Re: New patch for Column-level privileges  (Stephen Frost <sfrost@snowman.net>)
Responses Re: New patch for Column-level privileges
List pgsql-hackers
On Fri, Jan 2, 2009 at 16:11, Stephen Frost <sfrost@snowman.net> wrote:
> * Stephen Frost (sfrost@snowman.net) wrote:
>>   Please find attached an updated patch for column-level privileges
>>   which incorporates Alvaro's suggested changes and is updated to the
>>   latest CVS HEAD.

Hi!

This gives me
aclchk.c: In function 'ExecuteGrantStmt':
aclchk.c:276: warning: 'errormsg_col' may be used uninitialized in this function

Now it looks bogos but why not just move errmsg_col down to where we
actually use it?  Or am I missing something?

*** a/src/backend/catalog/aclchk.c
--- b/src/backend/catalog/aclchk.c
***************
*** 273,279 **** ExecuteGrantStmt(GrantStmt *stmt)
      InternalGrant istmt;
      ListCell   *cell;
      const char *errormsg;
-     const char *errormsg_col;
      AclMode        all_privileges;

      /*
--- 273,278 ----
***************
*** 324,330 **** ExecuteGrantStmt(GrantStmt *stmt)
          case ACL_OBJECT_RELATION:
              all_privileges = ACL_ALL_RIGHTS_RELATION | ACL_ALL_RIGHTS_SEQUENCE;
              errormsg = gettext_noop("invalid privilege type %s for relation");
-             errormsg_col = gettext_noop("invalid privilege type %s for column");
              break;
          case ACL_OBJECT_SEQUENCE:
              all_privileges = ACL_ALL_RIGHTS_SEQUENCE;
--- 323,328 ----
***************
*** 362,368 **** ExecuteGrantStmt(GrantStmt *stmt)
              /* keep compiler quiet */
              all_privileges = ACL_NO_RIGHTS;
              errormsg = NULL;
-             errormsg_col = NULL;
              elog(ERROR, "unrecognized GrantStmt.objtype: %d",
                   (int) stmt->objtype);
      }
--- 360,365 ----
***************
*** 404,409 **** ExecuteGrantStmt(GrantStmt *stmt)
--- 401,408 ----
              {
                  /* Column-level privileges given. */
                  ListCell *cell_obj;
+                 const char *errormsg_col = gettext_noop("invalid privilege type
%s for column");
+

                  /* Must be of objtype ACL_OBJECT_RELATION for column
                   * level privileges */

Attachment

pgsql-hackers by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: Latest version of Hot Standby patch
Next
From: Andrew Dunstan
Date:
Subject: Re: parallel restore