mirror of
https://github.com/postgres/postgres.git
synced 2025-08-15 14:02:29 +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/parser/parse_oper.c,v 1.111 2010/01/02 16:57:50 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.112 2010/02/14 18:42:15 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -421,9 +421,7 @@ oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId,
|
||||
operOid = find_oper_cache_entry(&key);
|
||||
if (OidIsValid(operOid))
|
||||
{
|
||||
tup = SearchSysCache(OPEROID,
|
||||
ObjectIdGetDatum(operOid),
|
||||
0, 0, 0);
|
||||
tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
|
||||
if (HeapTupleIsValid(tup))
|
||||
return (Operator) tup;
|
||||
}
|
||||
@@ -463,9 +461,7 @@ oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId,
|
||||
}
|
||||
|
||||
if (OidIsValid(operOid))
|
||||
tup = SearchSysCache(OPEROID,
|
||||
ObjectIdGetDatum(operOid),
|
||||
0, 0, 0);
|
||||
tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
|
||||
|
||||
if (HeapTupleIsValid(tup))
|
||||
{
|
||||
@@ -571,9 +567,7 @@ right_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
|
||||
operOid = find_oper_cache_entry(&key);
|
||||
if (OidIsValid(operOid))
|
||||
{
|
||||
tup = SearchSysCache(OPEROID,
|
||||
ObjectIdGetDatum(operOid),
|
||||
0, 0, 0);
|
||||
tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
|
||||
if (HeapTupleIsValid(tup))
|
||||
return (Operator) tup;
|
||||
}
|
||||
@@ -605,9 +599,7 @@ right_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
|
||||
}
|
||||
|
||||
if (OidIsValid(operOid))
|
||||
tup = SearchSysCache(OPEROID,
|
||||
ObjectIdGetDatum(operOid),
|
||||
0, 0, 0);
|
||||
tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
|
||||
|
||||
if (HeapTupleIsValid(tup))
|
||||
{
|
||||
@@ -653,9 +645,7 @@ left_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
|
||||
operOid = find_oper_cache_entry(&key);
|
||||
if (OidIsValid(operOid))
|
||||
{
|
||||
tup = SearchSysCache(OPEROID,
|
||||
ObjectIdGetDatum(operOid),
|
||||
0, 0, 0);
|
||||
tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
|
||||
if (HeapTupleIsValid(tup))
|
||||
return (Operator) tup;
|
||||
}
|
||||
@@ -699,9 +689,7 @@ left_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
|
||||
}
|
||||
|
||||
if (OidIsValid(operOid))
|
||||
tup = SearchSysCache(OPEROID,
|
||||
ObjectIdGetDatum(operOid),
|
||||
0, 0, 0);
|
||||
tup = SearchSysCache1(OPEROID, ObjectIdGetDatum(operOid));
|
||||
|
||||
if (HeapTupleIsValid(tup))
|
||||
{
|
||||
|
Reference in New Issue
Block a user