diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-11-16 22:30:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-11-16 22:30:52 +0000 |
commit | a933ee38bbb8dffbc48a3363a94ff6f2a9f7964d (patch) | |
tree | 1c32737389b2530e7152dc2287161b36d9001e8c /src/backend/nodes/makefuncs.c | |
parent | cff23842a4c68301ddf34559c7af383bb5557054 (diff) | |
download | postgresql-a933ee38bbb8dffbc48a3363a94ff6f2a9f7964d.tar.gz postgresql-a933ee38bbb8dffbc48a3363a94ff6f2a9f7964d.zip |
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.
Diffstat (limited to 'src/backend/nodes/makefuncs.c')
-rw-r--r-- | src/backend/nodes/makefuncs.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/backend/nodes/makefuncs.c b/src/backend/nodes/makefuncs.c index 45e1c03738c..95bf730963f 100644 --- a/src/backend/nodes/makefuncs.c +++ b/src/backend/nodes/makefuncs.c @@ -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 - @@ -144,6 +147,26 @@ makeConst(Oid consttype, } /* + * 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 */ |