mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +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:
@ -78,7 +78,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.10 2000/05/30 04:24:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.11 2000/11/16 22:30:42 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -88,7 +88,6 @@
|
||||
#include "access/heapam.h"
|
||||
#include "access/nbtree.h"
|
||||
#include "miscadmin.h"
|
||||
#include "parser/parse_type.h"
|
||||
#include "utils/logtape.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/tuplesort.h"
|
||||
@ -506,7 +505,8 @@ tuplesort_begin_datum(Oid datumType,
|
||||
bool randomAccess)
|
||||
{
|
||||
Tuplesortstate *state = tuplesort_begin_common(randomAccess);
|
||||
Type typeInfo;
|
||||
int16 typlen;
|
||||
bool typbyval;
|
||||
|
||||
state->comparetup = comparetup_datum;
|
||||
state->copytup = copytup_datum;
|
||||
@ -519,9 +519,9 @@ tuplesort_begin_datum(Oid datumType,
|
||||
/* lookup the function that implements the sort operator */
|
||||
fmgr_info(get_opcode(sortOperator), &state->sortOpFn);
|
||||
/* lookup necessary attributes of the datum type */
|
||||
typeInfo = typeidType(datumType);
|
||||
state->datumTypeLen = typeLen(typeInfo);
|
||||
state->datumTypeByVal = typeByVal(typeInfo);
|
||||
get_typlenbyval(datumType, &typlen, &typbyval);
|
||||
state->datumTypeLen = typlen;
|
||||
state->datumTypeByVal = typbyval;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
Reference in New Issue
Block a user