From 2a990abd79acea4717cc8f982a28f35b6b347ddb Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Thu, 20 Jul 2023 15:18:25 +0900 Subject: Add missing ObjectIdGetDatum() in syscache lookup calls for Oids Based on how postgres.h foes the Oid <-> Datum conversion, there is no existing bugs but let's be consistent. 17 spots have been noticed as incorrectly passing down Oids rather than Datums. Aleksander got one, Zhang two and I the rest. Author: Michael Paquier, Aleksander Alekseev, Zhang Mingli Discussion: https://postgr.es/m/ZLUhqsqQN1MOaxdw@paquier.xyz --- src/backend/commands/user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/commands/user.c') diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 6b42d4fc34a..ce77a055e58 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -1935,7 +1935,7 @@ AddRoleMems(Oid currentUserId, const char *rolename, Oid roleid, HeapTuple mrtup; Form_pg_authid mrform; - mrtup = SearchSysCache1(AUTHOID, memberid); + mrtup = SearchSysCache1(AUTHOID, ObjectIdGetDatum(memberid)); if (!HeapTupleIsValid(mrtup)) elog(ERROR, "cache lookup failed for role %u", memberid); mrform = (Form_pg_authid) GETSTRUCT(mrtup); -- cgit v1.2.3