mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +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:
3
src/backend/utils/cache/partcache.c
vendored
3
src/backend/utils/cache/partcache.c
vendored
@ -365,7 +365,8 @@ generate_partition_qual(Relation rel)
|
||||
parent = relation_open(parentrelid, AccessShareLock);
|
||||
|
||||
/* Get pg_class.relpartbound */
|
||||
tuple = SearchSysCache1(RELOID, RelationGetRelid(rel));
|
||||
tuple = SearchSysCache1(RELOID,
|
||||
ObjectIdGetDatum(RelationGetRelid(rel)));
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
elog(ERROR, "cache lookup failed for relation %u",
|
||||
RelationGetRelid(rel));
|
||||
|
Reference in New Issue
Block a user