pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: In AlterRole, make bypassrls an int
4+ messages / 2 participants
[nested] [flat]

* pgsql: In AlterRole, make bypassrls an int
@ 2015-08-21 12:23 Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 4+ messages in thread

From: Stephen Frost @ 2015-08-21 12:23 UTC (permalink / raw)
  To: pgsql-committers

In AlterRole, make bypassrls an int

When reworking bypassrls in AlterRole to operate the same way the other
attribute handling is done, I missed that the variable was incorrectly a
bool rather than an int.  This meant that on platforms with an unsigned
char, we could end up with incorrect behavior during ALTER ROLE.

Pointed out by Andres thanks to tests he did changing our bool to be the
one from stdbool.h which showed this and a number of other issues.

Add regression tests to test CREATE/ALTER role for the various role
attributes.  Arrange to leave roles behind for testing pg_dumpall, but
none which have the LOGIN attribute.

Back-patch to 9.5 where the AlterRole bug exists.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7ec8296e70f0f03cbdb3e0eb4f05ad5be0f810c8

Modified Files
--------------
src/backend/commands/user.c                  |    2 +-
src/test/regress/expected/roleattributes.out |  236 ++++++++++++++++++++++++++
src/test/regress/parallel_schedule           |    2 +-
src/test/regress/serial_schedule             |    1 +
src/test/regress/sql/roleattributes.sql      |   85 ++++++++++
5 files changed, 324 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: In AlterRole, make bypassrls an int
@ 2015-08-21 12:23 Stephen Frost <sfrost@snowman.net>
  2015-08-21 17:35 ` Re: pgsql: In AlterRole, make bypassrls an int Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Stephen Frost @ 2015-08-21 12:23 UTC (permalink / raw)
  To: pgsql-committers

In AlterRole, make bypassrls an int

When reworking bypassrls in AlterRole to operate the same way the other
attribute handling is done, I missed that the variable was incorrectly a
bool rather than an int.  This meant that on platforms with an unsigned
char, we could end up with incorrect behavior during ALTER ROLE.

Pointed out by Andres thanks to tests he did changing our bool to be the
one from stdbool.h which showed this and a number of other issues.

Add regression tests to test CREATE/ALTER role for the various role
attributes.  Arrange to leave roles behind for testing pg_dumpall, but
none which have the LOGIN attribute.

Back-patch to 9.5 where the AlterRole bug exists.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0070fd8d3c1c8a733c041bfcedd41e38cee0a963

Modified Files
--------------
src/backend/commands/user.c                  |    2 +-
src/test/regress/expected/roleattributes.out |  236 ++++++++++++++++++++++++++
src/test/regress/parallel_schedule           |    2 +-
src/test/regress/serial_schedule             |    1 +
src/test/regress/sql/roleattributes.sql      |   85 ++++++++++
5 files changed, 324 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: In AlterRole, make bypassrls an int
  2015-08-21 12:23 pgsql: In AlterRole, make bypassrls an int Stephen Frost <sfrost@snowman.net>
@ 2015-08-21 17:35 ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2015-08-21 17:41   ` Re: pgsql: In AlterRole, make bypassrls an int Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Alvaro Herrera @ 2015-08-21 17:35 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-committers

Stephen Frost wrote:

> Add regression tests to test CREATE/ALTER role for the various role
> attributes.  Arrange to leave roles behind for testing pg_dumpall, but
> none which have the LOGIN attribute.

There is a problem in this test, which is that it throws errors if the
roles already exist.  Maybe CREATE IF NOT EXISTS is needed, or perhaps
a DROP beforehand?

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgsql: In AlterRole, make bypassrls an int
  2015-08-21 12:23 pgsql: In AlterRole, make bypassrls an int Stephen Frost <sfrost@snowman.net>
  2015-08-21 17:35 ` Re: pgsql: In AlterRole, make bypassrls an int Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2015-08-21 17:41   ` Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 4+ messages in thread

From: Stephen Frost @ 2015-08-21 17:41 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-committers

On Friday, August 21, 2015, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

> Stephen Frost wrote:
>
> > Add regression tests to test CREATE/ALTER role for the various role
> > attributes.  Arrange to leave roles behind for testing pg_dumpall, but
> > none which have the LOGIN attribute.
>
> There is a problem in this test, which is that it throws errors if the
> roles already exist.  Maybe CREATE IF NOT EXISTS is needed, or perhaps
> a DROP beforehand?
>

Right, not sure it's that simple since we don't want the output to differ
based on if they exist already or not. Might be able to adjust the log
level to address that, or a DO block which handles it if nothing else
works.

Thanks!

Stephen

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2015-08-21 17:41 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-08-21 12:23 pgsql: In AlterRole, make bypassrls an int Stephen Frost <sfrost@snowman.net>
2015-08-21 12:23 pgsql: In AlterRole, make bypassrls an int Stephen Frost <sfrost@snowman.net>
2015-08-21 17:35 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2015-08-21 17:41   ` Stephen Frost <sfrost@snowman.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox