mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Wrap calls to SearchSysCache and related functions using macros.
The purpose of this change is to eliminate the need for every caller of SearchSysCache, SearchSysCacheCopy, SearchSysCacheExists, GetSysCacheOid, and SearchSysCacheList to know the maximum number of allowable keys for a syscache entry (currently 4). This will make it far easier to increase the maximum number of keys in a future release should we choose to do so, and it makes the code shorter, too. Design and review by Tom Lane.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.213 2010/01/02 16:57:45 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.214 2010/02/14 18:42:14 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -911,9 +911,7 @@ SPI_gettype(TupleDesc tupdesc, int fnumber)
|
||||
else
|
||||
typoid = (SystemAttributeDefinition(fnumber, true))->atttypid;
|
||||
|
||||
typeTuple = SearchSysCache(TYPEOID,
|
||||
ObjectIdGetDatum(typoid),
|
||||
0, 0, 0);
|
||||
typeTuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typoid));
|
||||
|
||||
if (!HeapTupleIsValid(typeTuple))
|
||||
{
|
||||
|
Reference in New Issue
Block a user