diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-05-30 21:21:30 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-05-30 21:21:30 +0000 |
| commit | e60cb3a35c88d33dbfc53afb91f5bfff4209dad0 (patch) | |
| tree | 2a412f096d66722388b2b4b9d177ea37ab413866 /src/backend/utils/fmgr/fmgr.c | |
| parent | a18ebc5541c20bf6aca70532bbf1a0531d1b2659 (diff) | |
Code review for magic-block patch. Remove separate header file pgmagic.h,
as this seems only likely to create headaches for module developers. Put
the macro in the pre-existing fmgr.h file instead. Avoid being too cute
about how many fields we can cram into a word, and avoid trying to fetch
from a library we've already unlinked.
Along the way, it occurred to me that the magic block really ought to be
'const' so it can be stored in the program text area. Do the same for
the existing data blocks for PG_FUNCTION_INFO_V1 functions.
Diffstat (limited to 'src/backend/utils/fmgr/fmgr.c')
| -rw-r--r-- | src/backend/utils/fmgr/fmgr.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c index 4a663135dcb..4472b3fcc99 100644 --- a/src/backend/utils/fmgr/fmgr.c +++ b/src/backend/utils/fmgr/fmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.100 2006/04/04 19:35:36 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.101 2006/05/30 21:21:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -66,7 +66,7 @@ typedef struct TransactionId fn_xmin; /* for checking up-to-dateness */ CommandId fn_cmin; PGFunction user_fn; /* the function's address */ - Pg_finfo_record *inforec; /* address of its info record */ + const Pg_finfo_record *inforec; /* address of its info record */ } CFuncHashTabEntry; static HTAB *CFuncHash = NULL; @@ -78,7 +78,7 @@ static void fmgr_info_C_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedur static void fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple); static CFuncHashTabEntry *lookup_C_func(HeapTuple procedureTuple); static void record_C_func(HeapTuple procedureTuple, - PGFunction user_fn, Pg_finfo_record *inforec); + PGFunction user_fn, const Pg_finfo_record *inforec); static Datum fmgr_oldstyle(PG_FUNCTION_ARGS); static Datum fmgr_security_definer(PG_FUNCTION_ARGS); @@ -276,7 +276,7 @@ fmgr_info_C_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple) Form_pg_proc procedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple); CFuncHashTabEntry *hashentry; PGFunction user_fn; - Pg_finfo_record *inforec; + const Pg_finfo_record *inforec; Oldstyle_fnextra *fnextra; bool isnull; int i; @@ -405,12 +405,12 @@ fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple) * can validate the information record for a function not yet entered into * pg_proc. */ -Pg_finfo_record * +const Pg_finfo_record * fetch_finfo_record(void *filehandle, char *funcname) { char *infofuncname; PGFInfoFunction infofunc; - Pg_finfo_record *inforec; + const Pg_finfo_record *inforec; static Pg_finfo_record default_inforec = {0}; /* Compute name of info func */ @@ -493,7 +493,7 @@ lookup_C_func(HeapTuple procedureTuple) */ static void record_C_func(HeapTuple procedureTuple, - PGFunction user_fn, Pg_finfo_record *inforec) + PGFunction user_fn, const Pg_finfo_record *inforec) { Oid fn_oid = HeapTupleGetOid(procedureTuple); CFuncHashTabEntry *entry; |
