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/commands/sequence.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/commands/sequence.c')
-rw-r--r-- | src/backend/commands/sequence.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index ef014496782..fc4f77e787e 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -1718,7 +1718,7 @@ sequence_options(Oid relid) Form_pg_sequence pgsform; List *options = NIL; - pgstuple = SearchSysCache1(SEQRELID, relid); + pgstuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(relid)); if (!HeapTupleIsValid(pgstuple)) elog(ERROR, "cache lookup failed for sequence %u", relid); pgsform = (Form_pg_sequence) GETSTRUCT(pgstuple); @@ -1766,7 +1766,7 @@ pg_sequence_parameters(PG_FUNCTION_ARGS) memset(isnull, 0, sizeof(isnull)); - pgstuple = SearchSysCache1(SEQRELID, relid); + pgstuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(relid)); if (!HeapTupleIsValid(pgstuple)) elog(ERROR, "cache lookup failed for sequence %u", relid); pgsform = (Form_pg_sequence) GETSTRUCT(pgstuple); |