mirror of
https://github.com/postgres/postgres.git
synced 2025-07-23 03:21:12 +03:00
Change SearchSysCache coding conventions so that a reference count is
maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.22 2000/08/08 15:41:24 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.23 2000/11/16 22:30:23 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
|
||||
@ -20,7 +20,10 @@
|
||||
* Andrew Yu Oct 20, 1994 file creation
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
#include "nodes/makefuncs.h"
|
||||
#include "utils/lsyscache.h"
|
||||
|
||||
|
||||
/*
|
||||
* makeOper -
|
||||
@ -143,6 +146,26 @@ makeConst(Oid consttype,
|
||||
return cnst;
|
||||
}
|
||||
|
||||
/*
|
||||
* makeNullConst -
|
||||
* creates a Const node representing a NULL of the specified type
|
||||
*/
|
||||
Const *
|
||||
makeNullConst(Oid consttype)
|
||||
{
|
||||
int16 typLen;
|
||||
bool typByVal;
|
||||
|
||||
get_typlenbyval(consttype, &typLen, &typByVal);
|
||||
return makeConst(consttype,
|
||||
(int) typLen,
|
||||
(Datum) 0,
|
||||
true,
|
||||
typByVal,
|
||||
false,
|
||||
false);
|
||||
}
|
||||
|
||||
/*
|
||||
* makeAttr -
|
||||
* creates an Attr node
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.133 2000/11/16 05:51:00 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.134 2000/11/16 22:30:23 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@ -1236,8 +1236,8 @@ _outJoinInfo(StringInfo str, JoinInfo *node)
|
||||
static void
|
||||
_outDatum(StringInfo str, Datum value, Oid type)
|
||||
{
|
||||
int16 typeLength;
|
||||
bool byValue;
|
||||
int typeLength;
|
||||
Size length;
|
||||
char *s;
|
||||
int i;
|
||||
@ -1246,8 +1246,7 @@ _outDatum(StringInfo str, Datum value, Oid type)
|
||||
* find some information about the type and the "real" length of the
|
||||
* datum.
|
||||
*/
|
||||
byValue = get_typbyval(type);
|
||||
typeLength = get_typlen(type);
|
||||
get_typlenbyval(type, &typeLength, &byValue);
|
||||
length = datumGetSize(value, byValue, typeLength);
|
||||
|
||||
if (byValue)
|
||||
|
Reference in New Issue
Block a user