Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf2d1205

Browse files
committed
Another batch of fmgr updates. I think I have gotten all old-style
functions that take pass-by-value datatypes. Should be ready forport testing ...
1 parent8f057d9 commitf2d1205

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1642
-1594
lines changed

‎src/backend/access/gist/gist.c

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.55 2000/05/30 04:24:28 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.56 2000/06/13 07:34:27 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -47,7 +47,6 @@ static BlockNumber gistChooseSubtree(Relation r, IndexTuple itup, int level,
4747
staticOffsetNumbergistchoose(Relationr,Pagep,IndexTupleit,
4848
GISTSTATE*giststate);
4949
staticintgistnospace(Pagep,IndexTupleit);
50-
voidgistdelete(Relationr,ItemPointertid);
5150
staticIndexTuplegist_tuple_replacekey(Relationr,GISTENTRYentry,IndexTuplet);
5251
staticvoidgistcentryinit(GISTSTATE*giststate,GISTENTRY*e,char*pr,
5352
Relationr,Pagepg,OffsetNumbero,intb,booll);
@@ -60,17 +59,20 @@ static char *int_range_out(INTRANGE *r);
6059
/*
6160
** routine to build an index. Basically calls insert over and over
6261
*/
63-
void
64-
gistbuild(Relationheap,
65-
Relationindex,
66-
intnatts,
67-
AttrNumber*attnum,
68-
IndexStrategyistrat,
69-
uint16pint,
70-
Datum*params,
71-
FuncIndexInfo*finfo,
72-
PredInfo*predInfo)
62+
Datum
63+
gistbuild(PG_FUNCTION_ARGS)
7364
{
65+
Relationheap= (Relation)PG_GETARG_POINTER(0);
66+
Relationindex= (Relation)PG_GETARG_POINTER(1);
67+
int32natts=PG_GETARG_INT32(2);
68+
AttrNumber*attnum= (AttrNumber*)PG_GETARG_POINTER(3);
69+
#ifdefNOT_USED
70+
IndexStrategyistrat= (IndexStrategy)PG_GETARG_POINTER(4);
71+
uint16pcount=PG_GETARG_UINT16(5);
72+
Datum*params= (Datum*)PG_GETARG_POINTER(6);
73+
#endif
74+
FuncIndexInfo*finfo= (FuncIndexInfo*)PG_GETARG_POINTER(7);
75+
PredInfo*predInfo= (PredInfo*)PG_GETARG_POINTER(8);
7476
HeapScanDescscan;
7577
AttrNumberi;
7678
HeapTuplehtup;
@@ -83,12 +85,10 @@ gistbuild(Relation heap,
8385
intnb,
8486
nh,
8587
ni;
86-
8788
#ifndefOMIT_PARTIAL_INDEX
8889
ExprContext*econtext;
8990
TupleTabletupleTable;
9091
TupleTableSlot*slot;
91-
9292
#endif
9393
Node*pred,
9494
*oldPred;
@@ -302,6 +302,8 @@ gistbuild(Relation heap,
302302
/* be tidy */
303303
pfree(nulls);
304304
pfree(d);
305+
306+
PG_RETURN_POINTER(NULL);/* no real return value */
305307
}
306308

307309
/*
@@ -310,9 +312,16 @@ gistbuild(Relation heap,
310312
* This is the public interface routine for tuple insertion in GiSTs.
311313
* It doesn't do any work; just locks the relation and passes the buck.
312314
*/
313-
InsertIndexResult
314-
gistinsert(Relationr,Datum*datum,char*nulls,ItemPointerht_ctid,RelationheapRel)
315+
Datum
316+
gistinsert(PG_FUNCTION_ARGS)
315317
{
318+
Relationr= (Relation)PG_GETARG_POINTER(0);
319+
Datum*datum= (Datum*)PG_GETARG_POINTER(1);
320+
char*nulls= (char*)PG_GETARG_POINTER(2);
321+
ItemPointerht_ctid= (ItemPointer)PG_GETARG_POINTER(3);
322+
#ifdefNOT_USED
323+
RelationheapRel= (Relation)PG_GETARG_POINTER(4);
324+
#endif
316325
InsertIndexResultres;
317326
IndexTupleitup;
318327
GISTSTATEgiststate;
@@ -351,7 +360,7 @@ gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation
351360
pfree(itup);
352361
pfree(compvec);
353362

354-
returnres;
363+
PG_RETURN_POINTER(res);
355364
}
356365

357366
/*
@@ -596,7 +605,9 @@ gistAdjustKeys(Relation r,
596605

597606
/* delete old tuple */
598607
ItemPointerSet(&oldtid,stk->gs_blk,stk->gs_child);
599-
gistdelete(r, (ItemPointer)&oldtid);
608+
DirectFunctionCall2(gistdelete,
609+
PointerGetDatum(r),
610+
PointerGetDatum(&oldtid));
600611

601612
/* generate and insert new tuple */
602613
tupDesc=r->rd_att;
@@ -890,7 +901,9 @@ gistintinsert(Relation r,
890901

891902
/* remove old left pointer, insert the 2 new entries */
892903
ItemPointerSet(&ltid,stk->gs_blk,stk->gs_child);
893-
gistdelete(r, (ItemPointer)&ltid);
904+
DirectFunctionCall2(gistdelete,
905+
PointerGetDatum(r),
906+
PointerGetDatum(&ltid));
894907
gistentryinserttwo(r,stk,ltup,rtup,giststate);
895908
}
896909

@@ -1105,9 +1118,11 @@ gistfreestack(GISTSTACK *s)
11051118
/*
11061119
** remove an entry from a page
11071120
*/
1108-
void
1109-
gistdelete(Relationr,ItemPointertid)
1121+
Datum
1122+
gistdelete(PG_FUNCTION_ARGS)
11101123
{
1124+
Relationr= (Relation)PG_GETARG_POINTER(0);
1125+
ItemPointertid= (ItemPointer)PG_GETARG_POINTER(1);
11111126
BlockNumberblkno;
11121127
OffsetNumberoffnum;
11131128
Bufferbuf;
@@ -1134,6 +1149,7 @@ gistdelete(Relation r, ItemPointer tid)
11341149

11351150
WriteBuffer(buf);
11361151

1152+
PG_RETURN_POINTER(NULL);/* no real return value */
11371153
}
11381154

11391155
void

‎src/backend/access/gist/gistget.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,23 @@ static bool gistindex_keytest(IndexTuple tuple, TupleDesc tupdesc,
2929
Relationr,Pagep,OffsetNumberoffset);
3030

3131

32-
RetrieveIndexResult
33-
gistgettuple(IndexScanDescs,ScanDirectiondir)
32+
Datum
33+
gistgettuple(PG_FUNCTION_ARGS)
3434
{
35+
IndexScanDescs= (IndexScanDesc)PG_GETARG_POINTER(0);
36+
ScanDirectiondir= (ScanDirection)PG_GETARG_INT32(1);
3537
RetrieveIndexResultres;
3638

3739
/* if we have it cached in the scan desc, just return the value */
3840
if ((res=gistscancache(s,dir))!= (RetrieveIndexResult)NULL)
39-
returnres;
41+
PG_RETURN_POINTER(res);
4042

4143
/* not cached, so we'll have to do some work */
4244
if (ItemPointerIsValid(&(s->currentItemData)))
4345
res=gistnext(s,dir);
4446
else
4547
res=gistfirst(s,dir);
46-
returnres;
48+
PG_RETURN_POINTER(res);
4749
}
4850

4951
staticRetrieveIndexResult

‎src/backend/access/gist/gistscan.c

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ typedef GISTScanListData *GISTScanList;
4848
/* pointer to list of local scans on GiSTs */
4949
staticGISTScanListGISTScans= (GISTScanList)NULL;
5050

51-
IndexScanDesc
52-
gistbeginscan(Relationr,
53-
boolfromEnd,
54-
uint16nkeys,
55-
ScanKeykey)
51+
Datum
52+
gistbeginscan(PG_FUNCTION_ARGS)
5653
{
54+
Relationr= (Relation)PG_GETARG_POINTER(0);
55+
boolfromEnd=PG_GETARG_BOOL(1);
56+
uint16nkeys=PG_GETARG_UINT16(2);
57+
ScanKeykey= (ScanKey)PG_GETARG_POINTER(3);
5758
IndexScanDescs;
5859

5960
/*
@@ -65,21 +66,18 @@ gistbeginscan(Relation r,
6566
s=RelationGetIndexScan(r,fromEnd,nkeys,key);
6667
gistregscan(s);
6768

68-
returns;
69+
PG_RETURN_POINTER(s);
6970
}
7071

71-
void
72-
gistrescan(IndexScanDescs,boolfromEnd,ScanKeykey)
72+
Datum
73+
gistrescan(PG_FUNCTION_ARGS)
7374
{
75+
IndexScanDescs= (IndexScanDesc)PG_GETARG_POINTER(0);
76+
boolfromEnd=PG_GETARG_BOOL(1);
77+
ScanKeykey= (ScanKey)PG_GETARG_POINTER(2);
7478
GISTScanOpaquep;
7579
inti;
7680

77-
if (!IndexScanIsValid(s))
78-
{
79-
elog(ERROR,"gistrescan: invalid scan.");
80-
return;
81-
}
82-
8381
/*
8482
* Clear all the pointers.
8583
*/
@@ -155,11 +153,14 @@ gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
155153
s->keyData[i].sk_func=p->giststate->consistentFn;
156154
}
157155
}
156+
157+
PG_RETURN_POINTER(NULL);/* no real return value */
158158
}
159159

160-
void
161-
gistmarkpos(IndexScanDescs)
160+
Datum
161+
gistmarkpos(PG_FUNCTION_ARGS)
162162
{
163+
IndexScanDescs= (IndexScanDesc)PG_GETARG_POINTER(0);
163164
GISTScanOpaquep;
164165
GISTSTACK*o,
165166
*n,
@@ -188,11 +189,14 @@ gistmarkpos(IndexScanDesc s)
188189

189190
gistfreestack(p->s_markstk);
190191
p->s_markstk=o;
192+
193+
PG_RETURN_POINTER(NULL);/* no real return value */
191194
}
192195

193-
void
194-
gistrestrpos(IndexScanDescs)
196+
Datum
197+
gistrestrpos(PG_FUNCTION_ARGS)
195198
{
199+
IndexScanDescs= (IndexScanDesc)PG_GETARG_POINTER(0);
196200
GISTScanOpaquep;
197201
GISTSTACK*o,
198202
*n,
@@ -221,12 +225,15 @@ gistrestrpos(IndexScanDesc s)
221225

222226
gistfreestack(p->s_stack);
223227
p->s_stack=o;
228+
229+
PG_RETURN_POINTER(NULL);/* no real return value */
224230
}
225231

226-
void
227-
gistendscan(IndexScanDescs)
232+
Datum
233+
gistendscan(PG_FUNCTION_ARGS)
228234
{
229-
GISTScanOpaquep;
235+
IndexScanDescs= (IndexScanDesc)PG_GETARG_POINTER(0);
236+
GISTScanOpaquep;
230237

231238
p= (GISTScanOpaque)s->opaque;
232239

@@ -239,6 +246,8 @@ gistendscan(IndexScanDesc s)
239246

240247
gistdropscan(s);
241248
/* XXX don't unset read lock -- two-phase locking */
249+
250+
PG_RETURN_POINTER(NULL);/* no real return value */
242251
}
243252

244253
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp