postgresql/src/backend/commands
Andrew Gierth d9a4cce29d Fix error case for CREATE ROLE ... IN ROLE.
CreateRole() was passing a Value node, not a RoleSpec node, for the
newly-created role name when adding the role as a member of existing
roles for the IN ROLE syntax.

This mistake went unnoticed because the node in question is used only
for error messages and is not accessed on non-error paths.

In older pg versions (such as 9.5 where this was found), this results
in an "unexpected node type" error in place of the real error. That
node type check was removed at some point, after which the code would
accidentally fail to fail on 64-bit platforms (on which accessing the
Value node as if it were a RoleSpec would be mostly harmless) or give
an "unexpected role type" error on 32-bit platforms.

Fix the code to pass the correct node type, and add an lfirst_node
assertion just in case.

Per report on irc from user m1chelangelo.

Backpatch all the way, because this error has been around for a long
time.
2020-04-25 05:09:30 +01:00
..
Makefile Revert 0f5ca02f53 2020-04-08 11:37:27 +03:00
aggregatecmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
alter.c Add ALTER .. NO DEPENDS ON 2020-04-20 13:42:12 -04:00
amcmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
analyze.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
async.c Refactor ps_status.c API 2020-03-11 16:38:31 +01:00
cluster.c Refactor cluster.c to use new routine get_index_isclustered() 2020-04-06 11:44:23 +09:00
collationcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
comment.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
constraint.c Fix bogus CALLED_AS_TRIGGER() defenses. 2020-04-03 11:24:56 -04:00
conversioncmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
copy.c Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
createas.c Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
dbcommands.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
define.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
discard.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dropcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
event_trigger.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
explain.c Cosmetic fixups for WAL usage work. 2020-04-13 15:31:16 +05:30
extension.c Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
foreigncmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
functioncmds.c Introduce "anycompatible" family of polymorphic types. 2020-03-19 11:43:11 -04:00
indexcmds.c Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
lockcmds.c Make inherited LOCK TABLE perform access permission checks on parent table only. 2020-02-18 13:13:15 +09:00
matview.c Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
opclasscmds.c Improve error reporting in opclasscmds.c 2020-03-31 17:51:57 +03:00
operatorcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
policy.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
portalcmds.c Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
prepare.c Include information on buffer usage during planning phase, in EXPLAIN output, take two. 2020-04-04 03:13:17 +09:00
proclang.c Remove the "opaque" pseudo-type and associated compatibility hacks. 2020-03-05 15:48:56 -05:00
publicationcmds.c Allow publishing partition changes via ancestors 2020-04-08 11:19:23 +02:00
schemacmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
seclabel.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sequence.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statscmds.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
subscriptioncmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
tablecmds.c Remove bogus Assert in foreign key cloning code 2020-04-22 22:12:19 +12:00
tablespace.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
trigger.c Enable BEFORE row-level triggers for partitioned tables 2020-03-18 18:58:05 -03:00
tsearchcmds.c Preserve integer and float values accurately in (de)serialize_deflist. 2020-03-10 12:30:02 -04:00
typecmds.c Split out CreateCast into src/backend/catalog/pg_cast.c 2020-03-10 11:28:23 -03:00
user.c Fix error case for CREATE ROLE ... IN ROLE. 2020-04-25 05:09:30 +01:00
vacuum.c Fix the usage of parallel and full options of vacuum command. 2020-04-16 10:55:02 +05:30
variable.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
view.c Restructure ALTER TABLE execution to fix assorted bugs. 2020-01-15 18:49:24 -05:00