mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.8 1997/09/07 04:39:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.9 1997/09/08 02:21:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -57,19 +57,19 @@ rtgettuple(IndexScanDesc s, ScanDirection dir)
|
||||
return (res);
|
||||
}
|
||||
|
||||
static RetrieveIndexResult
|
||||
static RetrieveIndexResult
|
||||
rtfirst(IndexScanDesc s, ScanDirection dir)
|
||||
{
|
||||
Buffer b;
|
||||
Page p;
|
||||
OffsetNumber n;
|
||||
OffsetNumber maxoff;
|
||||
Buffer b;
|
||||
Page p;
|
||||
OffsetNumber n;
|
||||
OffsetNumber maxoff;
|
||||
RetrieveIndexResult res;
|
||||
RTreePageOpaque po;
|
||||
RTreeScanOpaque so;
|
||||
RTSTACK *stk;
|
||||
BlockNumber blk;
|
||||
IndexTuple it;
|
||||
RTSTACK *stk;
|
||||
BlockNumber blk;
|
||||
IndexTuple it;
|
||||
|
||||
b = ReadBuffer(s->relation, P_ROOT);
|
||||
p = BufferGetPage(b);
|
||||
@@ -140,19 +140,19 @@ rtfirst(IndexScanDesc s, ScanDirection dir)
|
||||
}
|
||||
}
|
||||
|
||||
static RetrieveIndexResult
|
||||
static RetrieveIndexResult
|
||||
rtnext(IndexScanDesc s, ScanDirection dir)
|
||||
{
|
||||
Buffer b;
|
||||
Page p;
|
||||
OffsetNumber n;
|
||||
OffsetNumber maxoff;
|
||||
Buffer b;
|
||||
Page p;
|
||||
OffsetNumber n;
|
||||
OffsetNumber maxoff;
|
||||
RetrieveIndexResult res;
|
||||
RTreePageOpaque po;
|
||||
RTreeScanOpaque so;
|
||||
RTSTACK *stk;
|
||||
BlockNumber blk;
|
||||
IndexTuple it;
|
||||
RTSTACK *stk;
|
||||
BlockNumber blk;
|
||||
IndexTuple it;
|
||||
|
||||
blk = ItemPointerGetBlockNumber(&(s->currentItemData));
|
||||
n = ItemPointerGetOffsetNumber(&(s->currentItemData));
|
||||
@@ -241,11 +241,11 @@ rtnext(IndexScanDesc s, ScanDirection dir)
|
||||
}
|
||||
}
|
||||
|
||||
static OffsetNumber
|
||||
static OffsetNumber
|
||||
findnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
|
||||
{
|
||||
OffsetNumber maxoff;
|
||||
IndexTuple it;
|
||||
OffsetNumber maxoff;
|
||||
IndexTuple it;
|
||||
RTreePageOpaque po;
|
||||
RTreeScanOpaque so;
|
||||
|
||||
@@ -295,11 +295,11 @@ findnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
|
||||
return (n);
|
||||
}
|
||||
|
||||
static RetrieveIndexResult
|
||||
static RetrieveIndexResult
|
||||
rtscancache(IndexScanDesc s, ScanDirection dir)
|
||||
{
|
||||
RetrieveIndexResult res;
|
||||
ItemPointer ip;
|
||||
ItemPointer ip;
|
||||
|
||||
if (!(ScanDirectionIsNoMovement(dir)
|
||||
&& ItemPointerIsValid(&(s->currentItemData))))
|
||||
@@ -324,14 +324,14 @@ rtscancache(IndexScanDesc s, ScanDirection dir)
|
||||
* rtheapptr returns the item pointer to the tuple in the heap relation
|
||||
* for which itemp is the index relation item pointer.
|
||||
*/
|
||||
static ItemPointer
|
||||
static ItemPointer
|
||||
rtheapptr(Relation r, ItemPointer itemp)
|
||||
{
|
||||
Buffer b;
|
||||
Page p;
|
||||
IndexTuple it;
|
||||
ItemPointer ip;
|
||||
OffsetNumber n;
|
||||
Buffer b;
|
||||
Page p;
|
||||
IndexTuple it;
|
||||
ItemPointer ip;
|
||||
OffsetNumber n;
|
||||
|
||||
ip = (ItemPointer) palloc(sizeof(ItemPointerData));
|
||||
if (ItemPointerIsValid(itemp))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.8 1997/09/07 04:39:16 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.9 1997/09/08 02:21:05 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -25,7 +25,7 @@
|
||||
BOX
|
||||
* rt_box_union(BOX * a, BOX * b)
|
||||
{
|
||||
BOX *n;
|
||||
BOX *n;
|
||||
|
||||
if ((n = (BOX *) palloc(sizeof(*n))) == (BOX *) NULL)
|
||||
elog(WARN, "Cannot allocate box for union");
|
||||
@@ -38,10 +38,10 @@ BOX
|
||||
return (n);
|
||||
}
|
||||
|
||||
BOX *
|
||||
BOX *
|
||||
rt_box_inter(BOX * a, BOX * b)
|
||||
{
|
||||
BOX *n;
|
||||
BOX *n;
|
||||
|
||||
if ((n = (BOX *) palloc(sizeof(*n))) == (BOX *) NULL)
|
||||
elog(WARN, "Cannot allocate box for union");
|
||||
@@ -85,10 +85,10 @@ rt_bigbox_size(BOX * a, float *size)
|
||||
rt_box_size(a, size);
|
||||
}
|
||||
|
||||
POLYGON *
|
||||
POLYGON *
|
||||
rt_poly_union(POLYGON * a, POLYGON * b)
|
||||
{
|
||||
POLYGON *p;
|
||||
POLYGON *p;
|
||||
|
||||
p = (POLYGON *) PALLOCTYPE(POLYGON);
|
||||
|
||||
@@ -108,8 +108,8 @@ rt_poly_union(POLYGON * a, POLYGON * b)
|
||||
void
|
||||
rt_poly_size(POLYGON * a, float *size)
|
||||
{
|
||||
double xdim,
|
||||
ydim;
|
||||
double xdim,
|
||||
ydim;
|
||||
|
||||
size = (float *) palloc(sizeof(float));
|
||||
if (a == (POLYGON *) NULL ||
|
||||
@@ -127,10 +127,10 @@ rt_poly_size(POLYGON * a, float *size)
|
||||
return;
|
||||
}
|
||||
|
||||
POLYGON *
|
||||
POLYGON *
|
||||
rt_poly_inter(POLYGON * a, POLYGON * b)
|
||||
{
|
||||
POLYGON *p;
|
||||
POLYGON *p;
|
||||
|
||||
p = (POLYGON *) PALLOCTYPE(POLYGON);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.14 1997/09/07 04:39:22 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.15 1997/09/08 02:21:06 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -34,20 +34,20 @@
|
||||
|
||||
typedef struct SPLITVEC
|
||||
{
|
||||
OffsetNumber *spl_left;
|
||||
int spl_nleft;
|
||||
char *spl_ldatum;
|
||||
OffsetNumber *spl_right;
|
||||
int spl_nright;
|
||||
char *spl_rdatum;
|
||||
} SPLITVEC;
|
||||
OffsetNumber *spl_left;
|
||||
int spl_nleft;
|
||||
char *spl_ldatum;
|
||||
OffsetNumber *spl_right;
|
||||
int spl_nright;
|
||||
char *spl_rdatum;
|
||||
} SPLITVEC;
|
||||
|
||||
typedef struct RTSTATE
|
||||
{
|
||||
func_ptr unionFn; /* union function */
|
||||
func_ptr sizeFn; /* size function */
|
||||
func_ptr interFn; /* intersection function */
|
||||
} RTSTATE;
|
||||
func_ptr unionFn; /* union function */
|
||||
func_ptr sizeFn; /* size function */
|
||||
func_ptr interFn; /* intersection function */
|
||||
} RTSTATE;
|
||||
|
||||
/* non-export function prototypes */
|
||||
static InsertIndexResult
|
||||
@@ -62,16 +62,16 @@ dosplit(Relation r, Buffer buffer, RTSTACK * stack,
|
||||
static void
|
||||
rtintinsert(Relation r, RTSTACK * stk, IndexTuple ltup,
|
||||
IndexTuple rtup, RTSTATE * rtstate);
|
||||
static void rtnewroot(Relation r, IndexTuple lt, IndexTuple rt);
|
||||
static void rtnewroot(Relation r, IndexTuple lt, IndexTuple rt);
|
||||
static void
|
||||
picksplit(Relation r, Page page, SPLITVEC * v, IndexTuple itup,
|
||||
RTSTATE * rtstate);
|
||||
static void RTInitBuffer(Buffer b, uint32 f);
|
||||
static void RTInitBuffer(Buffer b, uint32 f);
|
||||
static OffsetNumber
|
||||
choose(Relation r, Page p, IndexTuple it,
|
||||
RTSTATE * rtstate);
|
||||
static int nospace(Page p, IndexTuple it);
|
||||
static void initRtstate(RTSTATE * rtstate, Relation index);
|
||||
static int nospace(Page p, IndexTuple it);
|
||||
static void initRtstate(RTSTATE * rtstate, Relation index);
|
||||
|
||||
|
||||
void
|
||||
@@ -85,31 +85,31 @@ rtbuild(Relation heap,
|
||||
FuncIndexInfo * finfo,
|
||||
PredInfo * predInfo)
|
||||
{
|
||||
HeapScanDesc scan;
|
||||
Buffer buffer;
|
||||
AttrNumber i;
|
||||
HeapTuple htup;
|
||||
IndexTuple itup;
|
||||
TupleDesc hd,
|
||||
id;
|
||||
HeapScanDesc scan;
|
||||
Buffer buffer;
|
||||
AttrNumber i;
|
||||
HeapTuple htup;
|
||||
IndexTuple itup;
|
||||
TupleDesc hd,
|
||||
id;
|
||||
InsertIndexResult res;
|
||||
Datum *d;
|
||||
bool *nulls;
|
||||
int nb,
|
||||
nh,
|
||||
ni;
|
||||
Datum *d;
|
||||
bool *nulls;
|
||||
int nb,
|
||||
nh,
|
||||
ni;
|
||||
|
||||
#ifndef OMIT_PARTIAL_INDEX
|
||||
ExprContext *econtext;
|
||||
TupleTable tupleTable;
|
||||
ExprContext *econtext;
|
||||
TupleTable tupleTable;
|
||||
TupleTableSlot *slot;
|
||||
|
||||
#endif
|
||||
Oid hrelid,
|
||||
irelid;
|
||||
Node *pred,
|
||||
*oldPred;
|
||||
RTSTATE rtState;
|
||||
Oid hrelid,
|
||||
irelid;
|
||||
Node *pred,
|
||||
*oldPred;
|
||||
RTSTATE rtState;
|
||||
|
||||
initRtstate(&rtState, index);
|
||||
|
||||
@@ -215,8 +215,8 @@ rtbuild(Relation heap,
|
||||
|
||||
for (i = 1; i <= natts; i++)
|
||||
{
|
||||
int attoff;
|
||||
bool attnull;
|
||||
int attoff;
|
||||
bool attnull;
|
||||
|
||||
/*
|
||||
* Offsets are from the start of the tuple, and are
|
||||
@@ -308,8 +308,8 @@ InsertIndexResult
|
||||
rtinsert(Relation r, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
|
||||
{
|
||||
InsertIndexResult res;
|
||||
IndexTuple itup;
|
||||
RTSTATE rtState;
|
||||
IndexTuple itup;
|
||||
RTSTATE rtState;
|
||||
|
||||
/* generate an index tuple */
|
||||
itup = index_formtuple(RelationGetTupleDescriptor(r), datum, nulls);
|
||||
@@ -323,18 +323,18 @@ rtinsert(Relation r, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation h
|
||||
return (res);
|
||||
}
|
||||
|
||||
static InsertIndexResult
|
||||
static InsertIndexResult
|
||||
rtdoinsert(Relation r, IndexTuple itup, RTSTATE * rtstate)
|
||||
{
|
||||
Page page;
|
||||
Buffer buffer;
|
||||
BlockNumber blk;
|
||||
IndexTuple which;
|
||||
OffsetNumber l;
|
||||
RTSTACK *stack;
|
||||
Page page;
|
||||
Buffer buffer;
|
||||
BlockNumber blk;
|
||||
IndexTuple which;
|
||||
OffsetNumber l;
|
||||
RTSTACK *stack;
|
||||
InsertIndexResult res;
|
||||
RTreePageOpaque opaque;
|
||||
char *datum;
|
||||
char *datum;
|
||||
|
||||
blk = P_ROOT;
|
||||
buffer = InvalidBuffer;
|
||||
@@ -353,8 +353,8 @@ rtdoinsert(Relation r, IndexTuple itup, RTSTATE * rtstate)
|
||||
opaque = (RTreePageOpaque) PageGetSpecialPointer(page);
|
||||
if (!(opaque->flags & F_LEAF))
|
||||
{
|
||||
RTSTACK *n;
|
||||
ItemId iid;
|
||||
RTSTACK *n;
|
||||
ItemId iid;
|
||||
|
||||
n = (RTSTACK *) palloc(sizeof(RTSTACK));
|
||||
n->rts_parent = stack;
|
||||
@@ -414,12 +414,12 @@ rttighten(Relation r,
|
||||
int att_size,
|
||||
RTSTATE * rtstate)
|
||||
{
|
||||
char *oldud;
|
||||
char *tdatum;
|
||||
Page p;
|
||||
float old_size,
|
||||
newd_size;
|
||||
Buffer b;
|
||||
char *oldud;
|
||||
char *tdatum;
|
||||
Page p;
|
||||
float old_size,
|
||||
newd_size;
|
||||
Buffer b;
|
||||
|
||||
if (stk == (RTSTACK *) NULL)
|
||||
return;
|
||||
@@ -437,7 +437,7 @@ rttighten(Relation r,
|
||||
|
||||
if (newd_size != old_size)
|
||||
{
|
||||
TupleDesc td = RelationGetTupleDescriptor(r);
|
||||
TupleDesc td = RelationGetTupleDescriptor(r);
|
||||
|
||||
if (td->attrs[0]->attlen < 0)
|
||||
{
|
||||
@@ -480,35 +480,35 @@ rttighten(Relation r,
|
||||
* his paper. The reason we chose it is that you can implement this
|
||||
* with less information about the data types on which you're operating.
|
||||
*/
|
||||
static InsertIndexResult
|
||||
static InsertIndexResult
|
||||
dosplit(Relation r,
|
||||
Buffer buffer,
|
||||
RTSTACK * stack,
|
||||
IndexTuple itup,
|
||||
RTSTATE * rtstate)
|
||||
{
|
||||
Page p;
|
||||
Buffer leftbuf,
|
||||
rightbuf;
|
||||
Page left,
|
||||
right;
|
||||
ItemId itemid;
|
||||
IndexTuple item;
|
||||
IndexTuple ltup,
|
||||
rtup;
|
||||
OffsetNumber maxoff;
|
||||
OffsetNumber i;
|
||||
OffsetNumber leftoff,
|
||||
rightoff;
|
||||
BlockNumber lbknum,
|
||||
rbknum;
|
||||
BlockNumber bufblock;
|
||||
Page p;
|
||||
Buffer leftbuf,
|
||||
rightbuf;
|
||||
Page left,
|
||||
right;
|
||||
ItemId itemid;
|
||||
IndexTuple item;
|
||||
IndexTuple ltup,
|
||||
rtup;
|
||||
OffsetNumber maxoff;
|
||||
OffsetNumber i;
|
||||
OffsetNumber leftoff,
|
||||
rightoff;
|
||||
BlockNumber lbknum,
|
||||
rbknum;
|
||||
BlockNumber bufblock;
|
||||
RTreePageOpaque opaque;
|
||||
int blank;
|
||||
int blank;
|
||||
InsertIndexResult res;
|
||||
char *isnull;
|
||||
SPLITVEC v;
|
||||
TupleDesc tupDesc;
|
||||
char *isnull;
|
||||
SPLITVEC v;
|
||||
TupleDesc tupDesc;
|
||||
|
||||
isnull = (char *) palloc(r->rd_rel->relnatts);
|
||||
for (blank = 0; blank < r->rd_rel->relnatts; blank++)
|
||||
@@ -638,12 +638,12 @@ rtintinsert(Relation r,
|
||||
IndexTuple rtup,
|
||||
RTSTATE * rtstate)
|
||||
{
|
||||
IndexTuple old;
|
||||
Buffer b;
|
||||
Page p;
|
||||
char *ldatum,
|
||||
*rdatum,
|
||||
*newdatum;
|
||||
IndexTuple old;
|
||||
Buffer b;
|
||||
Page p;
|
||||
char *ldatum,
|
||||
*rdatum,
|
||||
*newdatum;
|
||||
InsertIndexResult res;
|
||||
|
||||
if (stk == (RTSTACK *) NULL)
|
||||
@@ -698,8 +698,8 @@ rtintinsert(Relation r,
|
||||
static void
|
||||
rtnewroot(Relation r, IndexTuple lt, IndexTuple rt)
|
||||
{
|
||||
Buffer b;
|
||||
Page p;
|
||||
Buffer b;
|
||||
Page p;
|
||||
|
||||
b = ReadBuffer(r, P_ROOT);
|
||||
RTInitBuffer(b, 0);
|
||||
@@ -718,33 +718,33 @@ picksplit(Relation r,
|
||||
IndexTuple itup,
|
||||
RTSTATE * rtstate)
|
||||
{
|
||||
OffsetNumber maxoff;
|
||||
OffsetNumber i,
|
||||
j;
|
||||
IndexTuple item_1,
|
||||
item_2;
|
||||
char *datum_alpha,
|
||||
*datum_beta;
|
||||
char *datum_l,
|
||||
*datum_r;
|
||||
char *union_d,
|
||||
*union_dl,
|
||||
*union_dr;
|
||||
char *inter_d;
|
||||
bool firsttime;
|
||||
float size_alpha,
|
||||
size_beta,
|
||||
size_union,
|
||||
size_inter;
|
||||
float size_waste,
|
||||
waste;
|
||||
float size_l,
|
||||
size_r;
|
||||
int nbytes;
|
||||
OffsetNumber seed_1 = 0,
|
||||
seed_2 = 0;
|
||||
OffsetNumber *left,
|
||||
*right;
|
||||
OffsetNumber maxoff;
|
||||
OffsetNumber i,
|
||||
j;
|
||||
IndexTuple item_1,
|
||||
item_2;
|
||||
char *datum_alpha,
|
||||
*datum_beta;
|
||||
char *datum_l,
|
||||
*datum_r;
|
||||
char *union_d,
|
||||
*union_dl,
|
||||
*union_dr;
|
||||
char *inter_d;
|
||||
bool firsttime;
|
||||
float size_alpha,
|
||||
size_beta,
|
||||
size_union,
|
||||
size_inter;
|
||||
float size_waste,
|
||||
waste;
|
||||
float size_l,
|
||||
size_r;
|
||||
int nbytes;
|
||||
OffsetNumber seed_1 = 0,
|
||||
seed_2 = 0;
|
||||
OffsetNumber *left,
|
||||
*right;
|
||||
|
||||
maxoff = PageGetMaxOffsetNumber(page);
|
||||
|
||||
@@ -886,8 +886,8 @@ static void
|
||||
RTInitBuffer(Buffer b, uint32 f)
|
||||
{
|
||||
RTreePageOpaque opaque;
|
||||
Page page;
|
||||
Size pageSize;
|
||||
Page page;
|
||||
Size pageSize;
|
||||
|
||||
pageSize = BufferGetPageSize(b);
|
||||
|
||||
@@ -899,18 +899,18 @@ RTInitBuffer(Buffer b, uint32 f)
|
||||
opaque->flags = f;
|
||||
}
|
||||
|
||||
static OffsetNumber
|
||||
static OffsetNumber
|
||||
choose(Relation r, Page p, IndexTuple it, RTSTATE * rtstate)
|
||||
{
|
||||
OffsetNumber maxoff;
|
||||
OffsetNumber i;
|
||||
char *ud,
|
||||
*id;
|
||||
char *datum;
|
||||
float usize,
|
||||
dsize;
|
||||
OffsetNumber which;
|
||||
float which_grow;
|
||||
OffsetNumber maxoff;
|
||||
OffsetNumber i;
|
||||
char *ud,
|
||||
*id;
|
||||
char *datum;
|
||||
float usize,
|
||||
dsize;
|
||||
OffsetNumber which;
|
||||
float which_grow;
|
||||
|
||||
id = ((char *) it) + sizeof(IndexTupleData);
|
||||
maxoff = PageGetMaxOffsetNumber(p);
|
||||
@@ -946,7 +946,7 @@ nospace(Page p, IndexTuple it)
|
||||
void
|
||||
freestack(RTSTACK * s)
|
||||
{
|
||||
RTSTACK *p;
|
||||
RTSTACK *p;
|
||||
|
||||
while (s != (RTSTACK *) NULL)
|
||||
{
|
||||
@@ -956,13 +956,13 @@ freestack(RTSTACK * s)
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
char *
|
||||
rtdelete(Relation r, ItemPointer tid)
|
||||
{
|
||||
BlockNumber blkno;
|
||||
OffsetNumber offnum;
|
||||
Buffer buf;
|
||||
Page page;
|
||||
BlockNumber blkno;
|
||||
OffsetNumber offnum;
|
||||
Buffer buf;
|
||||
Page page;
|
||||
|
||||
/* must write-lock on delete */
|
||||
RelationSetLockForWrite(r);
|
||||
@@ -988,11 +988,11 @@ rtdelete(Relation r, ItemPointer tid)
|
||||
static void
|
||||
initRtstate(RTSTATE * rtstate, Relation index)
|
||||
{
|
||||
RegProcedure union_proc,
|
||||
size_proc,
|
||||
inter_proc;
|
||||
func_ptr user_fn;
|
||||
int pronargs;
|
||||
RegProcedure union_proc,
|
||||
size_proc,
|
||||
inter_proc;
|
||||
func_ptr user_fn;
|
||||
int pronargs;
|
||||
|
||||
union_proc = index_getprocid(index, 1, RT_UNION_PROC);
|
||||
size_proc = index_getprocid(index, 1, RT_SIZE_PROC);
|
||||
@@ -1011,18 +1011,18 @@ initRtstate(RTSTATE * rtstate, Relation index)
|
||||
void
|
||||
_rtdump(Relation r)
|
||||
{
|
||||
Buffer buf;
|
||||
Page page;
|
||||
OffsetNumber offnum,
|
||||
maxoff;
|
||||
BlockNumber blkno;
|
||||
BlockNumber nblocks;
|
||||
Buffer buf;
|
||||
Page page;
|
||||
OffsetNumber offnum,
|
||||
maxoff;
|
||||
BlockNumber blkno;
|
||||
BlockNumber nblocks;
|
||||
RTreePageOpaque po;
|
||||
IndexTuple itup;
|
||||
BlockNumber itblkno;
|
||||
OffsetNumber itoffno;
|
||||
char *datum;
|
||||
char *itkey;
|
||||
IndexTuple itup;
|
||||
BlockNumber itblkno;
|
||||
OffsetNumber itoffno;
|
||||
char *datum;
|
||||
char *itkey;
|
||||
|
||||
nblocks = RelationGetNumberOfBlocks(r);
|
||||
for (blkno = 0; blkno < nblocks; blkno++)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.11 1997/09/07 04:39:24 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.12 1997/09/08 02:21:08 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
|
||||
/* routines defined and used here */
|
||||
static void rtregscan(IndexScanDesc s);
|
||||
static void rtdropscan(IndexScanDesc s);
|
||||
static void rtregscan(IndexScanDesc s);
|
||||
static void rtdropscan(IndexScanDesc s);
|
||||
static void
|
||||
rtadjone(IndexScanDesc s, int op, BlockNumber blkno,
|
||||
OffsetNumber offnum);
|
||||
@@ -52,9 +52,9 @@ adjustiptr(IndexScanDesc s, ItemPointer iptr,
|
||||
|
||||
typedef struct RTScanListData
|
||||
{
|
||||
IndexScanDesc rtsl_scan;
|
||||
IndexScanDesc rtsl_scan;
|
||||
struct RTScanListData *rtsl_next;
|
||||
} RTScanListData;
|
||||
} RTScanListData;
|
||||
|
||||
typedef RTScanListData *RTScanList;
|
||||
|
||||
@@ -67,7 +67,7 @@ rtbeginscan(Relation r,
|
||||
uint16 nkeys,
|
||||
ScanKey key)
|
||||
{
|
||||
IndexScanDesc s;
|
||||
IndexScanDesc s;
|
||||
|
||||
RelationSetLockForRead(r);
|
||||
s = RelationGetIndexScan(r, fromEnd, nkeys, key);
|
||||
@@ -80,8 +80,8 @@ void
|
||||
rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
|
||||
{
|
||||
RTreeScanOpaque p;
|
||||
RegProcedure internal_proc;
|
||||
int i;
|
||||
RegProcedure internal_proc;
|
||||
int i;
|
||||
|
||||
if (!IndexScanIsValid(s))
|
||||
{
|
||||
@@ -177,9 +177,9 @@ void
|
||||
rtmarkpos(IndexScanDesc s)
|
||||
{
|
||||
RTreeScanOpaque p;
|
||||
RTSTACK *o,
|
||||
*n,
|
||||
*tmp;
|
||||
RTSTACK *o,
|
||||
*n,
|
||||
*tmp;
|
||||
|
||||
s->currentMarkData = s->currentItemData;
|
||||
p = (RTreeScanOpaque) s->opaque;
|
||||
@@ -210,9 +210,9 @@ void
|
||||
rtrestrpos(IndexScanDesc s)
|
||||
{
|
||||
RTreeScanOpaque p;
|
||||
RTSTACK *o,
|
||||
*n,
|
||||
*tmp;
|
||||
RTSTACK *o,
|
||||
*n,
|
||||
*tmp;
|
||||
|
||||
s->currentItemData = s->currentMarkData;
|
||||
p = (RTreeScanOpaque) s->opaque;
|
||||
@@ -260,7 +260,7 @@ rtendscan(IndexScanDesc s)
|
||||
static void
|
||||
rtregscan(IndexScanDesc s)
|
||||
{
|
||||
RTScanList l;
|
||||
RTScanList l;
|
||||
|
||||
l = (RTScanList) palloc(sizeof(RTScanListData));
|
||||
l->rtsl_scan = s;
|
||||
@@ -271,8 +271,8 @@ rtregscan(IndexScanDesc s)
|
||||
static void
|
||||
rtdropscan(IndexScanDesc s)
|
||||
{
|
||||
RTScanList l;
|
||||
RTScanList prev;
|
||||
RTScanList l;
|
||||
RTScanList prev;
|
||||
|
||||
prev = (RTScanList) NULL;
|
||||
|
||||
@@ -297,8 +297,8 @@ rtdropscan(IndexScanDesc s)
|
||||
void
|
||||
rtadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum)
|
||||
{
|
||||
RTScanList l;
|
||||
Oid relid;
|
||||
RTScanList l;
|
||||
Oid relid;
|
||||
|
||||
relid = r->rd_id;
|
||||
for (l = RTScans; l != (RTScanList) NULL; l = l->rtsl_next)
|
||||
@@ -352,7 +352,7 @@ adjustiptr(IndexScanDesc s,
|
||||
BlockNumber blkno,
|
||||
OffsetNumber offnum)
|
||||
{
|
||||
OffsetNumber curoff;
|
||||
OffsetNumber curoff;
|
||||
RTreeScanOpaque so;
|
||||
|
||||
if (ItemPointerIsValid(iptr))
|
||||
@@ -364,39 +364,43 @@ adjustiptr(IndexScanDesc s,
|
||||
|
||||
switch (op)
|
||||
{
|
||||
case RTOP_DEL:
|
||||
/* back up one if we need to */
|
||||
if (curoff >= offnum)
|
||||
{
|
||||
case RTOP_DEL:
|
||||
/* back up one if we need to */
|
||||
if (curoff >= offnum)
|
||||
{
|
||||
|
||||
if (curoff > FirstOffsetNumber)
|
||||
{
|
||||
/* just adjust the item pointer */
|
||||
ItemPointerSet(iptr, blkno, OffsetNumberPrev(curoff));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* remember that we're before the current tuple */
|
||||
ItemPointerSet(iptr, blkno, FirstOffsetNumber);
|
||||
if (iptr == &(s->currentItemData))
|
||||
so->s_flags |= RTS_CURBEFORE;
|
||||
if (curoff > FirstOffsetNumber)
|
||||
{
|
||||
/* just adjust the item pointer */
|
||||
ItemPointerSet(iptr, blkno, OffsetNumberPrev(curoff));
|
||||
}
|
||||
else
|
||||
so->s_flags |= RTS_MRKBEFORE;
|
||||
{
|
||||
|
||||
/*
|
||||
* remember that we're before the current
|
||||
* tuple
|
||||
*/
|
||||
ItemPointerSet(iptr, blkno, FirstOffsetNumber);
|
||||
if (iptr == &(s->currentItemData))
|
||||
so->s_flags |= RTS_CURBEFORE;
|
||||
else
|
||||
so->s_flags |= RTS_MRKBEFORE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case RTOP_SPLIT:
|
||||
/* back to start of page on split */
|
||||
ItemPointerSet(iptr, blkno, FirstOffsetNumber);
|
||||
if (iptr == &(s->currentItemData))
|
||||
so->s_flags &= ~RTS_CURBEFORE;
|
||||
else
|
||||
so->s_flags &= ~RTS_MRKBEFORE;
|
||||
break;
|
||||
case RTOP_SPLIT:
|
||||
/* back to start of page on split */
|
||||
ItemPointerSet(iptr, blkno, FirstOffsetNumber);
|
||||
if (iptr == &(s->currentItemData))
|
||||
so->s_flags &= ~RTS_CURBEFORE;
|
||||
else
|
||||
so->s_flags &= ~RTS_MRKBEFORE;
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "Bad operation in rtree scan adjust: %d", op);
|
||||
default:
|
||||
elog(WARN, "Bad operation in rtree scan adjust: %d", op);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtstrat.c,v 1.7 1997/09/07 04:39:26 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtstrat.c,v 1.8 1997/09/08 02:21:11 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -118,7 +118,7 @@ static StrategyNumber RTNegateCommute[RTNStrategies] = {
|
||||
*/
|
||||
|
||||
/* if you only have "contained-by", how do you determine equality? */
|
||||
static uint16 RTContainedByTermData[] = {
|
||||
static uint16 RTContainedByTermData[] = {
|
||||
2, /* make two comparisons */
|
||||
RTContainedByStrategyNumber,/* use "a contained-by b" */
|
||||
0x0, /* without any magic */
|
||||
@@ -127,7 +127,7 @@ static uint16 RTContainedByTermData[] = {
|
||||
};
|
||||
|
||||
/* if you only have "contains", how do you determine equality? */
|
||||
static uint16 RTContainsTermData[] = {
|
||||
static uint16 RTContainsTermData[] = {
|
||||
2, /* make two comparisons */
|
||||
RTContainsStrategyNumber, /* use "a contains b" */
|
||||
0x0, /* without any magic */
|
||||
@@ -204,7 +204,7 @@ static StrategyNumber RTOperMap[RTNStrategies] = {
|
||||
RTOverlapStrategyNumber
|
||||
};
|
||||
|
||||
static StrategyNumber
|
||||
static StrategyNumber
|
||||
RelationGetRTStrategy(Relation r,
|
||||
AttrNumber attnum,
|
||||
RegProcedure proc)
|
||||
@@ -231,8 +231,8 @@ RTMapOperator(Relation r,
|
||||
AttrNumber attnum,
|
||||
RegProcedure proc)
|
||||
{
|
||||
StrategyNumber procstrat;
|
||||
StrategyMap strategyMap;
|
||||
StrategyNumber procstrat;
|
||||
StrategyMap strategyMap;
|
||||
|
||||
procstrat = RelationGetRTStrategy(r, attnum, proc);
|
||||
strategyMap = IndexStrategyGetStrategyMap(RelationGetIndexStrategy(r),
|
||||
|
||||
Reference in New Issue
Block a user