Skip site navigation (1) Skip section navigation (2)

Re: New patch for Column-level privileges

From: "Alex Hunsaker" <badalex(at)gmail(dot)com>
To: "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New patch for Column-level privileges
Date: 2009-01-03 21:28:43
Message-ID: 34d269d40901031328m3f2df2f6w1ac5da3569805fc0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Fri, Jan 2, 2009 at 16:11, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> * Stephen Frost (sfrost(at)snowman(dot)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: fixwarning.patch
Description: application/octet-stream (1.3 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2009-01-03 21:34:40
Subject: Re: parallel restore
Previous:From: Guillaume LelargeDate: 2009-01-03 21:21:57
Subject: Re: Latest version of Hot Standby patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group