mirror of
https://github.com/postgres/postgres.git
synced 2025-10-15 05:46:52 +03:00
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
This commit is contained in:
6
src/backend/utils/cache/lsyscache.c
vendored
6
src/backend/utils/cache/lsyscache.c
vendored
@@ -2106,7 +2106,8 @@ get_transform_fromsql(Oid typid, Oid langid, List *trftypes)
|
||||
if (!list_member_oid(trftypes, typid))
|
||||
return InvalidOid;
|
||||
|
||||
tup = SearchSysCache2(TRFTYPELANG, typid, langid);
|
||||
tup = SearchSysCache2(TRFTYPELANG, ObjectIdGetDatum(typid),
|
||||
ObjectIdGetDatum(langid));
|
||||
if (HeapTupleIsValid(tup))
|
||||
{
|
||||
Oid funcid;
|
||||
@@ -2127,7 +2128,8 @@ get_transform_tosql(Oid typid, Oid langid, List *trftypes)
|
||||
if (!list_member_oid(trftypes, typid))
|
||||
return InvalidOid;
|
||||
|
||||
tup = SearchSysCache2(TRFTYPELANG, typid, langid);
|
||||
tup = SearchSysCache2(TRFTYPELANG, ObjectIdGetDatum(typid),
|
||||
ObjectIdGetDatum(langid));
|
||||
if (HeapTupleIsValid(tup))
|
||||
{
|
||||
Oid funcid;
|
||||
|
Reference in New Issue
Block a user