Re: New patch for Column-level privileges

Поиск
Список
Период
Сортировка
От Alex Hunsaker
Тема Re: New patch for Column-level privileges
Дата
Msg-id 34d269d40901031328m3f2df2f6w1ac5da3569805fc0@mail.gmail.com
обсуждение исходный текст
Ответ на Re: New patch for Column-level privileges  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: New patch for Column-level privileges  (Stephen Frost <sfrost@snowman.net>)
Список 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 */

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Latest version of Hot Standby patch
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: parallel restore