diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-07-20 15:18:25 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-07-20 15:18:25 +0900 |
commit | 2a990abd79acea4717cc8f982a28f35b6b347ddb (patch) | |
tree | 2a5b181b6d75fe5cd20367a327cd80f7e0cca868 /src/backend/utils/adt/acl.c | |
parent | 47556a0013fa64d44add2760577d49cf2eca4cd0 (diff) | |
download | postgresql-2a990abd79acea4717cc8f982a28f35b6b347ddb.tar.gz postgresql-2a990abd79acea4717cc8f982a28f35b6b347ddb.zip |
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
Diffstat (limited to 'src/backend/utils/adt/acl.c')
-rw-r--r-- | src/backend/utils/adt/acl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index 883e09393a4..27eabb80abc 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -5334,13 +5334,13 @@ get_rolespec_tuple(const RoleSpec *role) case ROLESPEC_CURRENT_ROLE: case ROLESPEC_CURRENT_USER: - tuple = SearchSysCache1(AUTHOID, GetUserId()); + tuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(GetUserId())); if (!HeapTupleIsValid(tuple)) elog(ERROR, "cache lookup failed for role %u", GetUserId()); break; case ROLESPEC_SESSION_USER: - tuple = SearchSysCache1(AUTHOID, GetSessionUserId()); + tuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(GetSessionUserId())); if (!HeapTupleIsValid(tuple)) elog(ERROR, "cache lookup failed for role %u", GetSessionUserId()); break; |