mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Major code cleanups from D'arcy (-Wall -Werror)
This commit is contained in:
@@ -145,9 +145,11 @@ gistbuild(Relation heap,
|
||||
Datum *d;
|
||||
bool *nulls;
|
||||
int nb, nh, ni;
|
||||
#ifndef OMIT_PARTIAL_INDEX
|
||||
ExprContext *econtext;
|
||||
TupleTable tupleTable;
|
||||
TupleTableSlot *slot;
|
||||
#endif
|
||||
Oid hrelid, irelid;
|
||||
Node *pred, *oldPred;
|
||||
GISTSTATE giststate;
|
||||
@@ -199,6 +201,12 @@ gistbuild(Relation heap,
|
||||
econtext = makeNode(ExprContext);
|
||||
FillDummyExprContext(econtext, slot, hd, buffer);
|
||||
}
|
||||
else /* shut the compiler up */
|
||||
{
|
||||
tupleTable = NULL;
|
||||
slot = NULL;
|
||||
econtext = NULL;
|
||||
}
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
scan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
htup = heap_getnext(scan, 0, &buffer);
|
||||
|
||||
@@ -113,7 +113,7 @@ static StrategyEvaluationData GISTEvaluationData = {
|
||||
(StrategyTransformMap) GISTNegate, /* how to do (not qual) */
|
||||
(StrategyTransformMap) GISTCommute, /* how to swap operands */
|
||||
(StrategyTransformMap) GISTNegateCommute, /* how to do both */
|
||||
NULL
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
StrategyNumber
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.5 1996/10/21 05:45:11 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.6 1996/10/23 07:38:29 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains only the public interface routines.
|
||||
@@ -113,9 +113,11 @@ hashbuild(Relation heap,
|
||||
int nhtups, nitups;
|
||||
int i;
|
||||
HashItem hitem;
|
||||
#ifndef OMIT_PARTIAL_INDEX
|
||||
ExprContext *econtext;
|
||||
TupleTable tupleTable;
|
||||
TupleTableSlot *slot;
|
||||
#endif
|
||||
Oid hrelid, irelid;
|
||||
Node *pred, *oldPred;
|
||||
|
||||
@@ -151,6 +153,12 @@ hashbuild(Relation heap,
|
||||
econtext = makeNode(ExprContext);
|
||||
FillDummyExprContext(econtext, slot, htupdesc, buffer);
|
||||
}
|
||||
else /* quiet the compiler */
|
||||
{
|
||||
econtext = NULL;
|
||||
tupleTable = 0;
|
||||
slot = 0;
|
||||
}
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
|
||||
/* start a heap scan */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.4 1996/10/21 05:45:14 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.5 1996/10/23 07:38:32 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Overflow pages look like ordinary relation pages.
|
||||
@@ -132,12 +132,12 @@ static OverflowPageAddress
|
||||
_hash_getovfladdr(Relation rel, Buffer *metabufp)
|
||||
{
|
||||
HashMetaPage metap;
|
||||
Buffer mapbuf;
|
||||
Buffer mapbuf = 0;
|
||||
BlockNumber blkno;
|
||||
PageOffset offset;
|
||||
OverflowPageAddress oaddr;
|
||||
SplitNumber splitnum;
|
||||
uint32 *freep;
|
||||
uint32 *freep = NULL;
|
||||
uint32 max_free;
|
||||
uint32 bit;
|
||||
uint32 first_page;
|
||||
@@ -356,7 +356,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
|
||||
* XXX this should look like:
|
||||
* - lock prev/next
|
||||
* - modify/write prev/next (how to do write ordering with a
|
||||
* doubly-linked list???)
|
||||
* doubly-linked list?)
|
||||
* - unlock prev/next
|
||||
*/
|
||||
if (BlockNumberIsValid(prevblkno)) {
|
||||
@@ -503,7 +503,7 @@ _hash_squeezebucket(Relation rel,
|
||||
Bucket bucket)
|
||||
{
|
||||
Buffer wbuf;
|
||||
Buffer rbuf;
|
||||
Buffer rbuf = 0;
|
||||
BlockNumber wblkno;
|
||||
BlockNumber rblkno;
|
||||
Page wpage;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.3 1996/10/21 07:38:20 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.4 1996/10/23 07:38:43 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -233,8 +233,8 @@ StrategyTermEvaluate(StrategyTerm term,
|
||||
Datum right)
|
||||
{
|
||||
Index index;
|
||||
long tmpres;
|
||||
bool result;
|
||||
long tmpres = 0;
|
||||
bool result = 0;
|
||||
StrategyOperator operator;
|
||||
ScanKey entry;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.2 1996/10/20 10:53:02 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.3 1996/10/23 07:38:54 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
@@ -20,8 +20,10 @@
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
#include "utils/nabstime.h"
|
||||
|
||||
int32
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.2 1996/10/20 10:53:03 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.3 1996/10/23 07:39:00 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "catalog/pg_attribute.h"
|
||||
@@ -37,15 +40,14 @@
|
||||
#include "storage/itemid.h"
|
||||
#include "storage/item.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include <time.h>
|
||||
#include "utils/nabstime.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/sdir.h"
|
||||
#include "access/nbtree.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/bufmgr.h"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.2 1996/10/20 10:53:06 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.3 1996/10/23 07:39:04 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Postgres btree pages look like ordinary relation pages. The opaque
|
||||
@@ -19,6 +19,8 @@
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
@@ -36,7 +38,6 @@
|
||||
#include "utils/rel.h"
|
||||
|
||||
#include "storage/buf.h"
|
||||
|
||||
#include "storage/block.h"
|
||||
#include "storage/off.h"
|
||||
#include "storage/itemptr.h"
|
||||
@@ -45,7 +46,6 @@
|
||||
#include "storage/itemid.h"
|
||||
#include "storage/item.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include <time.h>
|
||||
#include "utils/nabstime.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
@@ -53,9 +53,9 @@
|
||||
#include "access/sdir.h"
|
||||
#include "access/nbtree.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "storage/lmgr.h"
|
||||
|
||||
#define BTREE_METAPAGE 0
|
||||
#define BTREE_MAGIC 0x053162
|
||||
|
||||
@@ -8,13 +8,15 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.4 1996/10/20 10:53:08 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.5 1996/10/23 07:39:06 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains only the public interface routines.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
@@ -25,6 +27,7 @@
|
||||
#include "storage/fd.h"
|
||||
#include "catalog/pg_am.h"
|
||||
#include "catalog/pg_class.h"
|
||||
#include "catalog/index.h"
|
||||
#include "nodes/nodes.h"
|
||||
#include "rewrite/prs2lock.h"
|
||||
#include "access/skey.h"
|
||||
@@ -40,10 +43,11 @@
|
||||
#include "storage/item.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include <time.h>
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/nabstime.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/sdir.h"
|
||||
#include "access/nbtree.h"
|
||||
@@ -59,7 +63,6 @@
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "tcop/dest.h"
|
||||
#include "executor/execdesc.h"
|
||||
#include <stdio.h>
|
||||
#include "catalog/pg_index.h"
|
||||
#include "executor/executor.h"
|
||||
|
||||
@@ -96,13 +99,15 @@ btbuild(Relation heap,
|
||||
TupleDesc htupdesc, itupdesc;
|
||||
Datum *attdata;
|
||||
bool *nulls;
|
||||
InsertIndexResult res;
|
||||
InsertIndexResult res = 0;
|
||||
int nhtups, nitups;
|
||||
int i;
|
||||
BTItem btitem;
|
||||
#ifndef OMIT_PARTIAL_INDEX
|
||||
ExprContext *econtext;
|
||||
TupleTable tupleTable;
|
||||
TupleTableSlot *slot;
|
||||
#endif
|
||||
Oid hrelid, irelid;
|
||||
Node *pred, *oldPred;
|
||||
void *spool;
|
||||
@@ -139,6 +144,12 @@ btbuild(Relation heap,
|
||||
econtext = makeNode(ExprContext);
|
||||
FillDummyExprContext(econtext, slot, htupdesc, InvalidBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
econtext = NULL;
|
||||
tupleTable = NULL;
|
||||
slot = NULL;
|
||||
}
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
|
||||
/* start a heap scan */
|
||||
@@ -152,6 +163,8 @@ btbuild(Relation heap,
|
||||
spool = _bt_spoolinit(index, 7);
|
||||
res = (InsertIndexResult) NULL;
|
||||
}
|
||||
else
|
||||
spool = NULL;
|
||||
|
||||
for (; HeapTupleIsValid(htup); htup = heap_getnext(hscan, 0, &buffer)) {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.2 1996/10/20 10:53:10 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.3 1996/10/23 07:39:08 scrappy Exp $
|
||||
*
|
||||
*
|
||||
* NOTES
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "utils/nabstime.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/sdir.h"
|
||||
#include "access/nbtree.h"
|
||||
|
||||
@@ -7,11 +7,13 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.3 1996/10/20 10:53:11 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.4 1996/10/23 07:39:10 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "catalog/pg_attribute.h"
|
||||
@@ -36,13 +38,17 @@
|
||||
#include "storage/item.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include <time.h>
|
||||
#include "storage/bufmgr.h"
|
||||
#include "utils/nabstime.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/sdir.h"
|
||||
#include "access/nbtree.h"
|
||||
#include "access/genam.h"
|
||||
|
||||
#include "fmgr.h"
|
||||
|
||||
static BTStack _bt_searchr(Relation rel, int keysz, ScanKey scankey, Buffer *bufP, BTStack stack_in);
|
||||
static OffsetNumber _bt_firsteq(Relation rel, TupleDesc itupdesc, Page page, Size keysz, ScanKey scankey, OffsetNumber offnum);
|
||||
@@ -296,14 +302,13 @@ _bt_binsrch(Relation rel,
|
||||
Page page;
|
||||
BTPageOpaque opaque;
|
||||
OffsetNumber low, mid, high;
|
||||
bool match;
|
||||
int result;
|
||||
|
||||
page = BufferGetPage(buf);
|
||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
|
||||
/* by convention, item 0 on any non-rightmost page is the high key */
|
||||
low = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
|
||||
low = mid = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
|
||||
|
||||
high = PageGetMaxOffsetNumber(page);
|
||||
|
||||
@@ -320,7 +325,6 @@ _bt_binsrch(Relation rel,
|
||||
return (low);
|
||||
|
||||
itupdesc = RelationGetTupleDescriptor(rel);
|
||||
match = false;
|
||||
|
||||
while ((high - low) > 1) {
|
||||
mid = low + ((high - low) / 2);
|
||||
@@ -330,16 +334,9 @@ _bt_binsrch(Relation rel,
|
||||
low = mid;
|
||||
else if (result < 0)
|
||||
high = mid - 1;
|
||||
else {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we found a match, we want to find the first one on the page */
|
||||
if (match) {
|
||||
else
|
||||
return (_bt_firsteq(rel, itupdesc, page, keysz, scankey, mid));
|
||||
} else {
|
||||
}
|
||||
|
||||
/*
|
||||
* We terminated because the endpoints got too close together. There
|
||||
@@ -387,7 +384,6 @@ _bt_binsrch(Relation rel,
|
||||
return (OffsetNumberNext(high));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static OffsetNumber
|
||||
@@ -1039,7 +1035,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
||||
ItemPointer current;
|
||||
ItemPointer iptr;
|
||||
OffsetNumber offnum, maxoff;
|
||||
OffsetNumber start;
|
||||
OffsetNumber start = 0;
|
||||
BlockNumber blkno;
|
||||
BTItem btitem;
|
||||
IndexTuple itup;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Id: nbtsort.c,v 1.4 1996/10/20 10:53:13 scrappy Exp $
|
||||
* $Id: nbtsort.c,v 1.5 1996/10/23 07:39:11 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -47,6 +47,10 @@
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "catalog/pg_attribute.h"
|
||||
@@ -71,17 +75,14 @@
|
||||
#include "storage/item.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include <time.h>
|
||||
#include "utils/nabstime.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/sdir.h"
|
||||
#include "access/nbtree.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/bufmgr.h"
|
||||
|
||||
|
||||
@@ -7,11 +7,13 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.3 1996/10/20 10:53:18 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.4 1996/10/23 07:39:15 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "catalog/pg_attribute.h"
|
||||
@@ -36,15 +38,18 @@
|
||||
#include "storage/item.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include <time.h>
|
||||
#include "utils/nabstime.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/sdir.h"
|
||||
#include "access/nbtree.h"
|
||||
|
||||
#include "access/istrat.h"
|
||||
#include "access/genam.h"
|
||||
#include "access/iqual.h"
|
||||
|
||||
#include "fmgr.h"
|
||||
|
||||
ScanKey
|
||||
_bt_mkscankey(Relation rel, IndexTuple itup)
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.2 1996/10/20 09:27:04 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.3 1996/10/23 07:39:20 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "catalog/pg_attribute.h"
|
||||
@@ -32,16 +35,18 @@
|
||||
#include "storage/block.h"
|
||||
#include "storage/off.h"
|
||||
#include "storage/itemptr.h"
|
||||
#include <time.h>
|
||||
#include "utils/nabstime.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "storage/buf.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/iqual.h"
|
||||
|
||||
#include "storage/itemid.h"
|
||||
#include "storage/item.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include "storage/bufmgr.h"
|
||||
|
||||
#include "access/itup.h"
|
||||
|
||||
|
||||
@@ -7,15 +7,17 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.2 1996/10/20 09:27:06 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.3 1996/10/23 07:39:23 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "utils/geo-decls.h"
|
||||
|
||||
#include "utils/palloc.h"
|
||||
|
||||
BOX
|
||||
*rt_box_union(BOX *a, BOX *b)
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.4 1996/10/20 09:27:07 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.5 1996/10/23 07:39:24 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "catalog/pg_attribute.h"
|
||||
@@ -21,6 +24,7 @@
|
||||
#include "storage/fd.h"
|
||||
#include "catalog/pg_am.h"
|
||||
#include "catalog/pg_class.h"
|
||||
#include "catalog/index.h"
|
||||
#include "nodes/nodes.h"
|
||||
#include "rewrite/prs2lock.h"
|
||||
#include "access/skey.h"
|
||||
@@ -30,22 +34,23 @@
|
||||
#include "storage/block.h"
|
||||
#include "storage/off.h"
|
||||
#include "storage/itemptr.h"
|
||||
#include <time.h>
|
||||
#include "utils/nabstime.h"
|
||||
#include "access/htup.h"
|
||||
|
||||
#include "access/itup.h"
|
||||
|
||||
#include "utils/tqual.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "storage/buf.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/rtscan.h"
|
||||
|
||||
#include "storage/itemid.h"
|
||||
#include "storage/item.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include "storage/lmgr.h"
|
||||
|
||||
#include "access/rtree.h"
|
||||
|
||||
#include "access/funcindex.h"
|
||||
|
||||
#include "nodes/params.h"
|
||||
@@ -56,7 +61,6 @@
|
||||
#include "executor/tuptable.h"
|
||||
#include "nodes/execnodes.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/bufmgr.h"
|
||||
|
||||
@@ -126,9 +130,11 @@ rtbuild(Relation heap,
|
||||
Datum *d;
|
||||
bool *nulls;
|
||||
int nb, nh, ni;
|
||||
#ifndef OMIT_PARTIAL_INDEX
|
||||
ExprContext *econtext;
|
||||
TupleTable tupleTable;
|
||||
TupleTableSlot *slot;
|
||||
#endif
|
||||
Oid hrelid, irelid;
|
||||
Node *pred, *oldPred;
|
||||
RTSTATE rtState;
|
||||
@@ -176,6 +182,12 @@ rtbuild(Relation heap,
|
||||
econtext = makeNode(ExprContext);
|
||||
FillDummyExprContext(econtext, slot, hd, buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
econtext = NULL;
|
||||
tupleTable = NULL;
|
||||
slot = NULL;
|
||||
}
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
scan = heap_beginscan(heap, 0, NowTimeQual, 0, (ScanKey) NULL);
|
||||
htup = heap_getnext(scan, 0, &buffer);
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.4 1996/10/20 09:27:10 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.5 1996/10/23 07:39:26 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "postgres.h"
|
||||
|
||||
#include "catalog/pg_attribute.h"
|
||||
@@ -30,14 +33,17 @@
|
||||
#include "storage/block.h"
|
||||
#include "storage/off.h"
|
||||
#include "storage/itemptr.h"
|
||||
#include <time.h>
|
||||
#include "utils/nabstime.h"
|
||||
#include "utils/palloc.h"
|
||||
#include "access/htup.h"
|
||||
#include "utils/tqual.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "access/relscan.h"
|
||||
|
||||
#include "access/rtree.h"
|
||||
#include "access/rtstrat.h"
|
||||
|
||||
#include "access/itup.h"
|
||||
#include "access/funcindex.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.3 1996/10/21 07:15:06 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.4 1996/10/23 07:39:32 scrappy Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains support functions for the high
|
||||
@@ -78,7 +78,7 @@ TransComputeBlockNumber(Relation relation, /* relation to test */
|
||||
TransactionId transactionId, /* transaction id to test */
|
||||
BlockNumber *blockNumberOutP)
|
||||
{
|
||||
long itemsPerBlock;
|
||||
long itemsPerBlock = 0;
|
||||
|
||||
/* ----------------
|
||||
* we calculate the block number of our transaction
|
||||
|
||||
Reference in New Issue
Block a user