On Fri, Jan 2, 2009 at 16:11, Stephen Frost <sfr...@snowman.net> wrote: > * Stephen Frost (sfr...@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 */
fixwarning.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers