mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Fix a bunch of minor portability problems and maybe-bugs revealed by
running gcc and HP's cc with warnings cranked way up. Signed vs unsigned comparisons, routines declared static and then defined not-static, that kind of thing. Tedious, but perhaps useful...
This commit is contained in:
parent
bc1f117094
commit
341b328b18
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.51 2000/03/01 05:39:20 inoue Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.52 2000/03/17 02:36:00 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1193,7 +1193,7 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
|
|||||||
char *datum = (((char *) t) + sizeof(IndexTupleData));
|
char *datum = (((char *) t) + sizeof(IndexTupleData));
|
||||||
|
|
||||||
/* if new entry fits in index tuple, copy it in */
|
/* if new entry fits in index tuple, copy it in */
|
||||||
if (entry.bytes < IndexTupleSize(t) - sizeof(IndexTupleData))
|
if ((Size) entry.bytes < IndexTupleSize(t) - sizeof(IndexTupleData))
|
||||||
{
|
{
|
||||||
memcpy(datum, entry.pred, entry.bytes);
|
memcpy(datum, entry.pred, entry.bytes);
|
||||||
/* clear out old size */
|
/* clear out old size */
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.19 2000/01/26 05:55:55 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.20 2000/03/17 02:36:02 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -112,7 +112,7 @@ _hash_insertonpg(Relation rel,
|
|||||||
Page page;
|
Page page;
|
||||||
BlockNumber itup_blkno;
|
BlockNumber itup_blkno;
|
||||||
OffsetNumber itup_off;
|
OffsetNumber itup_off;
|
||||||
int itemsz;
|
Size itemsz;
|
||||||
HashPageOpaque pageopaque;
|
HashPageOpaque pageopaque;
|
||||||
bool do_expand = false;
|
bool do_expand = false;
|
||||||
Buffer ovflbuf;
|
Buffer ovflbuf;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.26 2000/01/26 05:55:55 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.27 2000/03/17 02:36:02 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Overflow pages look like ordinary relation pages.
|
* Overflow pages look like ordinary relation pages.
|
||||||
@ -171,7 +171,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we need to allocate a new bitmap page */
|
/* Check if we need to allocate a new bitmap page */
|
||||||
if (free_bit == BMPGSZ_BIT(metap) - 1)
|
if (free_bit == (uint32) (BMPGSZ_BIT(metap) - 1))
|
||||||
{
|
{
|
||||||
/* won't be needing old map page */
|
/* won't be needing old map page */
|
||||||
|
|
||||||
@ -478,7 +478,7 @@ _hash_squeezebucket(Relation rel,
|
|||||||
OffsetNumber woffnum;
|
OffsetNumber woffnum;
|
||||||
OffsetNumber roffnum;
|
OffsetNumber roffnum;
|
||||||
HashItem hitem;
|
HashItem hitem;
|
||||||
int itemsz;
|
Size itemsz;
|
||||||
|
|
||||||
/* elog(DEBUG, "_hash_squeezebucket: squeezing bucket %d", bucket); */
|
/* elog(DEBUG, "_hash_squeezebucket: squeezing bucket %d", bucket); */
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.26 2000/01/26 05:55:55 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.27 2000/03/17 02:36:02 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Postgres hash pages look like ordinary relation pages. The opaque
|
* Postgres hash pages look like ordinary relation pages. The opaque
|
||||||
@ -464,7 +464,7 @@ _hash_splitpage(Relation rel,
|
|||||||
HashPageOpaque nopaque;
|
HashPageOpaque nopaque;
|
||||||
HashMetaPage metap;
|
HashMetaPage metap;
|
||||||
IndexTuple itup;
|
IndexTuple itup;
|
||||||
int itemsz;
|
Size itemsz;
|
||||||
OffsetNumber ooffnum;
|
OffsetNumber ooffnum;
|
||||||
OffsetNumber noffnum;
|
OffsetNumber noffnum;
|
||||||
OffsetNumber omaxoffnum;
|
OffsetNumber omaxoffnum;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.22 2000/01/26 05:55:55 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.23 2000/03/17 02:36:02 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -351,7 +351,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf)
|
|||||||
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
|
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
|
||||||
Assert(opaque->hasho_bucket == bucket);
|
Assert(opaque->hasho_bucket == bucket);
|
||||||
while (PageIsEmpty(page) &&
|
while (PageIsEmpty(page) &&
|
||||||
BlockNumberIsValid(opaque->hasho_nextblkno))
|
BlockNumberIsValid(opaque->hasho_nextblkno))
|
||||||
_hash_readnext(rel, &buf, &page, &opaque);
|
_hash_readnext(rel, &buf, &page, &opaque);
|
||||||
maxoff = PageGetMaxOffsetNumber(page);
|
maxoff = PageGetMaxOffsetNumber(page);
|
||||||
offnum = FirstOffsetNumber;
|
offnum = FirstOffsetNumber;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Id: hio.c,v 1.29 2000/01/26 05:55:56 momjian Exp $
|
* $Id: hio.c,v 1.30 2000/03/17 02:36:02 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -39,7 +39,7 @@ RelationPutHeapTuple(Relation relation,
|
|||||||
{
|
{
|
||||||
Page pageHeader;
|
Page pageHeader;
|
||||||
OffsetNumber offnum;
|
OffsetNumber offnum;
|
||||||
unsigned int len;
|
Size len;
|
||||||
ItemId itemId;
|
ItemId itemId;
|
||||||
Item item;
|
Item item;
|
||||||
|
|
||||||
@ -51,8 +51,8 @@ RelationPutHeapTuple(Relation relation,
|
|||||||
IncrHeapAccessStat(global_RelationPutHeapTuple);
|
IncrHeapAccessStat(global_RelationPutHeapTuple);
|
||||||
|
|
||||||
pageHeader = (Page) BufferGetPage(buffer);
|
pageHeader = (Page) BufferGetPage(buffer);
|
||||||
len = (unsigned) MAXALIGN(tuple->t_len); /* be conservative */
|
len = MAXALIGN(tuple->t_len); /* be conservative */
|
||||||
Assert((int) len <= PageGetFreeSpace(pageHeader));
|
Assert(len <= PageGetFreeSpace(pageHeader));
|
||||||
|
|
||||||
offnum = PageAddItem((Page) pageHeader, (Item) tuple->t_data,
|
offnum = PageAddItem((Page) pageHeader, (Item) tuple->t_data,
|
||||||
tuple->t_len, InvalidOffsetNumber, LP_USED);
|
tuple->t_len, InvalidOffsetNumber, LP_USED);
|
||||||
@ -104,18 +104,18 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
|
|||||||
Page pageHeader;
|
Page pageHeader;
|
||||||
BlockNumber lastblock;
|
BlockNumber lastblock;
|
||||||
OffsetNumber offnum;
|
OffsetNumber offnum;
|
||||||
unsigned int len;
|
Size len;
|
||||||
ItemId itemId;
|
ItemId itemId;
|
||||||
Item item;
|
Item item;
|
||||||
|
|
||||||
len = (unsigned) MAXALIGN(tuple->t_len); /* be conservative */
|
len = MAXALIGN(tuple->t_len); /* be conservative */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we're gonna fail for oversize tuple, do it right away...
|
* If we're gonna fail for oversize tuple, do it right away...
|
||||||
* this code should go away eventually.
|
* this code should go away eventually.
|
||||||
*/
|
*/
|
||||||
if (len > MaxTupleSize)
|
if (len > MaxTupleSize)
|
||||||
elog(ERROR, "Tuple is too big: size %d, max size %ld",
|
elog(ERROR, "Tuple is too big: size %u, max size %ld",
|
||||||
len, MaxTupleSize);
|
len, MaxTupleSize);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -175,7 +175,7 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
|
|||||||
* test at the top of the routine, and the whole deal should
|
* test at the top of the routine, and the whole deal should
|
||||||
* go away when we implement tuple splitting anyway...
|
* go away when we implement tuple splitting anyway...
|
||||||
*/
|
*/
|
||||||
elog(ERROR, "Tuple is too big: size %d", len);
|
elog(ERROR, "Tuple is too big: size %u", len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.55 2000/02/18 06:32:33 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.56 2000/03/17 02:36:03 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -257,7 +257,7 @@ _bt_insertonpg(Relation rel,
|
|||||||
BlockNumber itup_blkno;
|
BlockNumber itup_blkno;
|
||||||
OffsetNumber itup_off;
|
OffsetNumber itup_off;
|
||||||
OffsetNumber firstright = InvalidOffsetNumber;
|
OffsetNumber firstright = InvalidOffsetNumber;
|
||||||
int itemsz;
|
Size itemsz;
|
||||||
bool do_split = false;
|
bool do_split = false;
|
||||||
bool keys_equal = false;
|
bool keys_equal = false;
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ _bt_insertonpg(Relation rel,
|
|||||||
* Note that at this point, itemsz doesn't include the ItemId.
|
* Note that at this point, itemsz doesn't include the ItemId.
|
||||||
*/
|
*/
|
||||||
if (itemsz > (PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData))
|
if (itemsz > (PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData))
|
||||||
elog(ERROR, "btree: index item size %d exceeds maximum %ld",
|
elog(ERROR, "btree: index item size %u exceeds maximum %lu",
|
||||||
itemsz,
|
itemsz,
|
||||||
(PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData));
|
(PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData));
|
||||||
|
|
||||||
@ -1374,7 +1374,7 @@ _bt_tuplecompare(Relation rel,
|
|||||||
|
|
||||||
tupDes = RelationGetDescr(rel);
|
tupDes = RelationGetDescr(rel);
|
||||||
|
|
||||||
for (i = 1; i <= keysz; i++)
|
for (i = 1; i <= (int) keysz; i++)
|
||||||
{
|
{
|
||||||
ScanKey entry = &scankey[i - 1];
|
ScanKey entry = &scankey[i - 1];
|
||||||
Datum attrDatum1,
|
Datum attrDatum1,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.57 2000/02/18 06:32:39 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.58 2000/03/17 02:36:04 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -272,7 +272,7 @@ _bt_skeycmp(Relation rel,
|
|||||||
|
|
||||||
tupDes = RelationGetDescr(rel);
|
tupDes = RelationGetDescr(rel);
|
||||||
|
|
||||||
for (i = 1; i <= keysz; i++)
|
for (i = 1; i <= (int) keysz; i++)
|
||||||
{
|
{
|
||||||
ScanKey entry = &scankey[i - 1];
|
ScanKey entry = &scankey[i - 1];
|
||||||
Datum attrDatum;
|
Datum attrDatum;
|
||||||
@ -658,7 +658,7 @@ _bt_next(IndexScanDesc scan, ScanDirection dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} while (keysok >= so->numberOfFirstKeys ||
|
} while (keysok >= so->numberOfFirstKeys ||
|
||||||
(keysok == -1 && ScanDirectionIsBackward(dir)));
|
(keysok == ((Size) -1) && ScanDirectionIsBackward(dir)));
|
||||||
|
|
||||||
ItemPointerSetInvalid(current);
|
ItemPointerSetInvalid(current);
|
||||||
so->btso_curbuf = InvalidBuffer;
|
so->btso_curbuf = InvalidBuffer;
|
||||||
@ -1026,7 +1026,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
|||||||
so->btso_curbuf = buf;
|
so->btso_curbuf = buf;
|
||||||
return _bt_next(scan, dir);
|
return _bt_next(scan, dir);
|
||||||
}
|
}
|
||||||
else if (keysok == -1 && ScanDirectionIsBackward(dir))
|
else if (keysok == ((Size) -1) && ScanDirectionIsBackward(dir))
|
||||||
{
|
{
|
||||||
so->btso_curbuf = buf;
|
so->btso_curbuf = buf;
|
||||||
return _bt_next(scan, dir);
|
return _bt_next(scan, dir);
|
||||||
@ -1501,7 +1501,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
|
|||||||
so->btso_curbuf = buf;
|
so->btso_curbuf = buf;
|
||||||
return _bt_next(scan, dir);
|
return _bt_next(scan, dir);
|
||||||
}
|
}
|
||||||
else if (keysok == -1 && ScanDirectionIsBackward(dir))
|
else if (keysok == ((Size) -1) && ScanDirectionIsBackward(dir))
|
||||||
{
|
{
|
||||||
so->btso_curbuf = buf;
|
so->btso_curbuf = buf;
|
||||||
return _bt_next(scan, dir);
|
return _bt_next(scan, dir);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.61 2000/02/18 09:30:20 inoue Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.62 2000/03/17 02:36:05 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Transaction aborts can now occur two ways:
|
* Transaction aborts can now occur two ways:
|
||||||
@ -190,6 +190,7 @@ static void StartTransaction(void);
|
|||||||
TransactionStateData CurrentTransactionStateData = {
|
TransactionStateData CurrentTransactionStateData = {
|
||||||
0, /* transaction id */
|
0, /* transaction id */
|
||||||
FirstCommandId, /* command id */
|
FirstCommandId, /* command id */
|
||||||
|
0, /* scan command id */
|
||||||
0x0, /* start time */
|
0x0, /* start time */
|
||||||
TRANS_DEFAULT, /* transaction state */
|
TRANS_DEFAULT, /* transaction state */
|
||||||
TBLOCK_DEFAULT /* transaction block state */
|
TBLOCK_DEFAULT /* transaction block state */
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.123 2000/03/14 23:06:06 thomas Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.124 2000/03/17 02:36:05 tgl Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -184,7 +184,7 @@ heap_create(char *relname,
|
|||||||
bool istemp,
|
bool istemp,
|
||||||
bool storage_create)
|
bool storage_create)
|
||||||
{
|
{
|
||||||
unsigned i;
|
int i;
|
||||||
Oid relid;
|
Oid relid;
|
||||||
Relation rel;
|
Relation rel;
|
||||||
int len;
|
int len;
|
||||||
@ -425,8 +425,8 @@ heap_storage_create(Relation rel)
|
|||||||
static void
|
static void
|
||||||
CheckAttributeNames(TupleDesc tupdesc)
|
CheckAttributeNames(TupleDesc tupdesc)
|
||||||
{
|
{
|
||||||
unsigned i;
|
int i;
|
||||||
unsigned j;
|
int j;
|
||||||
int natts = tupdesc->natts;
|
int natts = tupdesc->natts;
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
@ -437,9 +437,9 @@ CheckAttributeNames(TupleDesc tupdesc)
|
|||||||
* an unknown typid (usually as a result of a 'retrieve into'
|
* an unknown typid (usually as a result of a 'retrieve into'
|
||||||
* - jolly
|
* - jolly
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < natts; i += 1)
|
for (i = 0; i < natts; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < sizeof HeapAtt / sizeof HeapAtt[0]; j += 1)
|
for (j = 0; j < (int) (sizeof(HeapAtt) / sizeof(HeapAtt[0])); j++)
|
||||||
{
|
{
|
||||||
if (nameeq(&(HeapAtt[j]->attname),
|
if (nameeq(&(HeapAtt[j]->attname),
|
||||||
&(tupdesc->attrs[i]->attname)))
|
&(tupdesc->attrs[i]->attname)))
|
||||||
@ -461,9 +461,9 @@ CheckAttributeNames(TupleDesc tupdesc)
|
|||||||
* next check for repeated attribute names
|
* next check for repeated attribute names
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
for (i = 1; i < natts; i += 1)
|
for (i = 1; i < natts; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < i; j += 1)
|
for (j = 0; j < i; j++)
|
||||||
{
|
{
|
||||||
if (nameeq(&(tupdesc->attrs[j]->attname),
|
if (nameeq(&(tupdesc->attrs[j]->attname),
|
||||||
&(tupdesc->attrs[i]->attname)))
|
&(tupdesc->attrs[i]->attname)))
|
||||||
@ -561,7 +561,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
|
|||||||
TupleDesc tupdesc)
|
TupleDesc tupdesc)
|
||||||
{
|
{
|
||||||
Form_pg_attribute *dpp;
|
Form_pg_attribute *dpp;
|
||||||
unsigned i;
|
int i;
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
Relation rel;
|
Relation rel;
|
||||||
bool hasindex;
|
bool hasindex;
|
||||||
|
@ -256,7 +256,7 @@ void DeleteComments(Oid oid) {
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentRelation(int reltype, char *relname, char *comment) {
|
static void CommentRelation(int reltype, char *relname, char *comment) {
|
||||||
|
|
||||||
HeapTuple reltuple;
|
HeapTuple reltuple;
|
||||||
Oid oid;
|
Oid oid;
|
||||||
@ -325,7 +325,7 @@ void CommentRelation(int reltype, char *relname, char *comment) {
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentAttribute(char *relname, char *attrname, char *comment) {
|
static void CommentAttribute(char *relname, char *attrname, char *comment) {
|
||||||
|
|
||||||
Relation relation;
|
Relation relation;
|
||||||
HeapTuple attrtuple;
|
HeapTuple attrtuple;
|
||||||
@ -371,7 +371,7 @@ void CommentAttribute(char *relname, char *attrname, char *comment) {
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentDatabase(char *database, char *comment) {
|
static void CommentDatabase(char *database, char *comment) {
|
||||||
|
|
||||||
Relation pg_database;
|
Relation pg_database;
|
||||||
HeapTuple dbtuple, usertuple;
|
HeapTuple dbtuple, usertuple;
|
||||||
@ -439,7 +439,7 @@ void CommentDatabase(char *database, char *comment) {
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentRewrite(char *rule, char *comment) {
|
static void CommentRewrite(char *rule, char *comment) {
|
||||||
|
|
||||||
HeapTuple rewritetuple;
|
HeapTuple rewritetuple;
|
||||||
Oid oid;
|
Oid oid;
|
||||||
@ -485,7 +485,7 @@ void CommentRewrite(char *rule, char *comment) {
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentType(char *type, char *comment) {
|
static void CommentType(char *type, char *comment) {
|
||||||
|
|
||||||
HeapTuple typetuple;
|
HeapTuple typetuple;
|
||||||
Oid oid;
|
Oid oid;
|
||||||
@ -527,7 +527,7 @@ void CommentType(char *type, char *comment) {
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentAggregate(char *aggregate, char *argument, char *comment) {
|
static void CommentAggregate(char *aggregate, char *argument, char *comment) {
|
||||||
|
|
||||||
HeapTuple aggtuple;
|
HeapTuple aggtuple;
|
||||||
Oid baseoid, oid;
|
Oid baseoid, oid;
|
||||||
@ -592,7 +592,7 @@ void CommentAggregate(char *aggregate, char *argument, char *comment) {
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentProc(char *function, List *arguments, char *comment)
|
static void CommentProc(char *function, List *arguments, char *comment)
|
||||||
{
|
{
|
||||||
HeapTuple argtuple, functuple;
|
HeapTuple argtuple, functuple;
|
||||||
Oid oid, argoids[FUNC_MAX_ARGS];
|
Oid oid, argoids[FUNC_MAX_ARGS];
|
||||||
@ -663,7 +663,7 @@ void CommentProc(char *function, List *arguments, char *comment)
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentOperator(char *opername, List *arguments, char *comment) {
|
static void CommentOperator(char *opername, List *arguments, char *comment) {
|
||||||
|
|
||||||
Form_pg_operator data;
|
Form_pg_operator data;
|
||||||
HeapTuple optuple;
|
HeapTuple optuple;
|
||||||
@ -752,7 +752,7 @@ void CommentOperator(char *opername, List *arguments, char *comment) {
|
|||||||
*------------------------------------------------------------------
|
*------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void CommentTrigger(char *trigger, char *relname, char *comment) {
|
static void CommentTrigger(char *trigger, char *relname, char *comment) {
|
||||||
|
|
||||||
Form_pg_trigger data;
|
Form_pg_trigger data;
|
||||||
Relation pg_trigger, relation;
|
Relation pg_trigger, relation;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.143 2000/03/09 05:00:23 inoue Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.144 2000/03/17 02:36:06 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -671,7 +671,7 @@ static void
|
|||||||
vc_scanheap(VRelStats *vacrelstats, Relation onerel,
|
vc_scanheap(VRelStats *vacrelstats, Relation onerel,
|
||||||
VPageList vacuum_pages, VPageList fraged_pages)
|
VPageList vacuum_pages, VPageList fraged_pages)
|
||||||
{
|
{
|
||||||
int nblocks,
|
BlockNumber nblocks,
|
||||||
blkno;
|
blkno;
|
||||||
ItemId itemid;
|
ItemId itemid;
|
||||||
Buffer buf;
|
Buffer buf;
|
||||||
@ -1194,8 +1194,8 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
|
|||||||
last_vacuum_block = -1;
|
last_vacuum_block = -1;
|
||||||
}
|
}
|
||||||
if (num_fraged_pages > 0 &&
|
if (num_fraged_pages > 0 &&
|
||||||
blkno ==
|
fraged_pages->vpl_pagedesc[num_fraged_pages - 1]->vpd_blkno ==
|
||||||
fraged_pages->vpl_pagedesc[num_fraged_pages - 1]->vpd_blkno)
|
(BlockNumber) blkno)
|
||||||
{
|
{
|
||||||
/* page is in fraged_pages too; remove it */
|
/* page is in fraged_pages too; remove it */
|
||||||
--num_fraged_pages;
|
--num_fraged_pages;
|
||||||
@ -1820,7 +1820,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
|
|||||||
checked_moved = 0;
|
checked_moved = 0;
|
||||||
for (i = 0, vpp = vacuum_pages->vpl_pagedesc; i < vacuumed_pages; i++, vpp++)
|
for (i = 0, vpp = vacuum_pages->vpl_pagedesc; i < vacuumed_pages; i++, vpp++)
|
||||||
{
|
{
|
||||||
Assert((*vpp)->vpd_blkno < blkno);
|
Assert((*vpp)->vpd_blkno < (BlockNumber) blkno);
|
||||||
buf = ReadBuffer(onerel, (*vpp)->vpd_blkno);
|
buf = ReadBuffer(onerel, (*vpp)->vpd_blkno);
|
||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
if ((*vpp)->vpd_offsets_used == 0) /* this page was not used */
|
if ((*vpp)->vpd_offsets_used == 0) /* this page was not used */
|
||||||
@ -1894,7 +1894,8 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* clean moved tuples from last page in Nvpl list */
|
/* clean moved tuples from last page in Nvpl list */
|
||||||
if (vpc->vpd_blkno == blkno - 1 && vpc->vpd_offsets_free > 0)
|
if (vpc->vpd_blkno == (BlockNumber) (blkno - 1) &&
|
||||||
|
vpc->vpd_offsets_free > 0)
|
||||||
{
|
{
|
||||||
buf = ReadBuffer(onerel, vpc->vpd_blkno);
|
buf = ReadBuffer(onerel, vpc->vpd_blkno);
|
||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.30 2000/01/26 05:56:28 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.31 2000/03/17 02:36:08 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -73,7 +73,7 @@ PQfn(int fnid,
|
|||||||
{
|
{
|
||||||
if (args[i].len == VAR_LENGTH_ARG)
|
if (args[i].len == VAR_LENGTH_ARG)
|
||||||
arg[i] = (char *) args[i].u.ptr;
|
arg[i] = (char *) args[i].u.ptr;
|
||||||
else if (args[i].len > sizeof(int4))
|
else if ((Size) args[i].len > sizeof(int4))
|
||||||
elog(ERROR, "arg_length of argument %d too long", i);
|
elog(ERROR, "arg_length of argument %d too long", i);
|
||||||
else
|
else
|
||||||
arg[i] = (char *) args[i].u.integer;
|
arg[i] = (char *) args[i].u.integer;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* wherein you authenticate a user by seeing what IP address the system
|
* wherein you authenticate a user by seeing what IP address the system
|
||||||
* says he comes from and possibly using ident).
|
* says he comes from and possibly using ident).
|
||||||
*
|
*
|
||||||
* $Id: hba.c,v 1.49 1999/10/23 03:13:21 tgl Exp $
|
* $Id: hba.c,v 1.50 2000/03/17 02:36:08 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -487,7 +487,7 @@ interpret_ident_response(char *ident_response,
|
|||||||
cursor++; /* skip blanks */
|
cursor++; /* skip blanks */
|
||||||
i = 0;
|
i = 0;
|
||||||
while (*cursor != ':' && *cursor != '\r' && !isblank(*cursor)
|
while (*cursor != ':' && *cursor != '\r' && !isblank(*cursor)
|
||||||
&& i < sizeof(response_type) - 1)
|
&& i < (int) (sizeof(response_type) - 1))
|
||||||
response_type[i++] = *cursor++;
|
response_type[i++] = *cursor++;
|
||||||
response_type[i] = '\0';
|
response_type[i] = '\0';
|
||||||
while (isblank(*cursor))
|
while (isblank(*cursor))
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: portal.c,v 1.29 2000/01/26 05:56:29 momjian Exp $
|
* $Id: portal.c,v 1.30 2000/03/17 02:36:08 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -106,7 +106,7 @@ PQnportals(int rule_p)
|
|||||||
int i,
|
int i,
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
||||||
for (i = 0; i < portals_array_size; ++i)
|
for (i = 0; i < (int) portals_array_size; ++i)
|
||||||
{
|
{
|
||||||
if (portals[i] && portals[i]->portal)
|
if (portals[i] && portals[i]->portal)
|
||||||
{
|
{
|
||||||
@ -138,7 +138,7 @@ PQpnames(char **pnames, int rule_p)
|
|||||||
if (!valid_pointer("PQpnames: invalid name buffer", pnames))
|
if (!valid_pointer("PQpnames: invalid name buffer", pnames))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < portals_array_size; ++i)
|
for (i = 0; i < (int) portals_array_size; ++i)
|
||||||
{
|
{
|
||||||
if (portals[i] && portals[i]->portal)
|
if (portals[i] && portals[i]->portal)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.22 2000/01/26 05:56:29 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.23 2000/03/17 02:36:08 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -90,7 +90,7 @@ portals_realloc(size_t size)
|
|||||||
libpq_raise(&PortalError,
|
libpq_raise(&PortalError,
|
||||||
vararg_format("Cannot alloc more memory in portals_realloc"));
|
vararg_format("Cannot alloc more memory in portals_realloc"));
|
||||||
|
|
||||||
for (i = oldsize; i < portals_array_size; i++)
|
for (i = oldsize; i < (int) portals_array_size; i++)
|
||||||
portals[i] = (PortalEntry *) NULL;
|
portals[i] = (PortalEntry *) NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -365,7 +365,7 @@ pbuf_getIndex(char *pname)
|
|||||||
|
|
||||||
if (portals)
|
if (portals)
|
||||||
{
|
{
|
||||||
for (i = 0; i < portals_array_size; i++)
|
for (i = 0; i < (int) portals_array_size; i++)
|
||||||
if (portals[i] != NULL &&
|
if (portals[i] != NULL &&
|
||||||
strncmp(portals[i]->name, pname, PortalNameLength) == 0)
|
strncmp(portals[i]->name, pname, PortalNameLength) == 0)
|
||||||
return i;
|
return i;
|
||||||
@ -407,12 +407,12 @@ pbuf_setup(char *pname)
|
|||||||
pbuf_freePortal(portals[i]->portal);
|
pbuf_freePortal(portals[i]->portal);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i = 0; i < portals_array_size; i++)
|
for (i = 0; i < (int) portals_array_size; i++)
|
||||||
if (portals[i] == NULL)
|
if (portals[i] == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* If the portal table is full, enlarge it */
|
/* If the portal table is full, enlarge it */
|
||||||
if (i >= portals_array_size)
|
if (i >= (int) portals_array_size)
|
||||||
portals_realloc(PORTALS_GROW_BY);
|
portals_realloc(PORTALS_GROW_BY);
|
||||||
|
|
||||||
portals[i] = pbuf_addEntry();
|
portals[i] = pbuf_addEntry();
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.110 2000/02/21 18:47:00 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.111 2000/03/17 02:36:12 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||||
@ -1179,7 +1179,7 @@ _outDatum(StringInfo str, Datum value, Oid type)
|
|||||||
{
|
{
|
||||||
s = (char *) (&value);
|
s = (char *) (&value);
|
||||||
appendStringInfo(str, " %d [ ", length);
|
appendStringInfo(str, " %d [ ", length);
|
||||||
for (i = 0; i < sizeof(Datum); i++)
|
for (i = 0; i < (int) sizeof(Datum); i++)
|
||||||
appendStringInfo(str, "%d ", (int) (s[i]));
|
appendStringInfo(str, "%d ", (int) (s[i]));
|
||||||
appendStringInfo(str, "] ");
|
appendStringInfo(str, "] ");
|
||||||
}
|
}
|
||||||
@ -1198,7 +1198,7 @@ _outDatum(StringInfo str, Datum value, Oid type)
|
|||||||
if (((int) length) <= -1)
|
if (((int) length) <= -1)
|
||||||
length = VARSIZE(s);
|
length = VARSIZE(s);
|
||||||
appendStringInfo(str, " %d [ ", length);
|
appendStringInfo(str, " %d [ ", length);
|
||||||
for (i = 0; i < length; i++)
|
for (i = 0; i < (int) length; i++)
|
||||||
appendStringInfo(str, "%d ", (int) (s[i]));
|
appendStringInfo(str, "%d ", (int) (s[i]));
|
||||||
appendStringInfo(str, "] ");
|
appendStringInfo(str, "] ");
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.85 2000/02/20 21:32:05 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.86 2000/03/17 02:36:12 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||||
@ -1952,11 +1952,11 @@ readDatum(Oid type)
|
|||||||
|
|
||||||
if (byValue)
|
if (byValue)
|
||||||
{
|
{
|
||||||
if (length > sizeof(Datum))
|
if ((Size) length > sizeof(Datum))
|
||||||
elog(ERROR, "readValue: byval & length = %d", length);
|
elog(ERROR, "readValue: byval & length = %d", length);
|
||||||
res = (Datum) 0;
|
res = (Datum) 0;
|
||||||
s = (char *) (&res);
|
s = (char *) (&res);
|
||||||
for (i = 0; i < sizeof(Datum); i++)
|
for (i = 0; i < (int) sizeof(Datum); i++)
|
||||||
{
|
{
|
||||||
token = lsptok(NULL, &tokenLength);
|
token = lsptok(NULL, &tokenLength);
|
||||||
s[i] = (char) atoi(token);
|
s[i] = (char) atoi(token);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.30 2000/01/26 05:56:34 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.31 2000/03/17 02:36:14 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -340,7 +340,7 @@ clause_selectivity(Query *root,
|
|||||||
*/
|
*/
|
||||||
Index varno = ((Var *) clause)->varno;
|
Index varno = ((Var *) clause)->varno;
|
||||||
|
|
||||||
if (varRelid == 0 || varRelid == varno)
|
if (varRelid == 0 || varRelid == (int) varno)
|
||||||
s1 = restriction_selectivity(F_EQSEL,
|
s1 = restriction_selectivity(F_EQSEL,
|
||||||
BooleanEqualOperator,
|
BooleanEqualOperator,
|
||||||
getrelid(varno, root->rtable),
|
getrelid(varno, root->rtable),
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.31 2000/03/14 02:23:15 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.32 2000/03/17 02:36:15 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -28,7 +28,7 @@
|
|||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
|
|
||||||
|
|
||||||
int PlannerQueryLevel; /* level of current query */
|
Index PlannerQueryLevel; /* level of current query */
|
||||||
List *PlannerInitPlan; /* init subplans for current query */
|
List *PlannerInitPlan; /* init subplans for current query */
|
||||||
List *PlannerParamVar; /* to get Var from Param->paramid */
|
List *PlannerParamVar; /* to get Var from Param->paramid */
|
||||||
int PlannerPlanId; /* to assign unique ID to subquery plans */
|
int PlannerPlanId; /* to assign unique ID to subquery plans */
|
||||||
@ -55,7 +55,7 @@ int PlannerPlanId; /* to assign unique ID to subquery plans */
|
|||||||
* is set from the absolute level value given by varlevel.
|
* is set from the absolute level value given by varlevel.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
new_param(Var *var, int varlevel)
|
new_param(Var *var, Index varlevel)
|
||||||
{
|
{
|
||||||
Var *paramVar = (Var *) copyObject(var);
|
Var *paramVar = (Var *) copyObject(var);
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ replace_var(Var *var)
|
|||||||
{
|
{
|
||||||
List *ppv;
|
List *ppv;
|
||||||
Param *retval;
|
Param *retval;
|
||||||
int varlevel;
|
Index varlevel;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
Assert(var->varlevelsup > 0 && var->varlevelsup < PlannerQueryLevel);
|
Assert(var->varlevelsup > 0 && var->varlevelsup < PlannerQueryLevel);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.35 2000/03/14 23:06:32 thomas Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.36 2000/03/17 02:36:17 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -104,7 +104,7 @@ check_ungrouped_columns_walker(Node *node,
|
|||||||
return false; /* outer-level Var is acceptable */
|
return false; /* outer-level Var is acceptable */
|
||||||
/* Found an ungrouped local variable; generate error message */
|
/* Found an ungrouped local variable; generate error message */
|
||||||
Assert(var->varno > 0 &&
|
Assert(var->varno > 0 &&
|
||||||
var->varno <= length(context->pstate->p_rtable));
|
(int) var->varno <= length(context->pstate->p_rtable));
|
||||||
rte = rt_fetch(var->varno, context->pstate->p_rtable);
|
rte = rt_fetch(var->varno, context->pstate->p_rtable);
|
||||||
attname = get_attname(rte->relid, var->varattno);
|
attname = get_attname(rte->relid, var->varattno);
|
||||||
if (! attname)
|
if (! attname)
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.37 2000/03/14 23:06:33 thomas Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.38 2000/03/17 02:36:17 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -54,7 +54,7 @@ static struct
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SPECIALS (sizeof(special_attr)/sizeof(*special_attr))
|
#define SPECIALS ((int) (sizeof(special_attr)/sizeof(*special_attr)))
|
||||||
|
|
||||||
static char *attnum_type[SPECIALS] = {
|
static char *attnum_type[SPECIALS] = {
|
||||||
"tid",
|
"tid",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.136 2000/02/18 09:28:44 inoue Exp $
|
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.137 2000/03/17 02:36:18 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -1262,7 +1262,7 @@ ConnCreate(int serverFd)
|
|||||||
/*
|
/*
|
||||||
* ConnFree -- cree a local connection data structure
|
* ConnFree -- cree a local connection data structure
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
ConnFree(Port *conn)
|
ConnFree(Port *conn)
|
||||||
{
|
{
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.53 2000/02/28 08:51:43 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.54 2000/03/17 02:36:19 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES:
|
* NOTES:
|
||||||
*
|
*
|
||||||
@ -91,7 +91,7 @@
|
|||||||
#define VFD_CLOSED (-1)
|
#define VFD_CLOSED (-1)
|
||||||
|
|
||||||
#define FileIsValid(file) \
|
#define FileIsValid(file) \
|
||||||
((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName != NULL)
|
((file) > 0 && (file) < (int) SizeVfdCache && VfdCache[file].fileName != NULL)
|
||||||
|
|
||||||
#define FileIsNotOpen(file) (VfdCache[file].fd == VFD_CLOSED)
|
#define FileIsNotOpen(file) (VfdCache[file].fd == VFD_CLOSED)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.28 2000/01/26 05:56:58 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.29 2000/03/17 02:36:21 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -143,8 +143,8 @@ SISegInit(SISeg *segP, int maxBackends)
|
|||||||
int
|
int
|
||||||
SIBackendInit(SISeg *segP)
|
SIBackendInit(SISeg *segP)
|
||||||
{
|
{
|
||||||
Index index;
|
int index;
|
||||||
ProcState *stateP = NULL;
|
ProcState *stateP = NULL;
|
||||||
|
|
||||||
Assert(MyBackendTag > 0);
|
Assert(MyBackendTag > 0);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* out of its tuple
|
* out of its tuple
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.46 2000/03/15 23:42:14 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.47 2000/03/17 02:36:23 tgl Exp $
|
||||||
*
|
*
|
||||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||||
*
|
*
|
||||||
@ -1555,21 +1555,21 @@ get_func_expr(Expr *expr, deparse_context *context)
|
|||||||
*/
|
*/
|
||||||
if (strcmp(proname, "bpchar") == 0)
|
if (strcmp(proname, "bpchar") == 0)
|
||||||
{
|
{
|
||||||
if (coercedTypmod > VARHDRSZ)
|
if (coercedTypmod > (int32) VARHDRSZ)
|
||||||
appendStringInfo(buf, "char(%d)", coercedTypmod - VARHDRSZ);
|
appendStringInfo(buf, "char(%d)", coercedTypmod - VARHDRSZ);
|
||||||
else
|
else
|
||||||
appendStringInfo(buf, "char");
|
appendStringInfo(buf, "char");
|
||||||
}
|
}
|
||||||
else if (strcmp(proname, "varchar") == 0)
|
else if (strcmp(proname, "varchar") == 0)
|
||||||
{
|
{
|
||||||
if (coercedTypmod > VARHDRSZ)
|
if (coercedTypmod > (int32) VARHDRSZ)
|
||||||
appendStringInfo(buf, "varchar(%d)", coercedTypmod - VARHDRSZ);
|
appendStringInfo(buf, "varchar(%d)", coercedTypmod - VARHDRSZ);
|
||||||
else
|
else
|
||||||
appendStringInfo(buf, "varchar");
|
appendStringInfo(buf, "varchar");
|
||||||
}
|
}
|
||||||
else if (strcmp(proname, "numeric") == 0)
|
else if (strcmp(proname, "numeric") == 0)
|
||||||
{
|
{
|
||||||
if (coercedTypmod >= VARHDRSZ)
|
if (coercedTypmod >= (int32) VARHDRSZ)
|
||||||
appendStringInfo(buf, "numeric(%d,%d)",
|
appendStringInfo(buf, "numeric(%d,%d)",
|
||||||
((coercedTypmod - VARHDRSZ) >> 16) & 0xffff,
|
((coercedTypmod - VARHDRSZ) >> 16) & 0xffff,
|
||||||
(coercedTypmod - VARHDRSZ) & 0xffff);
|
(coercedTypmod - VARHDRSZ) & 0xffff);
|
||||||
|
4
src/backend/utils/cache/relcache.c
vendored
4
src/backend/utils/cache/relcache.c
vendored
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.92 2000/03/09 05:00:25 inoue Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.93 2000/03/17 02:36:27 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1046,7 +1046,7 @@ formrdesc(char *relationName,
|
|||||||
{
|
{
|
||||||
Relation relation;
|
Relation relation;
|
||||||
Size len;
|
Size len;
|
||||||
int i;
|
u_int i;
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* allocate new relation desc
|
* allocate new relation desc
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.29 2000/02/26 05:25:54 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.30 2000/03/17 02:36:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -701,7 +701,7 @@ hash_search(HTAB *hashp,
|
|||||||
long *
|
long *
|
||||||
hash_seq(HTAB *hashp)
|
hash_seq(HTAB *hashp)
|
||||||
{
|
{
|
||||||
static uint32 curBucket = 0;
|
static long curBucket = 0;
|
||||||
static BUCKET_INDEX curIndex;
|
static BUCKET_INDEX curIndex;
|
||||||
ELEMENT *curElem;
|
ELEMENT *curElem;
|
||||||
long segment_num;
|
long segment_num;
|
||||||
@ -848,7 +848,7 @@ expand_table(HTAB *hashp)
|
|||||||
{
|
{
|
||||||
chain = GET_BUCKET(hashp, chainIndex);
|
chain = GET_BUCKET(hashp, chainIndex);
|
||||||
nextIndex = chain->next;
|
nextIndex = chain->next;
|
||||||
if (call_hash(hashp, (char *) &(chain->key)) == old_bucket)
|
if ((long) call_hash(hashp, (char *) &(chain->key)) == old_bucket)
|
||||||
{
|
{
|
||||||
*old = chainIndex;
|
*old = chainIndex;
|
||||||
old = &chain->next;
|
old = &chain->next;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/hash/hashfn.c,v 1.11 2000/01/26 05:57:24 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/hash/hashfn.c,v 1.12 2000/03/17 02:36:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -84,7 +84,7 @@ tag_hash(int *key, int keysize)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
for (; keysize > (sizeof(int) - 1); keysize -= sizeof(int), key++)
|
for (; keysize >= (int) sizeof(int); keysize -= sizeof(int), key++)
|
||||||
h = h * PRIME1 ^ (*key);
|
h = h * PRIME1 ^ (*key);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.34 2000/01/31 04:35:53 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.35 2000/03/17 02:36:29 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -145,7 +145,7 @@ do { \
|
|||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define PortalHashTableDelete(PORTAL) \
|
#define PortalHashTableDelete(PORTAL) \
|
||||||
{ \
|
do { \
|
||||||
PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
|
PortalHashEnt *hentry; bool found; char key[MAX_PORTALNAME_LEN]; \
|
||||||
\
|
\
|
||||||
MemSet(key, 0, MAX_PORTALNAME_LEN); \
|
MemSet(key, 0, MAX_PORTALNAME_LEN); \
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/logtape.c,v 1.3 2000/01/26 05:57:33 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/sort/logtape.c,v 1.4 2000/03/17 02:36:30 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -78,7 +78,7 @@
|
|||||||
* Block indexes are "long"s, so we can fit this many per indirect block.
|
* Block indexes are "long"s, so we can fit this many per indirect block.
|
||||||
* NB: we assume this is an exact fit!
|
* NB: we assume this is an exact fit!
|
||||||
*/
|
*/
|
||||||
#define BLOCKS_PER_INDIR_BLOCK (BLCKSZ / sizeof(long))
|
#define BLOCKS_PER_INDIR_BLOCK ((int) (BLCKSZ / sizeof(long)))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We use a struct like this for each active indirection level of each
|
* We use a struct like this for each active indirection level of each
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.7 2000/03/01 17:14:09 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.8 2000/03/17 02:36:31 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1751,7 +1751,7 @@ comparetup_index(Tuplesortstate *state, const void *a, const void *b)
|
|||||||
IndexTuple tuple1 = (IndexTuple) a;
|
IndexTuple tuple1 = (IndexTuple) a;
|
||||||
IndexTuple tuple2 = (IndexTuple) b;
|
IndexTuple tuple2 = (IndexTuple) b;
|
||||||
Relation rel = state->indexRel;
|
Relation rel = state->indexRel;
|
||||||
Size keysz = RelationGetNumberOfAttributes(rel);
|
int keysz = RelationGetNumberOfAttributes(rel);
|
||||||
ScanKey scankey = state->indexScanKey;
|
ScanKey scankey = state->indexScanKey;
|
||||||
TupleDesc tupDes;
|
TupleDesc tupDes;
|
||||||
int i;
|
int i;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: itup.h,v 1.23 2000/01/26 05:57:50 momjian Exp $
|
* $Id: itup.h,v 1.24 2000/03/17 02:36:37 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -82,8 +82,8 @@ typedef struct PredInfo
|
|||||||
#define INDEX_NULL_MASK 0x8000
|
#define INDEX_NULL_MASK 0x8000
|
||||||
#define INDEX_VAR_MASK 0x4000
|
#define INDEX_VAR_MASK 0x4000
|
||||||
|
|
||||||
#define IndexTupleSize(itup) (((IndexTuple) (itup))->t_info & 0x1FFF)
|
#define IndexTupleSize(itup) ((Size) (((IndexTuple) (itup))->t_info & 0x1FFF))
|
||||||
#define IndexTupleDSize(itup) ((itup).t_info & 0x1FFF)
|
#define IndexTupleDSize(itup) ((Size) ((itup).t_info & 0x1FFF))
|
||||||
#define IndexTupleNoNulls(itup) (!(((IndexTuple) (itup))->t_info & 0x8000))
|
#define IndexTupleNoNulls(itup) (!(((IndexTuple) (itup))->t_info & 0x8000))
|
||||||
#define IndexTupleAllFixed(itup) (!(((IndexTuple) (itup))->t_info & 0x4000))
|
#define IndexTupleAllFixed(itup) (!(((IndexTuple) (itup))->t_info & 0x4000))
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: tupmacs.h,v 1.13 2000/01/26 05:57:51 momjian Exp $
|
* $Id: tupmacs.h,v 1.14 2000/03/17 02:36:37 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -50,13 +50,13 @@
|
|||||||
( \
|
( \
|
||||||
(*(A))->attbyval && (*(A))->attlen != -1 ? \
|
(*(A))->attbyval && (*(A))->attlen != -1 ? \
|
||||||
( \
|
( \
|
||||||
(*(A))->attlen > sizeof(int16) ? \
|
(*(A))->attlen > (int) sizeof(int16) ? \
|
||||||
( \
|
( \
|
||||||
(char *) (long) *((int32 *)(T)) \
|
(char *) (long) *((int32 *)(T)) \
|
||||||
) \
|
) \
|
||||||
: \
|
: \
|
||||||
( \
|
( \
|
||||||
(*(A))->attlen < sizeof(int16) ? \
|
(*(A))->attlen < (int) sizeof(int16) ? \
|
||||||
(char *) (long) *((char *)(T)) \
|
(char *) (long) *((char *)(T)) \
|
||||||
: \
|
: \
|
||||||
(char *) (long) *((int16 *)(T))) \
|
(char *) (long) *((int16 *)(T))) \
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "nodes/plannodes.h"
|
#include "nodes/plannodes.h"
|
||||||
|
|
||||||
extern int PlannerQueryLevel; /* level of current query */
|
extern Index PlannerQueryLevel; /* level of current query */
|
||||||
extern List *PlannerInitPlan; /* init subplans for current query */
|
extern List *PlannerInitPlan; /* init subplans for current query */
|
||||||
extern List *PlannerParamVar; /* to get Var from Param->paramid */
|
extern List *PlannerParamVar; /* to get Var from Param->paramid */
|
||||||
extern int PlannerPlanId; /* to assign unique ID to subquery plans */
|
extern int PlannerPlanId; /* to assign unique ID to subquery plans */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1995, Regents of the University of California
|
* Portions Copyright (c) 1995, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: postgres.h,v 1.36 2000/01/26 05:57:46 momjian Exp $
|
* $Id: postgres.h,v 1.37 2000/03/17 02:36:34 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -97,7 +97,7 @@ struct varlena
|
|||||||
|
|
||||||
#define VARSIZE(PTR) (((struct varlena *)(PTR))->vl_len)
|
#define VARSIZE(PTR) (((struct varlena *)(PTR))->vl_len)
|
||||||
#define VARDATA(PTR) (((struct varlena *)(PTR))->vl_dat)
|
#define VARDATA(PTR) (((struct varlena *)(PTR))->vl_dat)
|
||||||
#define VARHDRSZ sizeof(int32)
|
#define VARHDRSZ ((int32) sizeof(int32))
|
||||||
|
|
||||||
typedef struct varlena bytea;
|
typedef struct varlena bytea;
|
||||||
typedef struct varlena text;
|
typedef struct varlena text;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: block.h,v 1.10 2000/01/26 05:58:32 momjian Exp $
|
* $Id: block.h,v 1.11 2000/03/17 02:36:41 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -66,7 +66,7 @@ typedef BlockIdData *BlockId; /* block identifier */
|
|||||||
* True iff blockNumber is valid.
|
* True iff blockNumber is valid.
|
||||||
*/
|
*/
|
||||||
#define BlockNumberIsValid(blockNumber) \
|
#define BlockNumberIsValid(blockNumber) \
|
||||||
((bool) ((int32) (blockNumber) != InvalidBlockNumber))
|
((bool) ((BlockNumber) (blockNumber) != InvalidBlockNumber))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BlockIdIsValid
|
* BlockIdIsValid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user