mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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:
@@ -4313,7 +4313,7 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
|
||||
Datum datum;
|
||||
PartitionBoundSpec *bspec;
|
||||
|
||||
tuple = SearchSysCache1(RELOID, inhrelid);
|
||||
tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(inhrelid));
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
elog(ERROR, "cache lookup failed for relation %u", inhrelid);
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ RelationBuildPartitionDesc(Relation rel, bool omit_detached)
|
||||
PartitionBoundSpec *boundspec = NULL;
|
||||
|
||||
/* Try fetching the tuple from the catcache, for speed. */
|
||||
tuple = SearchSysCache1(RELOID, inhrelid);
|
||||
tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(inhrelid));
|
||||
if (HeapTupleIsValid(tuple))
|
||||
{
|
||||
Datum datum;
|
||||
|
||||
Reference in New Issue
Block a user