mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Clean up some minor problems exposed by further thought about Panon's bug
report on old-style functions invoked by RI triggers. We had a number of other places that were being sloppy about which memory context FmgrInfo subsidiary data will be allocated in. Turns out none of them actually cause a problem in 7.1, but this is for arcane reasons such as the fact that old-style triggers aren't supported anyway. To avoid getting burnt later, I've restructured the trigger support so that we don't keep trigger FmgrInfo structs in relcache memory. Some other related cleanups too: it's not really necessary to call fmgr_info at all while setting up the index support info in relcache entries, because those ScanKeyEntry structs are never used to invoke the functions. This should speed up relcache initialization a tiny bit.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.18 2001/01/24 19:42:47 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.19 2001/06/01 02:41:35 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -40,11 +40,13 @@ ScanKeyEntrySetIllegal(ScanKey entry)
|
||||
entry->sk_flags = 0; /* just in case... */
|
||||
entry->sk_attno = InvalidAttrNumber;
|
||||
entry->sk_procedure = 0; /* should be InvalidRegProcedure */
|
||||
entry->sk_func.fn_oid = InvalidOid;
|
||||
entry->sk_argument = (Datum) 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ScanKeyEntryInitialize
|
||||
* Initializes an scan key entry.
|
||||
* Initializes a scan key entry.
|
||||
*
|
||||
* Note:
|
||||
* Assumes the scan key entry is valid.
|
||||
@ -64,7 +66,6 @@ ScanKeyEntryInitialize(ScanKey entry,
|
||||
entry->sk_procedure = procedure;
|
||||
entry->sk_argument = argument;
|
||||
fmgr_info(procedure, &entry->sk_func);
|
||||
entry->sk_nargs = entry->sk_func.fn_nargs;
|
||||
|
||||
Assert(ScanKeyEntryIsLegal(entry));
|
||||
}
|
||||
|
Reference in New Issue
Block a user