1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Cleanup of source files where 'return' or 'var =' is alone on a line.

This commit is contained in:
Bruce Momjian
1999-02-03 21:18:02 +00:00
parent 3982368a4e
commit 9322950aa4
101 changed files with 422 additions and 743 deletions

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.47 1999/01/24 22:53:25 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.48 1999/02/03 21:15:27 momjian Exp $
* *
* NOTES * NOTES
* The old interface functions have been converted to macros * The old interface functions have been converted to macros
@ -759,8 +759,7 @@ heap_modifytuple(HeapTuple tuple,
if (repl[attoff] == ' ') if (repl[attoff] == ' ')
{ {
value[attoff] = value[attoff] = heap_getattr(tuple,
heap_getattr(tuple,
AttrOffsetGetAttrNumber(attoff), AttrOffsetGetAttrNumber(attoff),
RelationGetDescr(relation), RelationGetDescr(relation),
&isNull); &isNull);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.46 1998/12/14 05:18:30 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.47 1999/02/03 21:15:27 momjian Exp $
* *
* NOTES * NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be * some of the executor utility code such as "ExecTypeFromTL" should be
@ -115,8 +115,7 @@ CreateTupleDescCopy(TupleDesc tupdesc)
desc->attrs = (Form_pg_attribute *) palloc(size); desc->attrs = (Form_pg_attribute *) palloc(size);
for (i = 0; i < desc->natts; i++) for (i = 0; i < desc->natts; i++)
{ {
desc->attrs[i] = desc->attrs[i] = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
(Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
memmove(desc->attrs[i], memmove(desc->attrs[i],
tupdesc->attrs[i], tupdesc->attrs[i],
ATTRIBUTE_TUPLE_SIZE); ATTRIBUTE_TUPLE_SIZE);
@ -150,8 +149,7 @@ CreateTupleDescCopyConstr(TupleDesc tupdesc)
desc->attrs = (Form_pg_attribute *) palloc(size); desc->attrs = (Form_pg_attribute *) palloc(size);
for (i = 0; i < desc->natts; i++) for (i = 0; i < desc->natts; i++)
{ {
desc->attrs[i] = desc->attrs[i] = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
(Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
memmove(desc->attrs[i], memmove(desc->attrs[i],
tupdesc->attrs[i], tupdesc->attrs[i],
ATTRIBUTE_TUPLE_SIZE); ATTRIBUTE_TUPLE_SIZE);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.23 1998/11/27 19:51:31 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.24 1999/02/03 21:15:28 momjian Exp $
* *
* NOTES * NOTES
* This file contains only the public interface routines. * This file contains only the public interface routines.
@ -485,8 +485,7 @@ hashrestrpos(IndexScanDesc scan)
/* bump lock on currentMarkData and copy to currentItemData */ /* bump lock on currentMarkData and copy to currentItemData */
if (ItemPointerIsValid(&(scan->currentMarkData))) if (ItemPointerIsValid(&(scan->currentMarkData)))
{ {
so->hashso_curbuf = so->hashso_curbuf =_hash_getbuf(scan->relation,
_hash_getbuf(scan->relation,
BufferGetBlockNumber(so->hashso_mrkbuf), BufferGetBlockNumber(so->hashso_mrkbuf),
HASH_READ); HASH_READ);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.18 1998/10/04 20:19:08 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.19 1999/02/03 21:15:28 momjian Exp $
* *
* NOTES * NOTES
* Overflow pages look like ordinary relation pages. * Overflow pages look like ordinary relation pages.
@ -336,8 +336,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
{ {
Buffer prevbuf = _hash_getbuf(rel, prevblkno, HASH_WRITE); Buffer prevbuf = _hash_getbuf(rel, prevblkno, HASH_WRITE);
Page prevpage = BufferGetPage(prevbuf); Page prevpage = BufferGetPage(prevbuf);
HashPageOpaque prevopaque = HashPageOpaque prevopaque = (HashPageOpaque) PageGetSpecialPointer(prevpage);
(HashPageOpaque) PageGetSpecialPointer(prevpage);
_hash_checkpage(prevpage, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE); _hash_checkpage(prevpage, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
Assert(prevopaque->hasho_bucket == bucket); Assert(prevopaque->hasho_bucket == bucket);
@ -348,8 +347,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
{ {
Buffer nextbuf = _hash_getbuf(rel, nextblkno, HASH_WRITE); Buffer nextbuf = _hash_getbuf(rel, nextblkno, HASH_WRITE);
Page nextpage = BufferGetPage(nextbuf); Page nextpage = BufferGetPage(nextbuf);
HashPageOpaque nextopaque = HashPageOpaque nextopaque = (HashPageOpaque) PageGetSpecialPointer(nextpage);
(HashPageOpaque) PageGetSpecialPointer(nextpage);
_hash_checkpage(nextpage, LH_OVERFLOW_PAGE); _hash_checkpage(nextpage, LH_OVERFLOW_PAGE);
Assert(nextopaque->hasho_bucket == bucket); Assert(nextopaque->hasho_bucket == bucket);
@ -363,8 +361,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
* element hashm_mapp[bitmappage]. * element hashm_mapp[bitmappage].
*/ */
splitnum = (addr >> SPLITSHIFT); splitnum = (addr >> SPLITSHIFT);
ovflpgno = ovflpgno = (splitnum ? metap->SPARES[splitnum - 1] : 0) + (addr & SPLITMASK) - 1;
(splitnum ? metap->SPARES[splitnum - 1] : 0) + (addr & SPLITMASK) - 1;
if (ovflpgno < metap->LAST_FREED) if (ovflpgno < metap->LAST_FREED)
metap->LAST_FREED = ovflpgno; metap->LAST_FREED = ovflpgno;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.29 1998/09/23 04:21:57 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.30 1999/02/03 21:15:30 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -293,8 +293,7 @@ RelationGetStrategy(Relation relation,
Assert(StrategyEvaluationIsValid(evaluation)); Assert(StrategyEvaluationIsValid(evaluation));
Assert(RegProcedureIsValid(procedure)); Assert(RegProcedureIsValid(procedure));
strategyMap = strategyMap = IndexStrategyGetStrategyMap(RelationGetIndexStrategy(relation),
IndexStrategyGetStrategyMap(RelationGetIndexStrategy(relation),
evaluation->maxStrategy, evaluation->maxStrategy,
attributeNumber); attributeNumber);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.33 1999/01/29 09:22:52 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.34 1999/02/03 21:15:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1200,8 +1200,7 @@ _bt_pgaddtup(Relation rel,
do do
{ {
chkitem = chkitem = (BTItem) PageGetItem(page, PageGetItemId(page, itup_off));
(BTItem) PageGetItem(page, PageGetItemId(page, itup_off));
itup_off = OffsetNumberNext(itup_off); itup_off = OffsetNumberNext(itup_off);
} while (!BTItemSame(chkitem, afteritem)); } while (!BTItemSame(chkitem, afteritem));
} }

View File

@ -5,7 +5,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Id: nbtsort.c,v 1.34 1999/01/17 06:18:12 momjian Exp $ * $Id: nbtsort.c,v 1.35 1999/02/03 21:15:36 momjian Exp $
* *
* NOTES * NOTES
* *
@ -559,20 +559,16 @@ _bt_spoolinit(Relation index, int ntapes, bool isunique)
btspool->bts_tape = 0; btspool->bts_tape = 0;
btspool->isunique = isunique; btspool->isunique = isunique;
btspool->bts_itape = btspool->bts_itape =(BTTapeBlock **) palloc(sizeof(BTTapeBlock *) * ntapes);
(BTTapeBlock **) palloc(sizeof(BTTapeBlock *) * ntapes); btspool->bts_otape =(BTTapeBlock **) palloc(sizeof(BTTapeBlock *) * ntapes);
btspool->bts_otape =
(BTTapeBlock **) palloc(sizeof(BTTapeBlock *) * ntapes);
if (btspool->bts_itape == (BTTapeBlock **) NULL || if (btspool->bts_itape == (BTTapeBlock **) NULL ||
btspool->bts_otape == (BTTapeBlock **) NULL) btspool->bts_otape == (BTTapeBlock **) NULL)
elog(ERROR, "_bt_spoolinit: out of memory"); elog(ERROR, "_bt_spoolinit: out of memory");
for (i = 0; i < ntapes; ++i) for (i = 0; i < ntapes; ++i)
{ {
btspool->bts_itape[i] = btspool->bts_itape[i] = _bt_tapecreate(mktemp(strcpy(fname, TAPETEMP)));
_bt_tapecreate(mktemp(strcpy(fname, TAPETEMP))); btspool->bts_otape[i] = _bt_tapecreate(mktemp(strcpy(fname, TAPETEMP)));
btspool->bts_otape[i] =
_bt_tapecreate(mktemp(strcpy(fname, TAPETEMP)));
} }
pfree((void *) fname); pfree((void *) fname);
@ -698,8 +694,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
*/ */
if (it_ntup > 0) if (it_ntup > 0)
{ {
parray = parray = (BTSortKey *) palloc(it_ntup * sizeof(BTSortKey));
(BTSortKey *) palloc(it_ntup * sizeof(BTSortKey));
pos = itape->bttb_data; pos = itape->bttb_data;
for (i = 0; i < it_ntup; ++i) for (i = 0; i < it_ntup; ++i)
_bt_setsortkey(index, _bt_tapenext(itape, &pos), &(parray[i])); _bt_setsortkey(index, _bt_tapenext(itape, &pos), &(parray[i]));

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.23 1998/09/07 05:35:34 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.24 1999/02/03 21:15:36 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -258,8 +258,7 @@ _bt_orderkeys(Relation relation, BTScanOpaque so)
if (init[j]) if (init[j])
{ {
/* yup, use the appropriate value */ /* yup, use the appropriate value */
test = test = (long) FMGR_PTR2(&cur->sk_func, cur->sk_argument, xform[j].sk_argument);
(long) FMGR_PTR2(&cur->sk_func, cur->sk_argument, xform[j].sk_argument);
if (test) if (test)
xform[j].sk_argument = cur->sk_argument; xform[j].sk_argument = cur->sk_argument;
else if (j == (BTEqualStrategyNumber - 1)) else if (j == (BTEqualStrategyNumber - 1))

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.20 1998/12/15 12:45:29 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.21 1999/02/03 21:15:37 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -141,8 +141,7 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
s->opaque = p; s->opaque = p;
if (s->numberOfKeys > 0) if (s->numberOfKeys > 0)
{ {
p->s_internalKey = p->s_internalKey = (ScanKey) palloc(sizeof(ScanKeyData) * s->numberOfKeys);
(ScanKey) palloc(sizeof(ScanKeyData) * s->numberOfKeys);
/* /*
* Scans on internal pages use different operators than they * Scans on internal pages use different operators than they

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.21 1998/12/16 11:53:44 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.22 1999/02/03 21:15:41 momjian Exp $
* *
* NOTES * NOTES
* This file contains the high level access-method interface to the * This file contains the high level access-method interface to the
@ -497,8 +497,7 @@ TransactionIdDidCommit(TransactionId transactionId)
if (AMI_OVERRIDE) if (AMI_OVERRIDE)
return true; return true;
return return TransactionLogTest(transactionId, XID_COMMIT);
TransactionLogTest(transactionId, XID_COMMIT);
} }
/* /*
@ -515,8 +514,7 @@ TransactionIdDidAbort(TransactionId transactionId)
if (AMI_OVERRIDE) if (AMI_OVERRIDE)
return false; return false;
return return TransactionLogTest(transactionId, XID_ABORT);
TransactionLogTest(transactionId, XID_ABORT);
} }
/* /*
@ -532,8 +530,7 @@ TransactionIdIsInProgress(TransactionId transactionId)
if (AMI_OVERRIDE) if (AMI_OVERRIDE)
return false; return false;
return return TransactionLogTest(transactionId, XID_INPROGRESS);
TransactionLogTest(transactionId, XID_INPROGRESS);
} }
*/ */

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.18 1998/12/15 12:45:33 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.19 1999/02/03 21:15:45 momjian Exp $
* *
* NOTES * NOTES
* This file contains support functions for the high * This file contains support functions for the high
@ -315,8 +315,7 @@ TransBlockNumberGetXidStatus(Relation relation,
LockBuffer(buffer, BUFFER_LOCK_UNLOCK); LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
ReleaseBuffer(buffer); ReleaseBuffer(buffer);
return return xstatus;
xstatus;
} }
/* -------------------------------- /* --------------------------------

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.30 1999/02/02 03:44:00 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.31 1999/02/03 21:15:45 momjian Exp $
* *
* NOTES * NOTES
* Transaction aborts can now occur two ways: * Transaction aborts can now occur two ways:
@ -191,8 +191,7 @@ TransactionStateData CurrentTransactionStateData = {
TBLOCK_DEFAULT /* transaction block state */ TBLOCK_DEFAULT /* transaction block state */
}; };
TransactionState CurrentTransactionState = TransactionState CurrentTransactionState = &CurrentTransactionStateData;
&CurrentTransactionStateData;
int DefaultXactIsoLevel = XACT_READ_COMMITTED; int DefaultXactIsoLevel = XACT_READ_COMMITTED;
int XactIsoLevel; int XactIsoLevel;
@ -467,8 +466,7 @@ CommandIdIsCurrentCommandId(CommandId cid)
if (AMI_OVERRIDE) if (AMI_OVERRIDE)
return false; return false;
return return (cid == s->commandId) ? true : false;
(cid == s->commandId) ? true : false;
} }
bool bool
@ -479,8 +477,7 @@ CommandIdGEScanCommandId(CommandId cid)
if (AMI_OVERRIDE) if (AMI_OVERRIDE)
return false; return false;
return return (cid >= s->scanCommandId) ? true : false;
(cid >= s->scanCommandId) ? true : false;
} }
@ -511,8 +508,7 @@ CommandCounterIncrement()
elog(ERROR, "You may only have 2^32-1 commands per transaction"); elog(ERROR, "You may only have 2^32-1 commands per transaction");
} }
CurrentTransactionStateData.scanCommandId = CurrentTransactionStateData.scanCommandId = CurrentTransactionStateData.commandId;
CurrentTransactionStateData.commandId;
/* make cache changes visible to me */ /* make cache changes visible to me */
AtCommit_Cache(); AtCommit_Cache();

View File

@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.53 1999/01/17 06:18:14 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.54 1999/02/03 21:15:46 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -855,8 +855,7 @@ gettype(char *type)
static Form_pg_attribute /* XXX */ static Form_pg_attribute /* XXX */
AllocateAttribute() AllocateAttribute()
{ {
Form_pg_attribute attribute = Form_pg_attribute attribute = (Form_pg_attribute) malloc(ATTRIBUTE_TUPLE_SIZE);
(Form_pg_attribute) malloc(ATTRIBUTE_TUPLE_SIZE);
if (!PointerIsValid(attribute)) if (!PointerIsValid(attribute))
elog(FATAL, "AllocateAttribute: malloc failed"); elog(FATAL, "AllocateAttribute: malloc failed");

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.71 1999/02/02 03:44:08 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.72 1999/02/03 21:15:54 momjian Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
@ -130,8 +130,7 @@ static FormData_pg_attribute a6 = {
MaxCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0' MaxCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
}; };
static Form_pg_attribute HeapAtt[] = static Form_pg_attribute HeapAtt[] = {&a1, &a2, &a3, &a4, &a5, &a6};
{&a1, &a2, &a3, &a4, &a5, &a6};
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* XXX END OF UGLY HARD CODED BADNESS XXX * XXX END OF UGLY HARD CODED BADNESS XXX

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.68 1999/02/02 03:44:13 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.69 1999/02/03 21:15:54 momjian Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
@ -436,8 +436,7 @@ ConstructIndexReldesc(Relation indexRelation, Oid amoid)
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt); oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
indexRelation->rd_am = indexRelation->rd_am = AccessMethodObjectIdGetForm(amoid);
AccessMethodObjectIdGetForm(amoid);
MemoryContextSwitchTo(oldcxt); MemoryContextSwitchTo(oldcxt);
@ -802,8 +801,7 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
newPred = NULL; newPred = NULL;
if (predicate != NULL) if (predicate != NULL)
{ {
newPred = newPred = (Node *) make_orclause(lcons(make_andclause((List *) predicate),
(Node *) make_orclause(lcons(make_andclause((List *) predicate),
lcons(make_andclause((List *) oldPred), lcons(make_andclause((List *) oldPred),
NIL))); NIL)));
newPred = (Node *) cnfify((Expr *) newPred, true); newPred = (Node *) cnfify((Expr *) newPred, true);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.18 1998/11/27 19:51:50 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.19 1999/02/03 21:15:56 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -206,43 +206,29 @@ AggregateCreate(char *aggName,
} }
namestrcpy(&aname, aggName); namestrcpy(&aname, aggName);
values[Anum_pg_aggregate_aggname - 1] = NameGetDatum(&aname); values[Anum_pg_aggregate_aggname - 1] = NameGetDatum(&aname);
values[Anum_pg_aggregate_aggowner - 1] = values[Anum_pg_aggregate_aggowner - 1] = Int32GetDatum(GetUserId());
Int32GetDatum(GetUserId()); values[Anum_pg_aggregate_aggtransfn1 - 1] = ObjectIdGetDatum(xfn1);
values[Anum_pg_aggregate_aggtransfn1 - 1] = values[Anum_pg_aggregate_aggtransfn2 - 1] = ObjectIdGetDatum(xfn2);
ObjectIdGetDatum(xfn1); values[Anum_pg_aggregate_aggfinalfn - 1] = ObjectIdGetDatum(ffn);
values[Anum_pg_aggregate_aggtransfn2 - 1] =
ObjectIdGetDatum(xfn2);
values[Anum_pg_aggregate_aggfinalfn - 1] =
ObjectIdGetDatum(ffn);
values[Anum_pg_aggregate_aggbasetype - 1] = values[Anum_pg_aggregate_aggbasetype - 1] = ObjectIdGetDatum(xbase);
ObjectIdGetDatum(xbase);
if (!OidIsValid(xfn1)) if (!OidIsValid(xfn1))
{ {
values[Anum_pg_aggregate_aggtranstype1 - 1] = values[Anum_pg_aggregate_aggtranstype1 - 1] = ObjectIdGetDatum(InvalidOid);
ObjectIdGetDatum(InvalidOid); values[Anum_pg_aggregate_aggtranstype2 - 1] = ObjectIdGetDatum(xret2);
values[Anum_pg_aggregate_aggtranstype2 - 1] = values[Anum_pg_aggregate_aggfinaltype - 1] = ObjectIdGetDatum(xret2);
ObjectIdGetDatum(xret2);
values[Anum_pg_aggregate_aggfinaltype - 1] =
ObjectIdGetDatum(xret2);
} }
else if (!OidIsValid(xfn2)) else if (!OidIsValid(xfn2))
{ {
values[Anum_pg_aggregate_aggtranstype1 - 1] = values[Anum_pg_aggregate_aggtranstype1 - 1] = ObjectIdGetDatum(xret1);
ObjectIdGetDatum(xret1); values[Anum_pg_aggregate_aggtranstype2 - 1] = ObjectIdGetDatum(InvalidOid);
values[Anum_pg_aggregate_aggtranstype2 - 1] = values[Anum_pg_aggregate_aggfinaltype - 1] = ObjectIdGetDatum(xret1);
ObjectIdGetDatum(InvalidOid);
values[Anum_pg_aggregate_aggfinaltype - 1] =
ObjectIdGetDatum(xret1);
} }
else else
{ {
values[Anum_pg_aggregate_aggtranstype1 - 1] = values[Anum_pg_aggregate_aggtranstype1 - 1] = ObjectIdGetDatum(xret1);
ObjectIdGetDatum(xret1); values[Anum_pg_aggregate_aggtranstype2 - 1] = ObjectIdGetDatum(xret2);
values[Anum_pg_aggregate_aggtranstype2 - 1] = values[Anum_pg_aggregate_aggfinaltype - 1] = ObjectIdGetDatum(fret);
ObjectIdGetDatum(xret2);
values[Anum_pg_aggregate_aggfinaltype - 1] =
ObjectIdGetDatum(fret);
} }
if (agginitval1) if (agginitval1)

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.31 1998/12/15 12:45:45 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.32 1999/02/03 21:15:56 momjian Exp $
* *
* NOTES * NOTES
* these routines moved here from commands/define.c and somewhat cleaned up. * these routines moved here from commands/define.c and somewhat cleaned up.
@ -205,8 +205,7 @@ OperatorGet(char *operatorName,
*/ */
heap_close(pg_operator_desc); heap_close(pg_operator_desc);
return return operatorObjectId;
operatorObjectId;
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
@ -287,8 +286,7 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
*/ */
pfree(tup); pfree(tup);
return return operatorObjectId;
operatorObjectId;
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
@ -338,8 +336,7 @@ OperatorShellMake(char *operatorName,
* and recover the shell tuple's oid. * and recover the shell tuple's oid.
* ---------------- * ----------------
*/ */
operatorObjectId = operatorObjectId = OperatorShellMakeWithOpenRelation(pg_operator_desc,
OperatorShellMakeWithOpenRelation(pg_operator_desc,
operatorName, operatorName,
leftObjectId, leftObjectId,
rightObjectId); rightObjectId);
@ -349,8 +346,7 @@ OperatorShellMake(char *operatorName,
*/ */
heap_close(pg_operator_desc); heap_close(pg_operator_desc);
return return operatorObjectId;
operatorObjectId;
} }
/* -------------------------------- /* --------------------------------
@ -545,8 +541,7 @@ OperatorDef(char *operatorName,
func_error("OperatorDef", procedureName, nargs, typeId, NULL); func_error("OperatorDef", procedureName, nargs, typeId, NULL);
values[Anum_pg_operator_oprcode - 1] = ObjectIdGetDatum(tup->t_data->t_oid); values[Anum_pg_operator_oprcode - 1] = ObjectIdGetDatum(tup->t_data->t_oid);
values[Anum_pg_operator_oprresult - 1] = values[Anum_pg_operator_oprresult - 1] = ObjectIdGetDatum(((Form_pg_proc)
ObjectIdGetDatum(((Form_pg_proc)
GETSTRUCT(tup))->prorettype); GETSTRUCT(tup))->prorettype);
/* ---------------- /* ----------------
@ -811,15 +806,13 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
if (!OidIsValid(t->oprnegate)) if (!OidIsValid(t->oprnegate))
{ {
values[Anum_pg_operator_oprnegate - 1] = values[Anum_pg_operator_oprnegate - 1] = ObjectIdGetDatum(baseId);
ObjectIdGetDatum(baseId);
replaces[Anum_pg_operator_oprnegate - 1] = 'r'; replaces[Anum_pg_operator_oprnegate - 1] = 'r';
} }
if (!OidIsValid(t->oprcom)) if (!OidIsValid(t->oprcom))
{ {
values[Anum_pg_operator_oprcom - 1] = values[Anum_pg_operator_oprcom - 1] = ObjectIdGetDatum(baseId);
ObjectIdGetDatum(baseId);
replaces[Anum_pg_operator_oprcom - 1] = 'r'; replaces[Anum_pg_operator_oprcom - 1] = 'r';
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.32 1998/12/15 12:45:47 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.33 1999/02/03 21:15:56 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -196,8 +196,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
/* /*
* ... and fill typdefault with a bogus value * ... and fill typdefault with a bogus value
*/ */
values[i++] = values[i++] = (Datum) fmgr(F_TEXTIN, typeName); /* 15 */
(Datum) fmgr(F_TEXTIN, typeName); /* 15 */
/* ---------------- /* ----------------
* create a new type tuple with FormHeapTuple * create a new type tuple with FormHeapTuple
@ -228,8 +227,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
*/ */
pfree(tup); pfree(tup);
return return typoid;
typoid;
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
@ -271,8 +269,7 @@ TypeShellMake(char *typeName)
*/ */
heap_close(pg_type_desc); heap_close(pg_type_desc);
return return typoid;
typoid;
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------

View File

@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.36 1999/02/02 03:44:17 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.37 1999/02/03 21:16:02 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -257,22 +257,19 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
* To do this I get the info from pg_index, re-build the FunctInfo if * To do this I get the info from pg_index, re-build the FunctInfo if
* I have to, and add a new index with a temporary name. * I have to, and add a new index with a temporary name.
*/ */
Old_pg_index_Tuple = Old_pg_index_Tuple = SearchSysCacheTuple(INDEXRELID,
SearchSysCacheTuple(INDEXRELID,
ObjectIdGetDatum(RelationGetRelid(OldIndex)), ObjectIdGetDatum(RelationGetRelid(OldIndex)),
0, 0, 0); 0, 0, 0);
Assert(Old_pg_index_Tuple); Assert(Old_pg_index_Tuple);
Old_pg_index_Form = (Form_pg_index) GETSTRUCT(Old_pg_index_Tuple); Old_pg_index_Form = (Form_pg_index) GETSTRUCT(Old_pg_index_Tuple);
Old_pg_index_relation_Tuple = Old_pg_index_relation_Tuple = SearchSysCacheTuple(RELOID,
SearchSysCacheTuple(RELOID,
ObjectIdGetDatum(RelationGetRelid(OldIndex)), ObjectIdGetDatum(RelationGetRelid(OldIndex)),
0, 0, 0); 0, 0, 0);
Assert(Old_pg_index_relation_Tuple); Assert(Old_pg_index_relation_Tuple);
Old_pg_index_relation_Form = Old_pg_index_relation_Form = (Form_pg_class) GETSTRUCT(Old_pg_index_relation_Tuple);
(Form_pg_class) GETSTRUCT(Old_pg_index_relation_Tuple);
/* Set the name. */ /* Set the name. */
NewIndexName = palloc(NAMEDATALEN); /* XXX */ NewIndexName = palloc(NAMEDATALEN); /* XXX */
@ -297,8 +294,7 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
FIgetnArgs(finfo) = natts; FIgetnArgs(finfo) = natts;
FIgetProcOid(finfo) = Old_pg_index_Form->indproc; FIgetProcOid(finfo) = Old_pg_index_Form->indproc;
pg_proc_Tuple = pg_proc_Tuple = SearchSysCacheTuple(PROOID,
SearchSysCacheTuple(PROOID,
ObjectIdGetDatum(Old_pg_index_Form->indproc), ObjectIdGetDatum(Old_pg_index_Form->indproc),
0, 0, 0); 0, 0, 0);
@ -357,8 +353,7 @@ rebuildheap(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex)
LocalHeapTuple.t_self = ScanResult->heap_iptr; LocalHeapTuple.t_self = ScanResult->heap_iptr;
heap_fetch(LocalOldHeap, SnapshotNow, &LocalHeapTuple, &LocalBuffer); heap_fetch(LocalOldHeap, SnapshotNow, &LocalHeapTuple, &LocalBuffer);
OIDNewHeapInsert = OIDNewHeapInsert = heap_insert(LocalNewHeap, &LocalHeapTuple);
heap_insert(LocalNewHeap, &LocalHeapTuple);
pfree(ScanResult); pfree(ScanResult);
ReleaseBuffer(LocalBuffer); ReleaseBuffer(LocalBuffer);
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.35 1998/12/18 09:10:18 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.36 1999/02/03 21:16:02 momjian Exp $
* *
* NOTES * NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated * The PortalExecutorHeapMemory crap needs to be eliminated
@ -131,8 +131,7 @@ PerformPortalFetch(char *name,
*/ */
context = MemoryContextSwitchTo((MemoryContext) PortalGetHeapMemory(portal)); context = MemoryContextSwitchTo((MemoryContext) PortalGetHeapMemory(portal));
AssertState(context == AssertState(context == (MemoryContext) PortalGetHeapMemory(GetPortalByName(NULL)));
(MemoryContext) PortalGetHeapMemory(GetPortalByName(NULL)));
/* ---------------- /* ----------------
* setup "feature" to tell the executor what direction and * setup "feature" to tell the executor what direction and

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.70 1999/02/02 03:44:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.71 1999/02/03 21:16:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -537,10 +537,8 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
if (n_indices > 0) if (n_indices > 0)
{ {
has_index = true; has_index = true;
itupdescArr = itupdescArr = (TupleDesc *) palloc(n_indices * sizeof(TupleDesc));
(TupleDesc *) palloc(n_indices * sizeof(TupleDesc)); pgIndexP = (Form_pg_index *) palloc(n_indices * sizeof(Form_pg_index));
pgIndexP =
(Form_pg_index *) palloc(n_indices * sizeof(Form_pg_index));
indexNatts = (int *) palloc(n_indices * sizeof(int)); indexNatts = (int *) palloc(n_indices * sizeof(int));
finfo = (FuncIndexInfo *) palloc(n_indices * sizeof(FuncIndexInfo)); finfo = (FuncIndexInfo *) palloc(n_indices * sizeof(FuncIndexInfo));
finfoP = (FuncIndexInfo **) palloc(n_indices * sizeof(FuncIndexInfo *)); finfoP = (FuncIndexInfo **) palloc(n_indices * sizeof(FuncIndexInfo *));
@ -549,8 +547,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
for (i = 0; i < n_indices; i++) for (i = 0; i < n_indices; i++)
{ {
itupdescArr[i] = RelationGetDescr(index_rels[i]); itupdescArr[i] = RelationGetDescr(index_rels[i]);
pgIndexTup = pgIndexTup = SearchSysCacheTuple(INDEXRELID,
SearchSysCacheTuple(INDEXRELID,
ObjectIdGetDatum(RelationGetRelid(index_rels[i])), ObjectIdGetDatum(RelationGetRelid(index_rels[i])),
0, 0, 0); 0, 0, 0);
Assert(pgIndexTup); Assert(pgIndexTup);
@ -689,8 +686,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
done = 1; done = 1;
else else
{ {
values[i] = values[i] = (Datum) (*fmgr_faddr(&in_functions[i])) (string,
(Datum) (*fmgr_faddr(&in_functions[i])) (string,
elements[i], elements[i],
typmod[i]); typmod[i]);
@ -1008,13 +1004,11 @@ GetIndexRelations(Oid main_relation_oid,
while (HeapTupleIsValid(tuple = heap_getnext(scandesc, 0))) while (HeapTupleIsValid(tuple = heap_getnext(scandesc, 0)))
{ {
index_relation_oid = index_relation_oid = (Oid) DatumGetInt32(heap_getattr(tuple, 2,
(Oid) DatumGetInt32(heap_getattr(tuple, 2,
tupDesc, &isnull)); tupDesc, &isnull));
if (index_relation_oid == main_relation_oid) if (index_relation_oid == main_relation_oid)
{ {
scan->index_rel_oid = scan->index_rel_oid = (Oid) DatumGetInt32(heap_getattr(tuple,
(Oid) DatumGetInt32(heap_getattr(tuple,
Anum_pg_index_indexrelid, Anum_pg_index_indexrelid,
tupDesc, &isnull)); tupDesc, &isnull));
(*n_indices)++; (*n_indices)++;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.38 1999/02/02 03:44:19 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.39 1999/02/03 21:16:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -275,13 +275,11 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
* form name, type and constraints * form name, type and constraints
*/ */
attributeName = (attribute->attname).data; attributeName = (attribute->attname).data;
tuple = tuple = SearchSysCacheTuple(TYPOID,
SearchSysCacheTuple(TYPOID,
ObjectIdGetDatum(attribute->atttypid), ObjectIdGetDatum(attribute->atttypid),
0, 0, 0); 0, 0, 0);
Assert(HeapTupleIsValid(tuple)); Assert(HeapTupleIsValid(tuple));
attributeType = attributeType = (((Form_pg_type) GETSTRUCT(tuple))->typname).data;
(((Form_pg_type) GETSTRUCT(tuple))->typname).data;
/* /*
* check validity * check validity
@ -468,8 +466,7 @@ StoreCatalogInheritance(Oid relationId, List *supers)
if (!HeapTupleIsValid(tuple)) if (!HeapTupleIsValid(tuple))
break; break;
lnext(current) = lnext(current) = lconsi(((Form_pg_inherits)
lconsi(((Form_pg_inherits)
GETSTRUCT(tuple))->inhparent, GETSTRUCT(tuple))->inhparent,
NIL); NIL);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.32 1999/02/03 20:15:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.33 1999/02/03 21:16:04 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -172,8 +172,7 @@ DefineIndex(char *heapRelationName,
strcpy(FIgetname(&fInfo), funcIndex->name); strcpy(FIgetname(&fInfo), funcIndex->name);
attributeNumberA = attributeNumberA = (AttrNumber *) palloc(nargs * sizeof attributeNumberA[0]);
(AttrNumber *) palloc(nargs * sizeof attributeNumberA[0]);
classObjectId = (Oid *) palloc(sizeof classObjectId[0]); classObjectId = (Oid *) palloc(sizeof classObjectId[0]);
@ -194,8 +193,7 @@ DefineIndex(char *heapRelationName,
attributeNumberA = (AttrNumber *) palloc(numberOfAttributes * attributeNumberA = (AttrNumber *) palloc(numberOfAttributes *
sizeof attributeNumberA[0]); sizeof attributeNumberA[0]);
classObjectId = classObjectId = (Oid *) palloc(numberOfAttributes * sizeof classObjectId[0]);
(Oid *) palloc(numberOfAttributes * sizeof classObjectId[0]);
NormIndexAttrs(attributeList, attributeNumberA, NormIndexAttrs(attributeList, attributeNumberA,
classObjectId, relationId); classObjectId, relationId);
@ -306,11 +304,9 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
predInfo->pred = (Node *) cnfPred; predInfo->pred = (Node *) cnfPred;
predInfo->oldPred = oldPred; predInfo->oldPred = oldPred;
attributeNumberA = attributeNumberA = (AttrNumber *) palloc(numberOfAttributes *
(AttrNumber *) palloc(numberOfAttributes *
sizeof attributeNumberA[0]); sizeof attributeNumberA[0]);
classObjectId = classObjectId = (Oid *) palloc(numberOfAttributes * sizeof classObjectId[0]);
(Oid *) palloc(numberOfAttributes * sizeof classObjectId[0]);
for (i = 0; i < numberOfAttributes; i++) for (i = 0; i < numberOfAttributes; i++)

View File

@ -611,8 +611,7 @@ ExecBRInsertTriggers(Relation rel, HeapTuple trigtuple)
int i; int i;
SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData)); SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData));
SaveTriggerData->tg_event = SaveTriggerData->tg_event = TRIGGER_EVENT_INSERT | TRIGGER_EVENT_ROW | TRIGGER_EVENT_BEFORE;
TRIGGER_EVENT_INSERT | TRIGGER_EVENT_ROW | TRIGGER_EVENT_BEFORE;
SaveTriggerData->tg_relation = rel; SaveTriggerData->tg_relation = rel;
SaveTriggerData->tg_newtuple = NULL; SaveTriggerData->tg_newtuple = NULL;
for (i = 0; i < ntrigs; i++) for (i = 0; i < ntrigs; i++)
@ -672,8 +671,7 @@ ExecBRDeleteTriggers(EState *estate, ItemPointer tupleid)
return false; return false;
SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData)); SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData));
SaveTriggerData->tg_event = SaveTriggerData->tg_event = TRIGGER_EVENT_DELETE | TRIGGER_EVENT_ROW | TRIGGER_EVENT_BEFORE;
TRIGGER_EVENT_DELETE | TRIGGER_EVENT_ROW | TRIGGER_EVENT_BEFORE;
SaveTriggerData->tg_relation = rel; SaveTriggerData->tg_relation = rel;
SaveTriggerData->tg_newtuple = NULL; SaveTriggerData->tg_newtuple = NULL;
for (i = 0; i < ntrigs; i++) for (i = 0; i < ntrigs; i++)
@ -708,8 +706,7 @@ ExecARDeleteTriggers(EState *estate, ItemPointer tupleid)
Assert(trigtuple != NULL); Assert(trigtuple != NULL);
SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData)); SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData));
SaveTriggerData->tg_event = SaveTriggerData->tg_event = TRIGGER_EVENT_DELETE | TRIGGER_EVENT_ROW;
TRIGGER_EVENT_DELETE | TRIGGER_EVENT_ROW;
SaveTriggerData->tg_relation = rel; SaveTriggerData->tg_relation = rel;
SaveTriggerData->tg_newtuple = NULL; SaveTriggerData->tg_newtuple = NULL;
for (i = 0; i < ntrigs; i++) for (i = 0; i < ntrigs; i++)
@ -750,8 +747,7 @@ ExecBRUpdateTriggers(EState *estate, ItemPointer tupleid, HeapTuple newtuple)
intuple = newtuple = ExecRemoveJunk(estate->es_junkFilter, newSlot); intuple = newtuple = ExecRemoveJunk(estate->es_junkFilter, newSlot);
SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData)); SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData));
SaveTriggerData->tg_event = SaveTriggerData->tg_event = TRIGGER_EVENT_UPDATE | TRIGGER_EVENT_ROW | TRIGGER_EVENT_BEFORE;
TRIGGER_EVENT_UPDATE | TRIGGER_EVENT_ROW | TRIGGER_EVENT_BEFORE;
SaveTriggerData->tg_relation = rel; SaveTriggerData->tg_relation = rel;
for (i = 0; i < ntrigs; i++) for (i = 0; i < ntrigs; i++)
{ {
@ -785,8 +781,7 @@ ExecARUpdateTriggers(EState *estate, ItemPointer tupleid, HeapTuple newtuple)
Assert(trigtuple != NULL); Assert(trigtuple != NULL);
SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData)); SaveTriggerData = (TriggerData *) palloc(sizeof(TriggerData));
SaveTriggerData->tg_event = SaveTriggerData->tg_event = TRIGGER_EVENT_UPDATE | TRIGGER_EVENT_ROW;
TRIGGER_EVENT_UPDATE | TRIGGER_EVENT_ROW;
SaveTriggerData->tg_relation = rel; SaveTriggerData->tg_relation = rel;
for (i = 0; i < ntrigs; i++) for (i = 0; i < ntrigs; i++)
{ {

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.93 1999/01/17 06:18:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.94 1999/02/03 21:16:04 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -434,8 +434,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols)
attr_cnt = tcnt; attr_cnt = tcnt;
} }
vacrelstats->vacattrstats = vacrelstats->vacattrstats = (VacAttrStats *) palloc(attr_cnt * sizeof(VacAttrStats));
(VacAttrStats *) palloc(attr_cnt * sizeof(VacAttrStats));
for (i = 0; i < attr_cnt; i++) for (i = 0; i < attr_cnt; i++)
{ {

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: view.c,v 1.30 1999/02/02 03:44:20 momjian Exp $ * $Id: view.c,v 1.31 1999/02/03 21:16:06 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -165,17 +165,13 @@ DefineViewRules(char *viewName, Query *viewParse)
#endif #endif
retrieve_rule = retrieve_rule = FormViewRetrieveRule(viewName, viewParse);
FormViewRetrieveRule(viewName, viewParse);
#ifdef NOTYET #ifdef NOTYET
replace_rule = replace_rule = FormViewReplaceRule(viewName, viewParse);
FormViewReplaceRule(viewName, viewParse); append_rule = FormViewAppendRule(viewName, viewParse);
append_rule = delete_rule = FormViewDeleteRule(viewName, viewParse);
FormViewAppendRule(viewName, viewParse);
delete_rule =
FormViewDeleteRule(viewName, viewParse);
#endif #endif
@ -233,11 +229,9 @@ UpdateRangeTableOfViewParse(char *viewName, Query *viewParse)
* create the 2 new range table entries and form the new range * create the 2 new range table entries and form the new range
* table... CURRENT first, then NEW.... * table... CURRENT first, then NEW....
*/ */
rt_entry1 = rt_entry1 = addRangeTableEntry(NULL, (char *) viewName, "*CURRENT*",
addRangeTableEntry(NULL, (char *) viewName, "*CURRENT*",
FALSE, FALSE); FALSE, FALSE);
rt_entry2 = rt_entry2 = addRangeTableEntry(NULL, (char *) viewName, "*NEW*",
addRangeTableEntry(NULL, (char *) viewName, "*NEW*",
FALSE, FALSE); FALSE, FALSE);
new_rt = lcons(rt_entry2, old_rt); new_rt = lcons(rt_entry2, old_rt);
new_rt = lcons(rt_entry1, new_rt); new_rt = lcons(rt_entry1, new_rt);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.14 1998/09/01 03:22:13 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.15 1999/02/03 21:16:10 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -386,8 +386,7 @@ ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
*/ */
for (i = 0; i < cleanLength; i++) for (i = 0; i < cleanLength; i++)
{ {
values[i] = values[i] = heap_getattr(tuple, cleanMap[i], tupType, &isNull);
heap_getattr(tuple, cleanMap[i], tupType, &isNull);
if (isNull) if (isNull)
nulls[i] = 'n'; nulls[i] = 'n';

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.41 1999/01/25 18:02:13 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.42 1999/02/03 21:16:10 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -882,8 +882,7 @@ ExecEvalOper(Expr *opClause, ExprContext *econtext, bool *isNull)
* We don't have operator whose arguments are sets. * We don't have operator whose arguments are sets.
****************** ******************
*/ */
return return ExecMakeFunctionResult((Node *) op, argList, econtext, isNull, &isDone);
ExecMakeFunctionResult((Node *) op, argList, econtext, isNull, &isDone);
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
@ -926,8 +925,7 @@ ExecEvalFunc(Expr *funcClause,
fcache = func->func_fcache; fcache = func->func_fcache;
} }
return return ExecMakeFunctionResult((Node *) func, argList, econtext, isNull, isDone);
ExecMakeFunctionResult((Node *) func, argList, econtext, isNull, isDone);
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
@ -1642,8 +1640,7 @@ ExecTargetList(List *targetlist,
if (nodomains > 64) if (nodomains > 64)
pfree(null_head); pfree(null_head);
return return newTuple;
newTuple;
} }
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------

View File

@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.21 1998/10/08 18:29:26 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.22 1999/02/03 21:16:11 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -870,8 +870,7 @@ ExecCopyTupType(TupleDesc td, int natts)
i = 0; i = 0;
while (i < natts) while (i < natts)
{ {
newTd[i] = newTd[i] = (Form_pg_attribute)palloc(sizeof(FormData_pg_attribute));
(Form_pg_attribute)palloc(sizeof(FormData_pg_attribute));
memmove(newTd[i], td[i], sizeof(FormData_pg_attribute)); memmove(newTd[i], td[i], sizeof(FormData_pg_attribute));
i++; i++;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.41 1998/12/15 12:46:05 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.42 1999/02/03 21:16:11 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -331,8 +331,7 @@ ExecAssignProjectionInfo(Plan *node, CommonState *commonstate)
projInfo = makeNode(ProjectionInfo); projInfo = makeNode(ProjectionInfo);
projInfo->pi_targetlist = targetList; projInfo->pi_targetlist = targetList;
projInfo->pi_len = len; projInfo->pi_len = len;
projInfo->pi_tupValue = projInfo->pi_tupValue = (len <= 0) ? NULL : (Datum *) palloc(sizeof(Datum) * len);
(len <= 0) ? NULL : (Datum *) palloc(sizeof(Datum) * len);
projInfo->pi_exprContext = commonstate->cs_ExprContext; projInfo->pi_exprContext = commonstate->cs_ExprContext;
projInfo->pi_slot = commonstate->cs_ResultTupleSlot; projInfo->pi_slot = commonstate->cs_ResultTupleSlot;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.21 1998/11/27 19:52:01 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.22 1999/02/03 21:16:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -135,8 +135,7 @@ init_execution_state(FunctionCachePtr fcache,
int i; int i;
ParamListInfo paramLI; ParamListInfo paramLI;
paramLI = paramLI = (ParamListInfo) palloc((nargs + 1) * sizeof(ParamListInfoData));
(ParamListInfo) palloc((nargs + 1) * sizeof(ParamListInfoData));
MemSet(paramLI, 0, nargs * sizeof(ParamListInfoData)); MemSet(paramLI, 0, nargs * sizeof(ParamListInfoData));
@ -272,8 +271,7 @@ copy_function_result(FunctionCachePtr fcache,
while (i < oldTuple->t_data->t_natts) while (i < oldTuple->t_data->t_natts)
{ {
funcTd->attrs[i] = funcTd->attrs[i] = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
(Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
memmove(funcTd->attrs[i], memmove(funcTd->attrs[i],
resultTd->attrs[i], resultTd->attrs[i],
ATTRIBUTE_TUPLE_SIZE); ATTRIBUTE_TUPLE_SIZE);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.15 1998/09/01 04:28:26 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.16 1999/02/03 21:16:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -150,14 +150,12 @@ exec_append_initialize_next(Append *node)
if (appendstate->as_junkFilter_list) if (appendstate->as_junkFilter_list)
{ {
estate->es_junkFilter = estate->es_junkFilter = (JunkFilter *) nth(whichplan,
(JunkFilter *) nth(whichplan,
appendstate->as_junkFilter_list); appendstate->as_junkFilter_list);
} }
if (appendstate->as_result_relation_info_list) if (appendstate->as_result_relation_info_list)
{ {
estate->es_result_relation_info = estate->es_result_relation_info = (RelationInfo *) nth(whichplan,
(RelationInfo *) nth(whichplan,
appendstate->as_result_relation_info_list); appendstate->as_result_relation_info_list);
} }
result_slot->ttc_whichplan = whichplan; result_slot->ttc_whichplan = whichplan;

View File

@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* *
* $Id: nodeHash.c,v 1.29 1999/01/17 06:18:19 momjian Exp $ * $Id: nodeHash.c,v 1.30 1999/02/03 21:16:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -581,11 +581,9 @@ ExecHashGetBucket(HashJoinTable hashtable,
* ------------------ * ------------------
*/ */
if (execConstByVal) if (execConstByVal)
bucketno = bucketno = hashFunc((char *) &keyval, execConstLen) % hashtable->totalbuckets;
hashFunc((char *) &keyval, execConstLen) % hashtable->totalbuckets;
else else
bucketno = bucketno = hashFunc((char *) keyval, execConstLen) % hashtable->totalbuckets;
hashFunc((char *) keyval, execConstLen) % hashtable->totalbuckets;
#ifdef HJDEBUG #ifdef HJDEBUG
if (bucketno >= hashtable->nbuckets) if (bucketno >= hashtable->nbuckets)
printf("hash(%d) = %d SAVED\n", keyval, bucketno); printf("hash(%d) = %d SAVED\n", keyval, bucketno);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.15 1999/01/17 06:18:21 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.16 1999/02/03 21:16:13 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -189,8 +189,7 @@ ExecHashJoin(HashJoin *node)
* hash node * hash node
* ------------------ * ------------------
*/ */
hjstate->hj_InnerBatches = hjstate->hj_InnerBatches = hashNode->hashstate->hashBatches;
hashNode->hashstate->hashBatches;
} }
outerbatchPos = (RelativeAddr *) ABSADDR(hashtable->outerbatchPos); outerbatchPos = (RelativeAddr *) ABSADDR(hashtable->outerbatchPos);
curbatch = hashtable->curbatch; curbatch = hashtable->curbatch;
@ -452,17 +451,14 @@ ExecInitHashJoin(HashJoin *node, EState *estate, Plan *parent)
*/ */
{ {
HashState *hashstate = hashNode->hashstate; HashState *hashstate = hashNode->hashstate;
TupleTableSlot *slot = TupleTableSlot *slot = hashstate->cstate.cs_ResultTupleSlot;
hashstate->cstate.cs_ResultTupleSlot;
hjstate->hj_HashTupleSlot = slot; hjstate->hj_HashTupleSlot = slot;
} }
hjstate->hj_OuterTupleSlot->ttc_tupleDescriptor = hjstate->hj_OuterTupleSlot->ttc_tupleDescriptor = ExecGetTupType(outerNode);
ExecGetTupType(outerNode);
/* /*
hjstate->hj_OuterTupleSlot->ttc_execTupDescriptor = hjstate->hj_OuterTupleSlot->ttc_execTupDescriptor = ExecGetExecTupDesc(outerNode);
ExecGetExecTupDesc(outerNode);
*/ */
/* ---------------- /* ----------------

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.30 1999/01/29 09:22:58 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.31 1999/02/03 21:16:14 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -308,8 +308,7 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
if (exprCtxt == NULL) if (exprCtxt == NULL)
exprCtxt = node->scan.scanstate->cstate.cs_ExprContext; exprCtxt = node->scan.scanstate->cstate.cs_ExprContext;
node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple = node->scan.scanstate->cstate.cs_ExprContext->ecxt_outertuple = exprCtxt->ecxt_outertuple;
exprCtxt->ecxt_outertuple;
/* /*
* get the index qualifications and recalculate the appropriate values * get the index qualifications and recalculate the appropriate values

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.18 1998/11/27 19:52:03 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.19 1999/02/03 21:16:14 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -359,8 +359,7 @@ ExecMaterialReScan(Material *node, ExprContext *exprCtxt, Plan *parent)
if (matstate->mat_Flag == false) if (matstate->mat_Flag == false)
return; return;
matstate->csstate.css_currentScanDesc = matstate->csstate.css_currentScanDesc = ExecReScanR(matstate->csstate.css_currentRelation,
ExecReScanR(matstate->csstate.css_currentRelation,
matstate->csstate.css_currentScanDesc, matstate->csstate.css_currentScanDesc,
node->plan.state->es_direction, 0, NULL); node->plan.state->es_direction, 0, NULL);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.19 1998/09/01 04:28:35 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.20 1999/02/03 21:16:14 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -513,7 +513,7 @@ ExecMergeJoin(MergeJoin *node)
econtext->ecxt_outertuple = outerTupleSlot; econtext->ecxt_outertuple = outerTupleSlot;
mergestate->mj_MarkedTupleSlot->ttc_tupleDescriptor = mergestate->mj_MarkedTupleSlot->ttc_tupleDescriptor =
innerTupleSlot->ttc_tupleDescriptor; innerTupleSlot->ttc_tupleDescriptor;
/* ---------------- /* ----------------
* initialize merge join state to skip inner tuples. * initialize merge join state to skip inner tuples.

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.11 1998/09/01 03:22:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.12 1999/02/03 21:16:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -249,8 +249,7 @@ pbuf_addTupleValueLengths(int n)
char * char *
pbuf_addValues(int n) pbuf_addValues(int n)
{ {
return return pbuf_alloc(n);
pbuf_alloc(n);
} }
/* -------------------------------- /* --------------------------------
@ -515,6 +514,5 @@ pbuf_findFname(GroupBuffer *group,
int field_number) int field_number)
{ {
pbuf_checkFnumber(group, field_number); pbuf_checkFnumber(group, field_number);
return return (group->types[field_number]).name;
(group->types[field_number]).name;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.58 1999/02/03 20:15:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.59 1999/02/03 21:16:17 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1104,8 +1104,7 @@ CopyPathFields(Path *from, Path *newnode)
{ {
for (len = 0; ordering[len] != 0; len++) for (len = 0; ordering[len] != 0; len++)
; ;
newnode->p_ordering.ord.sortop = newnode->p_ordering.ord.sortop = (Oid *) palloc(sizeof(Oid) * (len + 1));
(Oid *) palloc(sizeof(Oid) * (len + 1));
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
newnode->p_ordering.ord.sortop[i] = ordering[i]; newnode->p_ordering.ord.sortop[i] = ordering[i];
newnode->p_ordering.ord.sortop[len] = 0; newnode->p_ordering.ord.sortop[len] = 0;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.45 1999/02/03 20:15:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.46 1999/02/03 21:16:18 momjian 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
@ -552,8 +552,7 @@ _readIndexScan()
_getScan((Scan *) local_node); _getScan((Scan *) local_node);
token = lsptok(NULL, &length); /* eat :indxid */ token = lsptok(NULL, &length); /* eat :indxid */
local_node->indxid = local_node->indxid = toIntList(nodeRead(true)); /* now read it */
toIntList(nodeRead(true)); /* now read it */
token = lsptok(NULL, &length); /* eat :indxqual */ token = lsptok(NULL, &length); /* eat :indxqual */
local_node->indxqual = nodeRead(true); /* now read it */ local_node->indxqual = nodeRead(true); /* now read it */
@ -1296,8 +1295,7 @@ _readRelOptInfo()
local_node = makeNode(RelOptInfo); local_node = makeNode(RelOptInfo);
token = lsptok(NULL, &length); /* get :relids */ token = lsptok(NULL, &length); /* get :relids */
local_node->relids = local_node->relids = toIntList(nodeRead(true)); /* now read it */
toIntList(nodeRead(true)); /* now read it */
token = lsptok(NULL, &length); /* get :indexed */ token = lsptok(NULL, &length); /* get :indexed */
token = lsptok(NULL, &length); /* now read it */ token = lsptok(NULL, &length); /* now read it */
@ -1477,8 +1475,7 @@ _readPath()
#if 0 #if 0
token = lsptok(NULL, &length); /* get :p_ordering */ token = lsptok(NULL, &length); /* get :p_ordering */
local_node->p_ordering = local_node->p_ordering = nodeRead(true); /* now read it */
nodeRead(true); /* now read it */
#endif #endif
token = lsptok(NULL, &length); /* get :keys */ token = lsptok(NULL, &length); /* get :keys */
@ -1519,8 +1516,7 @@ _readIndexPath()
local_node->path.keys = nodeRead(true); /* now read it */ local_node->path.keys = nodeRead(true); /* now read it */
token = lsptok(NULL, &length); /* get :indexid */ token = lsptok(NULL, &length); /* get :indexid */
local_node->indexid = local_node->indexid = toIntList(nodeRead(true));
toIntList(nodeRead(true));
token = lsptok(NULL, &length); /* get :indexqual */ token = lsptok(NULL, &length); /* get :indexqual */
local_node->indexqual = nodeRead(true); /* now read it */ local_node->indexqual = nodeRead(true); /* now read it */
@ -1589,8 +1585,7 @@ _readJoinPath()
local_node->path.outerjoincost = (Cost) atof(token); local_node->path.outerjoincost = (Cost) atof(token);
token = lsptok(NULL, &length); /* get :joinid */ token = lsptok(NULL, &length); /* get :joinid */
local_node->path.joinid = local_node->path.joinid = toIntList(nodeRead(true)); /* now read it */
toIntList(nodeRead(true)); /* now read it */
return local_node; return local_node;
} }
@ -1657,8 +1652,7 @@ _readMergePath()
local_node->jpath.path.outerjoincost = (Cost) atof(token); local_node->jpath.path.outerjoincost = (Cost) atof(token);
token = lsptok(NULL, &length); /* get :joinid */ token = lsptok(NULL, &length); /* get :joinid */
local_node->jpath.path.joinid = local_node->jpath.path.joinid = toIntList(nodeRead(true)); /* now read it */
toIntList(nodeRead(true)); /* now read it */
token = lsptok(NULL, &length); /* get :path_mergeclauses */ token = lsptok(NULL, &length); /* get :path_mergeclauses */
local_node->path_mergeclauses = nodeRead(true); /* now read it */ local_node->path_mergeclauses = nodeRead(true); /* now read it */
@ -1734,8 +1728,7 @@ _readHashPath()
local_node->jpath.path.outerjoincost = (Cost) atof(token); local_node->jpath.path.outerjoincost = (Cost) atof(token);
token = lsptok(NULL, &length); /* get :joinid */ token = lsptok(NULL, &length); /* get :joinid */
local_node->jpath.path.joinid = local_node->jpath.path.joinid = toIntList(nodeRead(true)); /* now read it */
toIntList(nodeRead(true)); /* now read it */
token = lsptok(NULL, &length); /* get :path_hashclauses */ token = lsptok(NULL, &length); /* get :path_hashclauses */
local_node->path_hashclauses = nodeRead(true); /* now read it */ local_node->path_hashclauses = nodeRead(true); /* now read it */
@ -1957,8 +1950,7 @@ _readJoinInfo()
local_node = makeNode(JoinInfo); local_node = makeNode(JoinInfo);
token = lsptok(NULL, &length); /* get :otherrels */ token = lsptok(NULL, &length); /* get :otherrels */
local_node->otherrels = local_node->otherrels = toIntList(nodeRead(true)); /* now read it */
toIntList(nodeRead(true)); /* now read it */
token = lsptok(NULL, &length); /* get :jinfo_restrictinfo */ token = lsptok(NULL, &length); /* get :jinfo_restrictinfo */
local_node->jinfo_restrictinfo = nodeRead(true); /* now read it */ local_node->jinfo_restrictinfo = nodeRead(true); /* now read it */

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo_eval.c,v 1.25 1999/02/03 20:15:24 momjian Exp $ * $Id: geqo_eval.c,v 1.26 1999/02/03 21:16:19 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -269,11 +269,9 @@ init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininf
* of the outer and inner join relations and then merging the results * of the outer and inner join relations and then merging the results
* together. * together.
*/ */
new_outer_tlist = new_outer_tlist = new_join_tlist(outer_rel->targetlist, /* XXX 1-based attnos */
new_join_tlist(outer_rel->targetlist, /* XXX 1-based attnos */
inner_rel->relids, 1); inner_rel->relids, 1);
new_inner_tlist = new_inner_tlist = new_join_tlist(inner_rel->targetlist, /* XXX 1-based attnos */
new_join_tlist(inner_rel->targetlist, /* XXX 1-based attnos */
outer_rel->relids, outer_rel->relids,
length(new_outer_tlist) + 1); length(new_outer_tlist) + 1);
@ -355,8 +353,7 @@ new_join_tlist(List *tlist,
if (in_final_tlist) if (in_final_tlist)
{ {
resdomno += 1; resdomno += 1;
temp_node = temp_node = lcons(create_tl_element(get_expr(xtl),
lcons(create_tl_element(get_expr(xtl),
resdomno), resdomno),
NIL); NIL);
t_list = nconc(t_list, temp_node); t_list = nconc(t_list, temp_node);
@ -540,8 +537,7 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
new_joininfo->mergejoinable = mergejoinable; new_joininfo->mergejoinable = mergejoinable;
new_joininfo->hashjoinable = hashjoinable; new_joininfo->hashjoinable = hashjoinable;
new_joininfo->inactive = false; new_joininfo->inactive = false;
rel->joininfo = rel->joininfo = lappend(rel->joininfo, new_joininfo);
lappend(rel->joininfo, new_joininfo);
foreach(xsuper_rel, super_rels) foreach(xsuper_rel, super_rels)
{ {
@ -550,8 +546,7 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
if (nonoverlap_rels(super_rel, joinrel)) if (nonoverlap_rels(super_rel, joinrel))
{ {
List *new_relids = super_rel->relids; List *new_relids = super_rel->relids;
JoinInfo *other_joininfo = JoinInfo *other_joininfo = joininfo_member(new_relids,
joininfo_member(new_relids,
joinrel->joininfo); joinrel->joininfo);
if (other_joininfo) if (other_joininfo)
@ -569,8 +564,7 @@ geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
new_joininfo->mergejoinable = mergejoinable; new_joininfo->mergejoinable = mergejoinable;
new_joininfo->hashjoinable = hashjoinable; new_joininfo->hashjoinable = hashjoinable;
new_joininfo->inactive = false; new_joininfo->inactive = false;
joinrel->joininfo = joinrel->joininfo = lappend(joinrel->joininfo,
lappend(joinrel->joininfo,
new_joininfo); new_joininfo);
} }
} }

View File

@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo_main.c,v 1.11 1998/09/01 04:29:18 momjian Exp $ * $Id: geqo_main.c,v 1.12 1999/02/03 21:16:22 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -189,8 +189,7 @@ geqo(Query *root)
pmx(momma->string, daddy->string, kid->string, pool->string_length); pmx(momma->string, daddy->string, kid->string, pool->string_length);
#elif defined(CX) #elif defined(CX)
/* CYCLE CROSSOVER */ /* CYCLE CROSSOVER */
cycle_diffs = cycle_diffs = cx(momma->string, daddy->string, kid->string, pool->string_length, city_table);
cx(momma->string, daddy->string, kid->string, pool->string_length, city_table);
/* mutate the child */ /* mutate the child */
if (cycle_diffs == 0) if (cycle_diffs == 0)
{ {

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo_params.c,v 1.11 1999/01/17 06:18:27 momjian Exp $ * $Id: geqo_params.c,v 1.12 1999/02/03 21:16:23 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -85,8 +85,7 @@ geqo_params(int string_length)
/* put together the full pathname to the config file */ /* put together the full pathname to the config file */
conf_file = conf_file = (char *) palloc((strlen(DataDir) + strlen(GEQO_FILE) + 2) * sizeof(char));
(char *) palloc((strlen(DataDir) + strlen(GEQO_FILE) + 2) * sizeof(char));
sprintf(conf_file, "%s/%s", DataDir, GEQO_FILE); sprintf(conf_file, "%s/%s", DataDir, GEQO_FILE);

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo_pool.c,v 1.9 1998/09/01 03:23:13 momjian Exp $ * $Id: geqo_pool.c,v 1.10 1999/02/03 21:16:23 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -109,8 +109,7 @@ random_init_pool(Query *root, Pool *pool, int strt, int stp)
* "geqo_recombination.c" * "geqo_recombination.c"
* */ * */
pool->data[i].worth = pool->data[i].worth = geqo_eval(root, chromo[i].string, pool->string_length); /* "from geqo_eval.c" */
geqo_eval(root, chromo[i].string, pool->string_length); /* "from geqo_eval.c" */
} }
} }

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: geqo_selection.c,v 1.5 1998/09/01 03:23:16 momjian Exp $ * $Id: geqo_selection.c,v 1.6 1999/02/03 21:16:23 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -97,8 +97,7 @@ linear(int pool_size, double bias) /* bias is y-intercept of linear
double index; /* index between 0 and pop_size */ double index; /* index between 0 and pop_size */
double max = (double) pool_size; double max = (double) pool_size;
index = index = max * (bias - sqrt((bias * bias) - 4.0 * (bias - 1.0) * geqo_rand()))
max * (bias - sqrt((bias * bias) - 4.0 * (bias - 1.0) * geqo_rand()))
/ 2.0 / (bias - 1.0); / 2.0 / (bias - 1.0);
return (int) index; return (int) index;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.15 1999/02/03 20:15:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.16 1999/02/03 21:16:24 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -131,8 +131,7 @@ set_rest_selec(Query *root, List *restrictinfo_list)
*/ */
if (valid_or_clause(clausenode) || FLOAT_IS_ZERO(cost_clause)) if (valid_or_clause(clausenode) || FLOAT_IS_ZERO(cost_clause))
{ {
clausenode->selectivity = clausenode->selectivity = compute_clause_selec(root,
compute_clause_selec(root,
(Node *) clausenode->clause, (Node *) clausenode->clause,
lcons(makeFloat(cost_clause), NIL)); lcons(makeFloat(cost_clause), NIL));
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.8 1999/02/03 20:15:32 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.9 1999/02/03 21:16:25 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -60,8 +60,7 @@ group_clauses_by_hashop(List *restrictinfo_list,
Var *rightop = get_rightop(clause); Var *rightop = get_rightop(clause);
JoinKey *keys = (JoinKey *) NULL; JoinKey *keys = (JoinKey *) NULL;
xhashinfo = xhashinfo = match_hashop_hashinfo(hashjoinop, hashinfo_list);
match_hashop_hashinfo(hashjoinop, hashinfo_list);
if (inner_relid == leftop->varno) if (inner_relid == leftop->varno)
{ {
@ -89,11 +88,9 @@ group_clauses_by_hashop(List *restrictinfo_list,
hashinfo_list = nreverse(hashinfo_list); hashinfo_list = nreverse(hashinfo_list);
} }
xhashinfo->jmethod.clauses = xhashinfo->jmethod.clauses = lcons(clause, xhashinfo->jmethod.clauses);
lcons(clause, xhashinfo->jmethod.clauses);
xhashinfo->jmethod.jmkeys = xhashinfo->jmethod.jmkeys = lcons(keys, xhashinfo->jmethod.jmkeys);
lcons(keys, xhashinfo->jmethod.jmkeys);
} }
} }
return hashinfo_list; return hashinfo_list;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.36 1999/02/03 20:15:32 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.37 1999/02/03 21:16:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -238,8 +238,7 @@ match_index_orclauses(RelOptInfo * rel,
* each of its subclauses. The list is generated by adding * each of its subclauses. The list is generated by adding
* 'index' to the existing list where appropriate. * 'index' to the existing list where appropriate.
*/ */
restrictinfo->indexids = restrictinfo->indexids = match_index_orclause(rel, index, indexkey,
match_index_orclause(rel, index, indexkey,
xclass, xclass,
restrictinfo->clause->args, restrictinfo->clause->args,
restrictinfo->indexids); restrictinfo->indexids);
@ -649,8 +648,7 @@ match_clause_to_indexkey(RelOptInfo * rel,
{ {
restrict_op = oprid(newop); restrict_op = oprid(newop);
isIndexable = isIndexable = (op_class(restrict_op, xclass, index->relam) &&
(op_class(restrict_op, xclass, index->relam) &&
IndexScanableOperand(leftop, IndexScanableOperand(leftop,
indexkey, indexkey,
rel, rel,
@ -670,8 +668,7 @@ match_clause_to_indexkey(RelOptInfo * rel,
else if ((leftop && IsA(leftop, Const)) || else if ((leftop && IsA(leftop, Const)) ||
(leftop && IsA(leftop, Param))) (leftop && IsA(leftop, Param)))
{ {
restrict_op = restrict_op = get_commutator(((Oper *) ((Expr *) clause)->oper)->opno);
get_commutator(((Oper *) ((Expr *) clause)->oper)->opno);
isIndexable = ((restrict_op != InvalidOid) && isIndexable = ((restrict_op != InvalidOid) &&
op_class(restrict_op, xclass, index->relam) && op_class(restrict_op, xclass, index->relam) &&
@ -703,8 +700,7 @@ match_clause_to_indexkey(RelOptInfo * rel,
if (HeapTupleIsValid(newop) && (oprid(newop) != restrict_op)) if (HeapTupleIsValid(newop) && (oprid(newop) != restrict_op))
{ {
restrict_op = restrict_op = get_commutator(oprid(newop));
get_commutator(oprid(newop));
isIndexable = ((restrict_op != InvalidOid) && isIndexable = ((restrict_op != InvalidOid) &&
op_class(restrict_op, xclass, index->relam) && op_class(restrict_op, xclass, index->relam) &&
@ -1201,8 +1197,7 @@ indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index,
if (joininfo->jinfo_restrictinfo == NIL) if (joininfo->jinfo_restrictinfo == NIL)
continue; continue;
clausegroups = clausegroups = group_clauses_by_ikey_for_joins(rel,
group_clauses_by_ikey_for_joins(rel,
index, index,
index->indexkeys, index->indexkeys,
index->classlist, index->classlist,
@ -1213,8 +1208,7 @@ indexable_joinclauses(RelOptInfo * rel, RelOptInfo * index,
{ {
List *clauses = lfirst(clausegroups); List *clauses = lfirst(clausegroups);
((RestrictInfo *) lfirst(clauses))->cinfojoinid = ((RestrictInfo *) lfirst(clauses))->cinfojoinid = joininfo->otherrels;
joininfo->otherrels;
} }
cg_list = nconc(cg_list, clausegroups); cg_list = nconc(cg_list, clausegroups);
} }
@ -1306,8 +1300,7 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
pathnode->path.joinid = ((RestrictInfo *) lfirst(clausegroup))->cinfojoinid; pathnode->path.joinid = ((RestrictInfo *) lfirst(clausegroup))->cinfojoinid;
pathnode->path.path_cost = pathnode->path.path_cost = cost_index((Oid) lfirsti(index->relids),
cost_index((Oid) lfirsti(index->relids),
(int) temp_pages, (int) temp_pages,
temp_selec, temp_selec,
rel->pages, rel->pages,
@ -1320,16 +1313,14 @@ index_innerjoin(Query *root, RelOptInfo * rel, List *clausegroup_list,
* copy restrictinfo list into path for expensive function * copy restrictinfo list into path for expensive function
* processing -- JMH, 7/7/92 * processing -- JMH, 7/7/92
*/ */
pathnode->path.loc_restrictinfo = pathnode->path.loc_restrictinfo = set_difference(copyObject((Node *) rel->restrictinfo),
set_difference(copyObject((Node *) rel->restrictinfo),
clausegroup); clausegroup);
#if 0 /* fix xfunc */ #if 0 /* fix xfunc */
/* add in cost for expensive functions! -- JMH, 7/7/92 */ /* add in cost for expensive functions! -- JMH, 7/7/92 */
if (XfuncMode != XFUNC_OFF) if (XfuncMode != XFUNC_OFF)
{ {
((Path *) pathnode)->path_cost += ((Path *) pathnode)->path_cost += xfunc_get_path_cost((Path *) pathnode);
xfunc_get_path_cost((Path *) pathnode);
} }
#endif #endif
cg_list = lappend(cg_list, pathnode); cg_list = lappend(cg_list, pathnode);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.11 1999/02/03 20:15:33 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.12 1999/02/03 21:16:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -96,15 +96,13 @@ find_all_join_paths(Query *root, List *joinrels)
outerrel->relids); outerrel->relids);
if (_enable_mergejoin_) if (_enable_mergejoin_)
{ {
mergeinfo_list = mergeinfo_list = group_clauses_by_order(joinrel->restrictinfo,
group_clauses_by_order(joinrel->restrictinfo,
lfirsti(innerrel->relids)); lfirsti(innerrel->relids));
} }
if (_enable_hashjoin_) if (_enable_hashjoin_)
{ {
hashinfo_list = hashinfo_list = group_clauses_by_hashop(joinrel->restrictinfo,
group_clauses_by_hashop(joinrel->restrictinfo,
lfirsti(innerrel->relids)); lfirsti(innerrel->relids));
} }
@ -123,8 +121,7 @@ find_all_join_paths(Query *root, List *joinrels)
* explicitly sorted. This may include either nestloops and * explicitly sorted. This may include either nestloops and
* mergejoins where the outer path is already ordered. * mergejoins where the outer path is already ordered.
*/ */
pathlist = pathlist = add_pathlist(joinrel, pathlist,
add_pathlist(joinrel, pathlist,
match_unsorted_outer(joinrel, match_unsorted_outer(joinrel,
outerrel, outerrel,
innerrel, innerrel,
@ -139,8 +136,7 @@ find_all_join_paths(Query *root, List *joinrels)
* the actual nestloop nodes were constructed in * the actual nestloop nodes were constructed in
* (match-unsorted-outer). * (match-unsorted-outer).
*/ */
pathlist = pathlist = add_pathlist(joinrel, pathlist,
add_pathlist(joinrel, pathlist,
match_unsorted_inner(joinrel, outerrel, match_unsorted_inner(joinrel, outerrel,
innerrel, innerrel,
innerrel->pathlist, innerrel->pathlist,
@ -151,8 +147,7 @@ find_all_join_paths(Query *root, List *joinrels)
* hashed before being joined. * hashed before being joined.
*/ */
pathlist = pathlist = add_pathlist(joinrel, pathlist,
add_pathlist(joinrel, pathlist,
hash_inner_and_outer(joinrel, outerrel, hash_inner_and_outer(joinrel, outerrel,
innerrel, hashinfo_list)); innerrel, hashinfo_list));
@ -251,22 +246,18 @@ sort_inner_and_outer(RelOptInfo * joinrel,
{ {
xmergeinfo = (MInfo *) lfirst(i); xmergeinfo = (MInfo *) lfirst(i);
outerkeys = outerkeys = extract_path_keys(xmergeinfo->jmethod.jmkeys,
extract_path_keys(xmergeinfo->jmethod.jmkeys,
outerrel->targetlist, outerrel->targetlist,
OUTER); OUTER);
innerkeys = innerkeys = extract_path_keys(xmergeinfo->jmethod.jmkeys,
extract_path_keys(xmergeinfo->jmethod.jmkeys,
innerrel->targetlist, innerrel->targetlist,
INNER); INNER);
merge_pathkeys = merge_pathkeys = new_join_pathkeys(outerkeys, joinrel->targetlist,
new_join_pathkeys(outerkeys, joinrel->targetlist,
xmergeinfo->jmethod.clauses); xmergeinfo->jmethod.clauses);
temp_node = temp_node = create_mergejoin_path(joinrel,
create_mergejoin_path(joinrel,
outerrel->size, outerrel->size,
innerrel->size, innerrel->size,
outerrel->width, outerrel->width,
@ -342,8 +333,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
if (outerpath_ordering) if (outerpath_ordering)
{ {
xmergeinfo = xmergeinfo = match_order_mergeinfo(outerpath_ordering,
match_order_mergeinfo(outerpath_ordering,
mergeinfo_list); mergeinfo_list);
} }
@ -355,14 +345,12 @@ match_unsorted_outer(RelOptInfo * joinrel,
List *keys = xmergeinfo->jmethod.jmkeys; List *keys = xmergeinfo->jmethod.jmkeys;
List *clauses = xmergeinfo->jmethod.clauses; List *clauses = xmergeinfo->jmethod.clauses;
matchedJoinKeys = matchedJoinKeys = match_pathkeys_joinkeys(outerpath->keys,
match_pathkeys_joinkeys(outerpath->keys,
keys, keys,
clauses, clauses,
OUTER, OUTER,
&matchedJoinClauses); &matchedJoinClauses);
merge_pathkeys = merge_pathkeys = new_join_pathkeys(outerpath->keys,
new_join_pathkeys(outerpath->keys,
joinrel->targetlist, clauses); joinrel->targetlist, clauses);
} }
else else
@ -385,14 +373,12 @@ match_unsorted_outer(RelOptInfo * joinrel,
{ {
bool path_is_cheaper_than_sort; bool path_is_cheaper_than_sort;
List *varkeys = NIL; List *varkeys = NIL;
Path *mergeinnerpath = Path *mergeinnerpath = match_paths_joinkeys(matchedJoinKeys,
match_paths_joinkeys(matchedJoinKeys,
outerpath_ordering, outerpath_ordering,
innerrel->pathlist, innerrel->pathlist,
INNER); INNER);
path_is_cheaper_than_sort = path_is_cheaper_than_sort = (bool) (mergeinnerpath &&
(bool) (mergeinnerpath &&
(mergeinnerpath->path_cost < (mergeinnerpath->path_cost <
(cheapest_inner->path_cost + (cheapest_inner->path_cost +
cost_sort(matchedJoinKeys, cost_sort(matchedJoinKeys,
@ -401,8 +387,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
false)))); false))));
if (!path_is_cheaper_than_sort) if (!path_is_cheaper_than_sort)
{ {
varkeys = varkeys = extract_path_keys(matchedJoinKeys,
extract_path_keys(matchedJoinKeys,
innerrel->targetlist, innerrel->targetlist,
INNER); INNER);
} }
@ -419,8 +404,7 @@ match_unsorted_outer(RelOptInfo * joinrel,
else else
mergeinnerpath = cheapest_inner; mergeinnerpath = cheapest_inner;
temp_node = temp_node = lcons(create_mergejoin_path(joinrel,
lcons(create_mergejoin_path(joinrel,
outerrel->size, outerrel->size,
innerrel->size, innerrel->size,
outerrel->width, outerrel->width,
@ -492,8 +476,7 @@ match_unsorted_inner(RelOptInfo * joinrel,
if (innerpath_ordering) if (innerpath_ordering)
{ {
xmergeinfo = xmergeinfo = match_order_mergeinfo(innerpath_ordering,
match_order_mergeinfo(innerpath_ordering,
mergeinfo_list); mergeinfo_list);
} }
@ -505,8 +488,7 @@ match_unsorted_inner(RelOptInfo * joinrel,
List *keys = xmergeinfo->jmethod.jmkeys; List *keys = xmergeinfo->jmethod.jmkeys;
List *cls = xmergeinfo->jmethod.clauses; List *cls = xmergeinfo->jmethod.clauses;
matchedJoinKeys = matchedJoinKeys = match_pathkeys_joinkeys(innerpath->keys,
match_pathkeys_joinkeys(innerpath->keys,
keys, keys,
cls, cls,
INNER, INNER,
@ -528,17 +510,14 @@ match_unsorted_inner(RelOptInfo * joinrel,
if (temp2) if (temp2)
{ {
List *outerkeys = List *outerkeys = extract_path_keys(matchedJoinKeys,
extract_path_keys(matchedJoinKeys,
outerrel->targetlist, outerrel->targetlist,
OUTER); OUTER);
List *merge_pathkeys = List *merge_pathkeys = new_join_pathkeys(outerkeys,
new_join_pathkeys(outerkeys,
joinrel->targetlist, joinrel->targetlist,
clauses); clauses);
temp_node = temp_node = lcons(create_mergejoin_path(joinrel,
lcons(create_mergejoin_path(joinrel,
outerrel->size, outerrel->size,
innerrel->size, innerrel->size,
outerrel->width, outerrel->width,
@ -611,16 +590,13 @@ hash_inner_and_outer(RelOptInfo * joinrel,
foreach(i, hashinfo_list) foreach(i, hashinfo_list)
{ {
xhashinfo = (HInfo *) lfirst(i); xhashinfo = (HInfo *) lfirst(i);
outerkeys = outerkeys = extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
outerrel->targetlist, outerrel->targetlist,
OUTER); OUTER);
innerkeys = innerkeys = extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
extract_path_keys(((JoinMethod *) xhashinfo)->jmkeys,
innerrel->targetlist, innerrel->targetlist,
INNER); INNER);
hash_pathkeys = hash_pathkeys = new_join_pathkeys(outerkeys,
new_join_pathkeys(outerkeys,
joinrel->targetlist, joinrel->targetlist,
((JoinMethod *) xhashinfo)->clauses); ((JoinMethod *) xhashinfo)->clauses);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.16 1999/02/03 20:15:33 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.17 1999/02/03 21:16:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -203,11 +203,9 @@ init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininf
* of the outer and inner join relations and then merging the results * of the outer and inner join relations and then merging the results
* together. * together.
*/ */
new_outer_tlist = new_outer_tlist = new_join_tlist(outer_rel->targetlist, /* XXX 1-based attnos */
new_join_tlist(outer_rel->targetlist, /* XXX 1-based attnos */
inner_rel->relids, 1); inner_rel->relids, 1);
new_inner_tlist = new_inner_tlist = new_join_tlist(inner_rel->targetlist, /* XXX 1-based attnos */
new_join_tlist(inner_rel->targetlist, /* XXX 1-based attnos */
outer_rel->relids, outer_rel->relids,
length(new_outer_tlist) + 1); length(new_outer_tlist) + 1);
@ -243,8 +241,7 @@ init_join_rel(RelOptInfo * outer_rel, RelOptInfo * inner_rel, JoinInfo * joininf
joininfo->inactive = true; joininfo->inactive = true;
} }
joinrel_joininfo_list = joinrel_joininfo_list = new_joininfo_list(append(outer_rel->joininfo, inner_rel->joininfo),
new_joininfo_list(append(outer_rel->joininfo, inner_rel->joininfo),
intAppend(outer_rel->relids, inner_rel->relids)); intAppend(outer_rel->relids, inner_rel->relids));
joinrel->joininfo = joinrel_joininfo_list; joinrel->joininfo = joinrel_joininfo_list;
@ -291,8 +288,7 @@ new_join_tlist(List *tlist,
if (in_final_tlist) if (in_final_tlist)
{ {
resdomno += 1; resdomno += 1;
temp_node = temp_node = lcons(create_tl_element(get_expr(xtl),
lcons(create_tl_element(get_expr(xtl),
resdomno), resdomno),
NIL); NIL);
t_list = nconc(t_list, temp_node); t_list = nconc(t_list, temp_node);
@ -346,8 +342,7 @@ new_joininfo_list(List *joininfo_list, List *join_relids)
current_joininfo_list); current_joininfo_list);
if (other_joininfo) if (other_joininfo)
{ {
other_joininfo->jinfo_restrictinfo = other_joininfo->jinfo_restrictinfo = (List *) LispUnion(joininfo->jinfo_restrictinfo,
(List *) LispUnion(joininfo->jinfo_restrictinfo,
other_joininfo->jinfo_restrictinfo); other_joininfo->jinfo_restrictinfo);
} }
else else
@ -425,8 +420,7 @@ add_new_joininfos(Query *root, List *joinrels, List *outerrels)
new_joininfo->mergejoinable = mergejoinable; new_joininfo->mergejoinable = mergejoinable;
new_joininfo->hashjoinable = hashjoinable; new_joininfo->hashjoinable = hashjoinable;
new_joininfo->inactive = false; new_joininfo->inactive = false;
rel->joininfo = rel->joininfo = lappend(rel->joininfo, new_joininfo);
lappend(rel->joininfo, new_joininfo);
foreach(xsuper_rel, super_rels) foreach(xsuper_rel, super_rels)
{ {
@ -435,14 +429,12 @@ add_new_joininfos(Query *root, List *joinrels, List *outerrels)
if (nonoverlap_rels(super_rel, joinrel)) if (nonoverlap_rels(super_rel, joinrel))
{ {
List *new_relids = super_rel->relids; List *new_relids = super_rel->relids;
JoinInfo *other_joininfo = JoinInfo *other_joininfo = joininfo_member(new_relids,
joininfo_member(new_relids,
joinrel->joininfo); joinrel->joininfo);
if (other_joininfo) if (other_joininfo)
{ {
other_joininfo->jinfo_restrictinfo = other_joininfo->jinfo_restrictinfo = (List *) LispUnion(restrict_info,
(List *) LispUnion(restrict_info,
other_joininfo->jinfo_restrictinfo); other_joininfo->jinfo_restrictinfo);
} }
else else
@ -454,8 +446,7 @@ add_new_joininfos(Query *root, List *joinrels, List *outerrels)
new_joininfo->mergejoinable = mergejoinable; new_joininfo->mergejoinable = mergejoinable;
new_joininfo->hashjoinable = hashjoinable; new_joininfo->hashjoinable = hashjoinable;
new_joininfo->inactive = false; new_joininfo->inactive = false;
joinrel->joininfo = joinrel->joininfo = lappend(joinrel->joininfo,
lappend(joinrel->joininfo,
new_joininfo); new_joininfo);
} }
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.8 1998/09/01 04:29:38 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.9 1999/02/03 21:16:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -85,8 +85,7 @@ match_pathkeys_joinkeys(List *pathkeys,
foreach(i, pathkeys) foreach(i, pathkeys)
{ {
pathkey = lfirst(i); pathkey = lfirst(i);
matched_joinkey_index = matched_joinkey_index = match_pathkey_joinkeys(pathkey, joinkeys, which_subkey);
match_pathkey_joinkeys(pathkey, joinkeys, which_subkey);
if (matched_joinkey_index != -1) if (matched_joinkey_index != -1)
{ {
@ -287,8 +286,7 @@ extract_path_keys(List *joinkeys,
if (p != NIL) if (p != NIL)
continue; /* key already in pathkeys */ continue; /* key already in pathkeys */
pathkeys = pathkeys = lappend(pathkeys, lcons(key, NIL));
lappend(pathkeys, lcons(key, NIL));
} }
return pathkeys; return pathkeys;
} }
@ -371,8 +369,7 @@ new_join_pathkey(List *subkeys,
subkey = (Var *) lfirst(i); subkey = (Var *) lfirst(i);
if (subkey == NULL) if (subkey == NULL)
break; /* XXX something is wrong */ break; /* XXX something is wrong */
matched_subkeys = matched_subkeys = new_matching_subkeys(subkey, considered_subkeys,
new_matching_subkeys(subkey, considered_subkeys,
join_rel_tlist, joinclauses); join_rel_tlist, joinclauses);
tlist_key = matching_tlvar(subkey, join_rel_tlist); tlist_key = matching_tlvar(subkey, join_rel_tlist);
newly_considered_subkeys = NIL; newly_considered_subkeys = NIL;
@ -386,8 +383,7 @@ new_join_pathkey(List *subkeys,
else else
newly_considered_subkeys = matched_subkeys; newly_considered_subkeys = matched_subkeys;
considered_subkeys = considered_subkeys = append(considered_subkeys, newly_considered_subkeys);
append(considered_subkeys, newly_considered_subkeys);
t_list = nconc(t_list, newly_considered_subkeys); t_list = nconc(t_list, newly_considered_subkeys);
} }
@ -426,8 +422,7 @@ new_matching_subkeys(Var *subkey,
foreach(i, joinclauses) foreach(i, joinclauses)
{ {
joinclause = lfirst(i); joinclause = lfirst(i);
tlist_other_var = tlist_other_var = matching_tlvar(other_join_clause_var(subkey, joinclause),
matching_tlvar(other_join_clause_var(subkey, joinclause),
join_rel_tlist); join_rel_tlist);
if (tlist_other_var && if (tlist_other_var &&

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.10 1999/02/03 20:15:33 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.11 1999/02/03 21:16:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -84,11 +84,9 @@ group_clauses_by_order(List *restrictinfo_list,
mergeinfo_list); mergeinfo_list);
} }
((JoinMethod *) xmergeinfo)->clauses = ((JoinMethod *) xmergeinfo)->clauses = lcons(clause,
lcons(clause,
((JoinMethod *) xmergeinfo)->clauses); ((JoinMethod *) xmergeinfo)->clauses);
((JoinMethod *) xmergeinfo)->jmkeys = ((JoinMethod *) xmergeinfo)->jmkeys = lcons(keys,
lcons(keys,
((JoinMethod *) xmergeinfo)->jmkeys); ((JoinMethod *) xmergeinfo)->jmkeys);
} }
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.13 1999/02/03 20:15:33 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.14 1999/02/03 21:16:28 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -121,16 +121,14 @@ create_or_index_paths(Query *root,
* copy restrictinfo list into path for expensive function * copy restrictinfo list into path for expensive function
* processing -- JMH, 7/7/92 * processing -- JMH, 7/7/92
*/ */
pathnode->path.loc_restrictinfo = pathnode->path.loc_restrictinfo = set_difference(copyObject((Node *) rel->restrictinfo),
set_difference(copyObject((Node *) rel->restrictinfo),
lcons(clausenode, NIL)); lcons(clausenode, NIL));
#if 0 /* fix xfunc */ #if 0 /* fix xfunc */
/* add in cost for expensive functions! -- JMH, 7/7/92 */ /* add in cost for expensive functions! -- JMH, 7/7/92 */
if (XfuncMode != XFUNC_OFF) if (XfuncMode != XFUNC_OFF)
{ {
((Path *) pathnode)->path_cost += ((Path *) pathnode)->path_cost += xfunc_get_path_cost((Path) pathnode);
xfunc_get_path_cost((Path) pathnode);
} }
#endif #endif
clausenode->selectivity = (Cost) floatVal(selecs); clausenode->selectivity = (Cost) floatVal(selecs);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.14 1999/02/03 20:15:34 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.15 1999/02/03 21:16:28 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -256,13 +256,11 @@ xfunc_llel_chains(Stream root, Stream bottom)
* i.e. it would be lower than the attributes it references. * i.e. it would be lower than the attributes it references.
*/ */
Assert(xfunc_num_relids(pathstream) > xfunc_num_relids(tmpstream)); Assert(xfunc_num_relids(pathstream) > xfunc_num_relids(tmpstream));
progress = progress = xfunc_prdmig_pullup(origstream, tmpstream,
xfunc_prdmig_pullup(origstream, tmpstream,
(JoinPath) get_pathptr(pathstream)); (JoinPath) get_pathptr(pathstream));
} }
if (get_downstream(tmpstream)) if (get_downstream(tmpstream))
pathstream = pathstream = (Stream) xfunc_get_downjoin((Stream) get_downstream(tmpstream));
(Stream) xfunc_get_downjoin((Stream) get_downstream(tmpstream));
} }
/* free up origstream */ /* free up origstream */
@ -526,8 +524,7 @@ xfunc_add_clauses(Stream current)
/* first add in the local clauses */ /* first add in the local clauses */
foreach(temp, get_loc_restrictinfo((Path) get_pathptr(current))) foreach(temp, get_loc_restrictinfo((Path) get_pathptr(current)))
{ {
topnode = topnode = xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
XFUNC_LOCPRD); XFUNC_LOCPRD);
} }
@ -538,8 +535,7 @@ xfunc_add_clauses(Stream current)
foreach(temp, get_pathrestrictinfo((JoinPath) get_pathptr(current))) foreach(temp, get_pathrestrictinfo((JoinPath) get_pathptr(current)))
{ {
if (!equal(get_clause((RestrictInfo) lfirst(temp)), primjoin)) if (!equal(get_clause((RestrictInfo) lfirst(temp)), primjoin))
topnode = topnode = xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
xfunc_streaminsert((RestrictInfo) lfirst(temp), topnode,
XFUNC_JOINPRD); XFUNC_JOINPRD);
} }
} }

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.23 1999/02/03 20:15:34 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.24 1999/02/03 21:16:29 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -80,8 +80,7 @@ xfunc_trypullup(RelOptInfo rel)
for (ever) for (ever)
{ {
/* No, the following should NOT be '==' !! */ /* No, the following should NOT be '==' !! */
if (clausetype = if (clausetype = xfunc_shouldpull((Path) get_innerjoinpath(curpath),
xfunc_shouldpull((Path) get_innerjoinpath(curpath),
curpath, INNER, &maxcinfo)) curpath, INNER, &maxcinfo))
{ {
@ -96,8 +95,7 @@ xfunc_trypullup(RelOptInfo rel)
{ {
/* No, the following should NOT be '==' !! */ /* No, the following should NOT be '==' !! */
if (clausetype = if (clausetype = xfunc_shouldpull((Path) get_outerjoinpath(curpath),
xfunc_shouldpull((Path) get_outerjoinpath(curpath),
curpath, OUTER, &maxcinfo)) curpath, OUTER, &maxcinfo))
{ {
@ -644,8 +642,7 @@ xfunc_width(LispValue clause)
{ {
/* Param node projects a complex type */ /* Param node projects a complex type */
Assert(length(get_param_tlist((Param) clause)) == 1); /* sanity */ Assert(length(get_param_tlist((Param) clause)) == 1); /* sanity */
retval = retval = xfunc_width((LispValue)
xfunc_width((LispValue)
get_expr(lfirst(get_param_tlist((Param) clause)))); get_expr(lfirst(get_param_tlist((Param) clause))));
} }
else else
@ -696,8 +693,7 @@ xfunc_width(LispValue clause)
* the projected attribute * the projected attribute
*/ */
Assert(length(get_func_tlist(func)) == 1); /* sanity */ Assert(length(get_func_tlist(func)) == 1); /* sanity */
retval = retval = xfunc_width((LispValue)
xfunc_width((LispValue)
get_expr(lfirst(get_func_tlist(func)))); get_expr(lfirst(get_func_tlist(func))));
goto exit; goto exit;
} }
@ -774,8 +770,7 @@ xfunc_card_product(Query *queryInfo, Relid relids)
foreach(cinfonode, get_restrictinfo(currel)) foreach(cinfonode, get_restrictinfo(currel))
{ {
if (!xfunc_expense(queryInfo, get_clause((RestrictInfo) lfirst(cinfonode)))) if (!xfunc_expense(queryInfo, get_clause((RestrictInfo) lfirst(cinfonode))))
tuples *= tuples *= compute_clause_selec(queryInfo,
compute_clause_selec(queryInfo,
get_clause((RestrictInfo) lfirst(cinfonode)), get_clause((RestrictInfo) lfirst(cinfonode)),
LispNil); LispNil);
} }
@ -1240,8 +1235,7 @@ xfunc_disjunct_sort(LispValue clause_list)
foreach(temp, clause_list) foreach(temp, clause_list)
if (or_clause(lfirst(temp))) if (or_clause(lfirst(temp)))
lnext(lfirst(temp)) = lnext(lfirst(temp)) = lisp_qsort(lnext(lfirst(temp)), xfunc_disjunct_compare);
lisp_qsort(lnext(lfirst(temp)), xfunc_disjunct_compare);
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.35 1999/02/03 20:15:37 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.36 1999/02/03 21:16:30 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -396,11 +396,9 @@ create_indexscan_node(IndexPath *best_path,
(List *) copyObject(lfirst(indxqual))); (List *) copyObject(lfirst(indxqual)));
} }
fixed_indxqual = fixed_indxqual = (List *) fix_indxqual_references((Node *) indxqual, (Path *) best_path);
(List *) fix_indxqual_references((Node *) indxqual, (Path *) best_path);
scan_node = scan_node = make_indexscan(tlist,
make_indexscan(tlist,
qpqual, qpqual,
lfirsti(best_path->path.parent->relids), lfirsti(best_path->path.parent->relids),
best_path->indexid, best_path->indexid,
@ -470,12 +468,10 @@ create_nestloop_node(JoinPath *best_path,
List *new_inner_qual = NIL; List *new_inner_qual = NIL;
clauses = set_difference(clauses, inner_indxqual); /* XXX */ clauses = set_difference(clauses, inner_indxqual); /* XXX */
new_inner_qual = new_inner_qual = index_outerjoin_references(inner_indxqual,
index_outerjoin_references(inner_indxqual,
outer_node->targetlist, outer_node->targetlist,
((Scan *) inner_node)->scanrelid); ((Scan *) inner_node)->scanrelid);
((IndexScan *) inner_node)->indxqual = ((IndexScan *) inner_node)->indxqual = lcons(new_inner_qual, NIL);
lcons(new_inner_qual, NIL);
} }
} }
else if (IsA_Join(inner_node)) else if (IsA_Join(inner_node))
@ -533,17 +529,14 @@ create_mergejoin_node(MergePath *best_path,
outer_tlist, outer_tlist,
inner_tlist)); inner_tlist));
opcode = opcode = get_opcode((best_path->jpath.path.p_ordering.ord.merge)->join_operator);
get_opcode((best_path->jpath.path.p_ordering.ord.merge)->join_operator);
outer_order = (Oid *) palloc(sizeof(Oid) * 2); outer_order = (Oid *) palloc(sizeof(Oid) * 2);
outer_order[0] = outer_order[0] = (best_path->jpath.path.p_ordering.ord.merge)->left_operator;
(best_path->jpath.path.p_ordering.ord.merge)->left_operator;
outer_order[1] = 0; outer_order[1] = 0;
inner_order = (Oid *) palloc(sizeof(Oid) * 2); inner_order = (Oid *) palloc(sizeof(Oid) * 2);
inner_order[0] = inner_order[0] = (best_path->jpath.path.p_ordering.ord.merge)->right_operator;
(best_path->jpath.path.p_ordering.ord.merge)->right_operator;
inner_order[1] = 0; inner_order[1] = 0;
/* /*
@ -615,8 +608,7 @@ create_hashjoin_node(HashPath *best_path,
* Separate the hashclauses from the other join qualification clauses * Separate the hashclauses from the other join qualification clauses
* and set those clauses to contain references to lower attributes. * and set those clauses to contain references to lower attributes.
*/ */
qpqual = qpqual = join_references(set_difference(clauses,
join_references(set_difference(clauses,
best_path->path_hashclauses), best_path->path_hashclauses),
outer_tlist, outer_tlist,
inner_tlist); inner_tlist);
@ -625,8 +617,7 @@ create_hashjoin_node(HashPath *best_path,
* Now set the references in the hashclauses and rearrange them so * Now set the references in the hashclauses and rearrange them so
* that the outer variable is always on the left. * that the outer variable is always on the left.
*/ */
hashclauses = hashclauses = switch_outer(join_references(best_path->path_hashclauses,
switch_outer(join_references(best_path->path_hashclauses,
outer_tlist, outer_tlist,
inner_tlist)); inner_tlist));
@ -690,8 +681,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
is_funcclause((Node *) get_leftop((Expr *) clause)) && is_funcclause((Node *) get_leftop((Expr *) clause)) &&
((Func *) ((Expr *) get_leftop((Expr *) clause))->oper)->funcisindex) ((Func *) ((Expr *) get_leftop((Expr *) clause))->oper)->funcisindex)
{ {
Var *newvar = Var *newvar = makeVar((Index) lfirsti(index_path->parent->relids),
makeVar((Index) lfirsti(index_path->parent->relids),
1, /* func indices have one key */ 1, /* func indices have one key */
((Func *) ((Expr *) clause)->oper)->functype, ((Func *) ((Expr *) clause)->oper)->functype,
-1, -1,
@ -699,8 +689,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
(Index) lfirsti(index_path->parent->relids), (Index) lfirsti(index_path->parent->relids),
0); 0);
return return ((Node *) make_opclause((Oper *) ((Expr *) clause)->oper,
((Node *) make_opclause((Oper *) ((Expr *) clause)->oper,
newvar, newvar,
get_rightop((Expr *) clause))); get_rightop((Expr *) clause)));
@ -716,8 +705,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
{ {
subclause = lfirst(i); subclause = lfirst(i);
if (subclause) if (subclause)
new_subclauses = new_subclauses = lappend(new_subclauses,
lappend(new_subclauses,
fix_indxqual_references(subclause, fix_indxqual_references(subclause,
index_path)); index_path));
@ -751,8 +739,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
{ {
subclause = lfirst(i); subclause = lfirst(i);
if (subclause) if (subclause)
new_subclauses = new_subclauses = lappend(new_subclauses,
lappend(new_subclauses,
fix_indxqual_references(subclause, fix_indxqual_references(subclause,
index_path)); index_path));

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.21 1999/02/03 20:15:38 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.22 1999/02/03 21:16:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -208,8 +208,7 @@ add_clause_to_rels(Query *root, List *clause)
} }
else else
{ {
restrictinfo->selectivity = restrictinfo->selectivity = compute_clause_selec(root, (Node *) clause, NIL);
compute_clause_selec(root, (Node *) clause, NIL);
} }
rel->restrictinfo = lcons(restrictinfo, rel->restrictinfo); rel->restrictinfo = lcons(restrictinfo, rel->restrictinfo);
} }
@ -232,8 +231,7 @@ add_clause_to_rels(Query *root, List *clause)
} }
else else
{ {
restrictinfo->selectivity = restrictinfo->selectivity = compute_clause_selec(root, (Node *) clause, NIL);
compute_clause_selec(root, (Node *) clause, NIL);
} }
add_join_info_to_rels(root, restrictinfo, relids); add_join_info_to_rels(root, restrictinfo, relids);
/* we are going to be doing a join, so add var to targetlist */ /* we are going to be doing a join, so add var to targetlist */
@ -272,8 +270,7 @@ add_join_info_to_rels(Query *root, RestrictInfo * restrictinfo, List *join_relid
joininfo = find_joininfo_node(get_base_rel(root, lfirsti(join_relid)), joininfo = find_joininfo_node(get_base_rel(root, lfirsti(join_relid)),
other_rels); other_rels);
joininfo->jinfo_restrictinfo = joininfo->jinfo_restrictinfo = lcons(copyObject((void *) restrictinfo), joininfo->jinfo_restrictinfo);
lcons(copyObject((void *) restrictinfo), joininfo->jinfo_restrictinfo);
} }
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.41 1999/02/03 20:15:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.42 1999/02/03 21:16:36 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -124,8 +124,7 @@ union_planner(Query *parse)
parse->resultRelation, parse->resultRelation,
parse->rtable); parse->rtable);
} }
else if ((rt_index = else if ((rt_index = first_inherit_rt_entry(rangetable)) != -1)
first_inherit_rt_entry(rangetable)) != -1)
{ {
if (parse->rowMark != NULL) if (parse->rowMark != NULL)
elog(ERROR, "SELECT FOR UPDATE is not supported for inherit queries"); elog(ERROR, "SELECT FOR UPDATE is not supported for inherit queries");
@ -263,8 +262,7 @@ union_planner(Query *parse)
* get the varno/attno entries to the appropriate references to * get the varno/attno entries to the appropriate references to
* the result tuple of the subplans. * the result tuple of the subplans.
*/ */
((Agg *) result_plan)->aggs = ((Agg *) result_plan)->aggs = get_agg_tlist_references((Agg *) result_plan);
get_agg_tlist_references((Agg *) result_plan);
/***S*H***/ /***S*H***/
if(parse->havingQual!=NULL) if(parse->havingQual!=NULL)

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.36 1999/02/03 20:15:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.37 1999/02/03 21:16:38 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -150,8 +150,7 @@ set_tempscan_tlist_references(SeqScan *tempscan)
{ {
Temp *temp = (Temp *) ((Plan *) tempscan)->lefttree; Temp *temp = (Temp *) ((Plan *) tempscan)->lefttree;
((Plan *) tempscan)->targetlist = ((Plan *) tempscan)->targetlist = tlist_temp_references(temp->tempid,
tlist_temp_references(temp->tempid,
((Plan *) tempscan)->targetlist); ((Plan *) tempscan)->targetlist);
set_temp_tlist_references(temp); set_temp_tlist_references(temp);
} }
@ -175,8 +174,7 @@ set_temp_tlist_references(Temp *temp)
if (source != NULL) if (source != NULL)
{ {
set_tlist_references(source); set_tlist_references(source);
((Plan *) temp)->targetlist = ((Plan *) temp)->targetlist = copy_vars(((Plan *) temp)->targetlist,
copy_vars(((Plan *) temp)->targetlist,
(source)->targetlist); (source)->targetlist);
} }
else else
@ -307,8 +305,7 @@ replace_clause_joinvar_refs(Expr *clause,
return (List *) clause; return (List *) clause;
else if (and_clause((Node *) clause)) else if (and_clause((Node *) clause))
{ {
List *andclause = List *andclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
replace_subclause_joinvar_refs(((Expr *) clause)->args,
outer_tlist, outer_tlist,
inner_tlist); inner_tlist);
@ -316,8 +313,7 @@ replace_clause_joinvar_refs(Expr *clause,
} }
else if (or_clause((Node *) clause)) else if (or_clause((Node *) clause))
{ {
List *orclause = List *orclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
replace_subclause_joinvar_refs(((Expr *) clause)->args,
outer_tlist, outer_tlist,
inner_tlist); inner_tlist);
@ -351,8 +347,7 @@ replace_clause_joinvar_refs(Expr *clause,
} }
else if (is_funcclause((Node *) clause)) else if (is_funcclause((Node *) clause))
{ {
List *funcclause = List *funcclause = replace_subclause_joinvar_refs(((Expr *) clause)->args,
replace_subclause_joinvar_refs(((Expr *) clause)->args,
outer_tlist, outer_tlist,
inner_tlist); inner_tlist);
@ -361,8 +356,7 @@ replace_clause_joinvar_refs(Expr *clause,
} }
else if (not_clause((Node *) clause)) else if (not_clause((Node *) clause))
{ {
List *notclause = List *notclause = replace_clause_joinvar_refs(get_notclausearg(clause),
replace_clause_joinvar_refs(get_notclausearg(clause),
outer_tlist, outer_tlist,
inner_tlist); inner_tlist);
@ -370,12 +364,10 @@ replace_clause_joinvar_refs(Expr *clause,
} }
else if (is_opclause((Node *) clause)) else if (is_opclause((Node *) clause))
{ {
Var *leftvar = Var *leftvar = (Var *) replace_clause_joinvar_refs((Expr *) get_leftop(clause),
(Var *) replace_clause_joinvar_refs((Expr *) get_leftop(clause),
outer_tlist, outer_tlist,
inner_tlist); inner_tlist);
Var *rightvar = Var *rightvar = (Var *) replace_clause_joinvar_refs((Expr *) get_rightop(clause),
(Var *) replace_clause_joinvar_refs((Expr *) get_rightop(clause),
outer_tlist, outer_tlist,
inner_tlist); inner_tlist);
@ -385,8 +377,7 @@ replace_clause_joinvar_refs(Expr *clause,
} }
else if (is_subplan(clause)) else if (is_subplan(clause))
{ {
((Expr *) clause)->args = ((Expr *) clause)->args = replace_subclause_joinvar_refs(((Expr *) clause)->args,
replace_subclause_joinvar_refs(((Expr *) clause)->args,
outer_tlist, outer_tlist,
inner_tlist); inner_tlist);
((SubPlan *) ((Expr *) clause)->oper)->sublink->oper = ((SubPlan *) ((Expr *) clause)->oper)->sublink->oper =
@ -965,8 +956,7 @@ check_having_qual_for_vars(Node *clause, List *targetlist_so_far)
} }
else if (IsA(clause, Aggref)) else if (IsA(clause, Aggref))
{ {
targetlist_so_far = targetlist_so_far = check_having_qual_for_vars(((Aggref *) clause)->target, targetlist_so_far);
check_having_qual_for_vars(((Aggref *) clause)->target, targetlist_so_far);
return targetlist_so_far; return targetlist_so_far;
} }
else if (IsA(clause, ArrayRef)) else if (IsA(clause, ArrayRef))

View File

@ -340,8 +340,7 @@ SS_replace_correlation_vars(Node *expr)
} }
else if (IsA(expr, Iter)) else if (IsA(expr, Iter))
{ {
((Iter *) expr)->iterexpr = ((Iter *) expr)->iterexpr = SS_replace_correlation_vars(((Iter *) expr)->iterexpr);
SS_replace_correlation_vars(((Iter *) expr)->iterexpr);
} }
else if (single_node(expr)) else if (single_node(expr))
return expr; return expr;
@ -350,22 +349,18 @@ SS_replace_correlation_vars(Node *expr)
((Expr *) expr)->args = (List *) ((Expr *) expr)->args = (List *)
SS_replace_correlation_vars((Node *) ((Expr *) expr)->args); SS_replace_correlation_vars((Node *) ((Expr *) expr)->args);
else if (IsA(expr, Aggref)) else if (IsA(expr, Aggref))
((Aggref *) expr)->target = ((Aggref *) expr)->target = SS_replace_correlation_vars((Node *) ((Aggref *) expr)->target);
SS_replace_correlation_vars((Node *) ((Aggref *) expr)->target);
else if (IsA(expr, ArrayRef)) else if (IsA(expr, ArrayRef))
{ {
((ArrayRef *) expr)->refupperindexpr = (List *) ((ArrayRef *) expr)->refupperindexpr = (List *)
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refupperindexpr); SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refupperindexpr);
((ArrayRef *) expr)->reflowerindexpr = (List *) ((ArrayRef *) expr)->reflowerindexpr = (List *)
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->reflowerindexpr); SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->reflowerindexpr);
((ArrayRef *) expr)->refexpr = ((ArrayRef *) expr)->refexpr = SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refexpr);
SS_replace_correlation_vars((Node *) ((ArrayRef *) expr)->refexpr); ((ArrayRef *) expr)->refassgnexpr = SS_replace_correlation_vars(((ArrayRef *) expr)->refassgnexpr);
((ArrayRef *) expr)->refassgnexpr =
SS_replace_correlation_vars(((ArrayRef *) expr)->refassgnexpr);
} }
else if (IsA(expr, TargetEntry)) else if (IsA(expr, TargetEntry))
((TargetEntry *) expr)->expr = ((TargetEntry *) expr)->expr = SS_replace_correlation_vars((Node *) ((TargetEntry *) expr)->expr);
SS_replace_correlation_vars((Node *) ((TargetEntry *) expr)->expr);
else if (IsA(expr, SubLink)) else if (IsA(expr, SubLink))
{ {
List *le; List *le;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.11 1998/10/04 03:30:56 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.12 1999/02/03 21:16:44 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -384,8 +384,7 @@ push_nots(Expr *qual)
0, NULL); 0, NULL);
op->op_fcache = (FunctionCache *) NULL; op->op_fcache = (FunctionCache *) NULL;
return return (make_opclause(op, get_leftop(qual), get_rightop(qual)));
(make_opclause(op, get_leftop(qual), get_rightop(qual)));
} }
else else
return make_notclause(qual); return make_notclause(qual);
@ -458,8 +457,7 @@ or_normalize(List *orlist)
if (new_orlist) if (new_orlist)
{ {
return return (or_normalize(lcons(distribute_args(lfirst(new_orlist),
(or_normalize(lcons(distribute_args(lfirst(new_orlist),
((Expr *) distributable)->args), ((Expr *) distributable)->args),
lnext(new_orlist)))); lnext(new_orlist))));
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.16 1998/09/01 04:29:57 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.17 1999/02/03 21:16:45 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -71,8 +71,7 @@ preprocess_targetlist(List *tlist,
* order of the attributes. We also need to fill in the missing * order of the attributes. We also need to fill in the missing
* attributes here. -ay 10/94 * attributes here. -ay 10/94
*/ */
expanded_tlist = expanded_tlist = expand_targetlist(tlist, relid, command_type, result_relation);
expand_targetlist(tlist, relid, command_type, result_relation);
/* XXX should the fix-opids be this early?? */ /* XXX should the fix-opids be this early?? */
/* was mapCAR */ /* was mapCAR */
@ -196,8 +195,7 @@ replace_matching_resname(List *new_tlist, List *old_tlist)
if (matching_old_tl) if (matching_old_tl)
{ {
matching_old_tl->resdom->resno = matching_old_tl->resdom->resno = new_tle->resdom->resno;
new_tle->resdom->resno;
t_list = lappend(t_list, matching_old_tl); t_list = lappend(t_list, matching_old_tl);
} }
else else
@ -307,8 +305,7 @@ new_relation_targetlist(Oid relid, Index rt_index, NodeTag node_type)
Var *temp_var = (Var *) NULL; Var *temp_var = (Var *) NULL;
TargetEntry *temp_list = NULL; TargetEntry *temp_list = NULL;
temp_var = temp_var = makeVar(rt_index, attno, atttype,
makeVar(rt_index, attno, atttype,
get_atttypmod(relid, attno), get_atttypmod(relid, attno),
0, rt_index, attno); 0, rt_index, attno);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.27 1998/09/01 04:29:59 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.28 1999/02/03 21:16:46 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -222,8 +222,7 @@ plan_inherit_queries(Query *parse, Index rt_index)
List *inheritrtable = NIL; List *inheritrtable = NIL;
List *union_relids = NIL; List *union_relids = NIL;
union_relids = union_relids = find_all_inheritors(lconsi(rt_entry->relid,
find_all_inheritors(lconsi(rt_entry->relid,
NIL), NIL),
NIL); NIL);
@ -442,8 +441,7 @@ fix_parsetree_attnums_nodes(Index rt_index,
if (var->varno == rt_index && var->varattno != 0) if (var->varno == rt_index && var->varattno != 0)
{ {
var->varattno = var->varattno = get_attnum(new_typeid,
get_attnum(new_typeid,
get_attname(old_typeid, var->varattno)); get_attname(old_typeid, var->varattno));
} }
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/clauseinfo.c,v 1.10 1999/02/03 20:15:39 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/clauseinfo.c,v 1.11 1999/02/03 21:16:50 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -183,8 +183,7 @@ get_opnos(List *restrictinfo_list)
foreach(i, restrictinfo_list) foreach(i, restrictinfo_list)
{ {
temp = (RestrictInfo *) lfirst(i); temp = (RestrictInfo *) lfirst(i);
result = result = lappendi(result,
lappendi(result,
(((Oper *) temp->clause->oper)->opno)); (((Oper *) temp->clause->oper)->opno));
} }
return result; return result;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.27 1999/01/24 00:28:21 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.28 1999/02/03 21:16:51 momjian Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
@ -83,8 +83,7 @@ make_clause(int type, Node *oper, List *args)
bool bool
is_opclause(Node *clause) is_opclause(Node *clause)
{ {
return return (clause != NULL &&
(clause != NULL &&
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == OP_EXPR); nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == OP_EXPR);
} }
@ -144,8 +143,7 @@ get_rightop(Expr *clause)
static bool static bool
agg_clause(Node *clause) agg_clause(Node *clause)
{ {
return return (clause != NULL && nodeTag(clause) == T_Aggref);
(clause != NULL && nodeTag(clause) == T_Aggref);
} }
/***************************************************************************** /*****************************************************************************
@ -161,8 +159,7 @@ agg_clause(Node *clause)
bool bool
is_funcclause(Node *clause) is_funcclause(Node *clause)
{ {
return return (clause != NULL &&
(clause != NULL &&
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == FUNC_EXPR); nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == FUNC_EXPR);
} }
@ -234,8 +231,7 @@ make_orclause(List *orclauses)
bool bool
not_clause(Node *clause) not_clause(Node *clause)
{ {
return return (clause != NULL &&
(clause != NULL &&
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == NOT_EXPR); nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == NOT_EXPR);
} }
@ -283,8 +279,7 @@ get_notclausearg(Expr *notclause)
bool bool
and_clause(Node *clause) and_clause(Node *clause)
{ {
return return (clause != NULL &&
(clause != NULL &&
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == AND_EXPR); nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == AND_EXPR);
} }
@ -321,8 +316,7 @@ make_andclause(List *andclauses)
bool bool
case_clause(Node *clause) case_clause(Node *clause)
{ {
return return (clause != NULL &&
(clause != NULL &&
nodeTag(clause) == T_CaseExpr); nodeTag(clause) == T_CaseExpr);
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.8 1998/09/21 02:25:21 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.9 1999/02/03 21:16:51 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -43,22 +43,19 @@ equal_path_path_ordering(PathOrder *path_ordering1,
else if (path_ordering1->ordtype == SORTOP_ORDER && else if (path_ordering1->ordtype == SORTOP_ORDER &&
path_ordering2->ordtype == SORTOP_ORDER) path_ordering2->ordtype == SORTOP_ORDER)
{ {
return return (equal_sortops_order(path_ordering1->ord.sortop,
(equal_sortops_order(path_ordering1->ord.sortop,
path_ordering2->ord.sortop)); path_ordering2->ord.sortop));
} }
else if (path_ordering1->ordtype == MERGE_ORDER && else if (path_ordering1->ordtype == MERGE_ORDER &&
path_ordering2->ordtype == SORTOP_ORDER) path_ordering2->ordtype == SORTOP_ORDER)
{ {
return (path_ordering2->ord.sortop && return (path_ordering2->ord.sortop &&
(path_ordering1->ord.merge->left_operator == (path_ordering1->ord.merge->left_operator == path_ordering2->ord.sortop[0]));
path_ordering2->ord.sortop[0]));
} }
else else
{ {
return (path_ordering1->ord.sortop && return (path_ordering1->ord.sortop &&
(path_ordering1->ord.sortop[0] == (path_ordering1->ord.sortop[0] == path_ordering2->ord.merge->left_operator));
path_ordering2->ord.merge->left_operator));
} }
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.15 1999/02/03 20:15:42 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.16 1999/02/03 21:16:52 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -212,8 +212,7 @@ create_seqscan_path(RelOptInfo * rel)
* copy restrictinfo list into path for expensive function processing -- * copy restrictinfo list into path for expensive function processing --
* JMH, 7/7/92 * JMH, 7/7/92
*/ */
pathnode->loc_restrictinfo = pathnode->loc_restrictinfo = (List *) copyObject((Node *) rel->restrictinfo);
(List *) copyObject((Node *) rel->restrictinfo);
if (rel->relids != NULL) if (rel->relids != NULL)
relid = lfirsti(rel->relids); relid = lfirsti(rel->relids);
@ -224,8 +223,7 @@ create_seqscan_path(RelOptInfo * rel)
#if 0 #if 0
if (XfuncMode != XFUNC_OFF) if (XfuncMode != XFUNC_OFF)
{ {
pathnode->path_cost += pathnode->path_cost += xfunc_get_path_cost(pathnode);
xfunc_get_path_cost(pathnode);
} }
#endif #endif
return pathnode; return pathnode;
@ -266,8 +264,7 @@ create_index_path(Query *root,
* copy restrictinfo list into path for expensive function processing -- * copy restrictinfo list into path for expensive function processing --
* JMH, 7/7/92 * JMH, 7/7/92
*/ */
pathnode->path.loc_restrictinfo = pathnode->path.loc_restrictinfo = set_difference((List *) copyObject((Node *) rel->restrictinfo),
set_difference((List *) copyObject((Node *) rel->restrictinfo),
(List *) restriction_clauses); (List *) restriction_clauses);
/* /*
@ -301,8 +298,7 @@ create_index_path(Query *root,
*/ */
/* is the statement above really true? what about IndexScan as the /* is the statement above really true? what about IndexScan as the
inner of a join? */ inner of a join? */
pathnode->path.path_cost = pathnode->path.path_cost = cost_index(lfirsti(index->relids),
cost_index(lfirsti(index->relids),
index->pages, index->pages,
1.0, 1.0,
rel->pages, rel->pages,
@ -314,8 +310,7 @@ create_index_path(Query *root,
#if 0 #if 0
if (XfuncMode != XFUNC_OFF) if (XfuncMode != XFUNC_OFF)
{ {
pathnode->path_cost = pathnode->path_cost = (pathnode->path_cost +
(pathnode->path_cost +
xfunc_get_path_cost((Path *) pathnode)); xfunc_get_path_cost((Path *) pathnode));
} }
#endif #endif
@ -366,8 +361,7 @@ create_index_path(Query *root,
/* add in expensive functions cost! -- JMH, 7/7/92 */ /* add in expensive functions cost! -- JMH, 7/7/92 */
if (XfuncMode != XFUNC_OFF) if (XfuncMode != XFUNC_OFF)
{ {
pathnode->path_cost += pathnode->path_cost += xfunc_get_path_cost((Path *) pathnode);
xfunc_get_path_cost((Path *) pathnode);
} }
#endif #endif
@ -418,17 +412,14 @@ create_nestloop_path(RelOptInfo * joinrel,
if (keys) if (keys)
{ {
pathnode->path.p_ordering.ordtype = pathnode->path.p_ordering.ordtype = outer_path->p_ordering.ordtype;
outer_path->p_ordering.ordtype;
if (outer_path->p_ordering.ordtype == SORTOP_ORDER) if (outer_path->p_ordering.ordtype == SORTOP_ORDER)
{ {
pathnode->path.p_ordering.ord.sortop = pathnode->path.p_ordering.ord.sortop = outer_path->p_ordering.ord.sortop;
outer_path->p_ordering.ord.sortop;
} }
else else
{ {
pathnode->path.p_ordering.ord.merge = pathnode->path.p_ordering.ord.merge = outer_path->p_ordering.ord.merge;
outer_path->p_ordering.ord.merge;
} }
} }
else else
@ -437,8 +428,7 @@ create_nestloop_path(RelOptInfo * joinrel,
pathnode->path.p_ordering.ord.sortop = NULL; pathnode->path.p_ordering.ord.sortop = NULL;
} }
pathnode->path.path_cost = pathnode->path.path_cost = cost_nestloop(outer_path->path_cost,
cost_nestloop(outer_path->path_cost,
inner_path->path_cost, inner_path->path_cost,
outer_rel->size, outer_rel->size,
inner_path->parent->size, inner_path->parent->size,
@ -500,8 +490,7 @@ create_mergejoin_path(RelOptInfo * joinrel,
pathnode->jpath.path.loc_restrictinfo = NIL; pathnode->jpath.path.loc_restrictinfo = NIL;
pathnode->outersortkeys = outersortkeys; pathnode->outersortkeys = outersortkeys;
pathnode->innersortkeys = innersortkeys; pathnode->innersortkeys = innersortkeys;
pathnode->jpath.path.path_cost = pathnode->jpath.path.path_cost = cost_mergejoin(outer_path->path_cost,
cost_mergejoin(outer_path->path_cost,
inner_path->path_cost, inner_path->path_cost,
outersortkeys, outersortkeys,
innersortkeys, innersortkeys,
@ -513,8 +502,7 @@ create_mergejoin_path(RelOptInfo * joinrel,
#if 0 #if 0
if (XfuncMode != XFUNC_OFF) if (XfuncMode != XFUNC_OFF)
{ {
pathnode->path_cost += pathnode->path_cost += xfunc_get_path_cost((Path *) pathnode);
xfunc_get_path_cost((Path *) pathnode);
} }
#endif #endif
return pathnode; return pathnode;
@ -569,8 +557,7 @@ create_hashjoin_path(RelOptInfo * joinrel,
pathnode->path_hashclauses = hashclauses; pathnode->path_hashclauses = hashclauses;
pathnode->outerhashkeys = outerkeys; pathnode->outerhashkeys = outerkeys;
pathnode->innerhashkeys = innerkeys; pathnode->innerhashkeys = innerkeys;
pathnode->jpath.path.path_cost = pathnode->jpath.path.path_cost = cost_hashjoin(outer_path->path_cost,
cost_hashjoin(outer_path->path_cost,
inner_path->path_cost, inner_path->path_cost,
outerkeys, outerkeys,
innerkeys, innerkeys,
@ -580,8 +567,7 @@ create_hashjoin_path(RelOptInfo * joinrel,
#if 0 #if 0
if (XfuncMode != XFUNC_OFF) if (XfuncMode != XFUNC_OFF)
{ {
pathnode->path_cost += pathnode->path_cost += xfunc_get_path_cost((Path *) pathnode);
xfunc_get_path_cost((Path *) pathnode);
} }
#endif #endif
return pathnode; return pathnode;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.23 1998/10/08 18:29:30 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.24 1999/02/03 21:16:52 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -219,8 +219,7 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info)
if (!HeapTupleIsValid(amopTuple)) if (!HeapTupleIsValid(amopTuple))
elog(ERROR, "index_info: no amop %d %d %d", elog(ERROR, "index_info: no amop %d %d %d",
relam, index->indclass[i], amstrategy); relam, index->indclass[i], amstrategy);
info->orderOprs[i] = info->orderOprs[i] = ((Form_pg_amop) GETSTRUCT(amopTuple))->amopopr;
((Form_pg_amop) GETSTRUCT(amopTuple))->amopopr;
} }
return TRUE; return TRUE;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.22 1999/01/24 00:28:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.23 1999/02/03 21:16:54 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -113,8 +113,7 @@ add_tl_element(RelOptInfo * rel, Var *var)
var->varno, var->varno,
var->varoattno); var->varoattno);
rel->targetlist = rel->targetlist = lappend(tlist,
lappend(tlist,
create_tl_element(newvar, create_tl_element(newvar,
length(tlist) + 1)); length(tlist) + 1));
@ -462,8 +461,7 @@ flatten_tlistentry(Node *tlistentry, List *flat_tlist)
} }
else if (IsA(tlistentry, Iter)) else if (IsA(tlistentry, Iter))
{ {
((Iter *) tlistentry)->iterexpr = ((Iter *) tlistentry)->iterexpr = flatten_tlistentry((Node *) ((Iter *) tlistentry)->iterexpr,
flatten_tlistentry((Node *) ((Iter *) tlistentry)->iterexpr,
flat_tlist); flat_tlist);
return tlistentry; return tlistentry;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.39 1999/01/24 00:28:29 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.40 1999/02/03 21:16:57 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -295,8 +295,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
foreach(llist, left_expr) foreach(llist, left_expr)
lfirst(llist) = transformExpr(pstate, lfirst(llist), precedence); lfirst(llist) = transformExpr(pstate, lfirst(llist), precedence);
if (length(left_expr) != if (length(left_expr) != length(right_expr))
length(right_expr))
elog(ERROR, "parser: Subselect has too many or too few fields."); elog(ERROR, "parser: Subselect has too many or too few fields.");
if (length(left_expr) > 1 && if (length(left_expr) > 1 &&
@ -520,8 +519,7 @@ transformIdent(ParseState *pstate, Node *expr, int precedence)
/* we add the relation name for them */ /* we add the relation name for them */
att->relname = rte->refname; att->relname = rte->refname;
att->attrs = lcons(makeString(ident->name), NIL); att->attrs = lcons(makeString(ident->name), NIL);
column_result = column_result = (Node *) ParseNestedFuncOrColumn(pstate, att, &pstate->p_last_resno,
(Node *) ParseNestedFuncOrColumn(pstate, att, &pstate->p_last_resno,
precedence); precedence);
} }
@ -731,8 +729,7 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int32 atttypmod)
break; break;
case FLOAT4OID: /* float4 */ case FLOAT4OID: /* float4 */
{ {
float32 floatVal = float32 floatVal = DatumGetFloat32(((Const *) expr)->constvalue);
DatumGetFloat32(((Const *) expr)->constvalue);
const_string = (char *) palloc(256); const_string = (char *) palloc(256);
string_palloced = true; string_palloced = true;
@ -741,8 +738,7 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int32 atttypmod)
} }
case FLOAT8OID: /* float8 */ case FLOAT8OID: /* float8 */
{ {
float64 floatVal = float64 floatVal = DatumGetFloat64(((Const *) expr)->constvalue);
DatumGetFloat64(((Const *) expr)->constvalue);
const_string = (char *) palloc(256); const_string = (char *) palloc(256);
string_palloced = true; string_palloced = true;
@ -756,13 +752,11 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int32 atttypmod)
(long) ((Const *) expr)->constvalue); (long) ((Const *) expr)->constvalue);
break; break;
case TEXTOID: /* text */ case TEXTOID: /* text */
const_string = const_string = DatumGetPointer(((Const *) expr)->constvalue);
DatumGetPointer(((Const *) expr)->constvalue);
const_string = (char *) textout((struct varlena *) const_string); const_string = (char *) textout((struct varlena *) const_string);
break; break;
case UNKNOWNOID: /* unknown */ case UNKNOWNOID: /* unknown */
const_string = const_string = DatumGetPointer(((Const *) expr)->constvalue);
DatumGetPointer(((Const *) expr)->constvalue);
const_string = (char *) textout((struct varlena *) const_string); const_string = (char *) textout((struct varlena *) const_string);
break; break;
default: default:

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.36 1998/12/23 14:38:40 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.37 1999/02/03 21:16:58 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -463,8 +463,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
*/ */
toid = typeTypeId(typenameType(relname)); toid = typeTypeId(typenameType(relname));
/* replace it in the arg list */ /* replace it in the arg list */
lfirst(fargs) = lfirst(fargs) = makeVar(vnum, 0, toid, -1, 0, vnum, 0);
makeVar(vnum, 0, toid, -1, 0, vnum, 0);
} }
else if (!attisset) else if (!attisset)
{ /* set functions don't have parameters */ { /* set functions don't have parameters */
@ -554,8 +553,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
{ {
if (!strcmp(funcname, "*")) if (!strcmp(funcname, "*"))
{ {
funcnode->func_tlist = funcnode->func_tlist = expandAll(pstate, relname, refname, curr_resno);
expandAll(pstate, relname, refname, curr_resno);
} }
else else
{ {
@ -697,8 +695,7 @@ func_get_candidates(char *funcname, int nargs)
palloc(8 * sizeof(Oid)); palloc(8 * sizeof(Oid));
MemSet(current_candidate->args, 0, 8 * sizeof(Oid)); MemSet(current_candidate->args, 0, 8 * sizeof(Oid));
for (i = 0; i < nargs; i++) for (i = 0; i < nargs; i++)
current_candidate->args[i] = current_candidate->args[i] = pgProcP->proargtypes[i];
pgProcP->proargtypes[i];
current_candidate->next = candidates; current_candidate->next = candidates;
candidates = current_candidate; candidates = current_candidate;
@ -1003,8 +1000,7 @@ func_get_detail(char *funcname,
} }
current_input_typeids = *input_typeid_vector++; current_input_typeids = *input_typeid_vector++;
} }
while (current_input_typeids != while (current_input_typeids != InvalidOid && ncandidates == 0);
InvalidOid && ncandidates == 0);
} }
} }
@ -1292,8 +1288,7 @@ make_arguments(ParseState *pstate,
*/ */
if (input_typeids[i] == UNKNOWNOID && function_typeids[i] != InvalidOid) if (input_typeids[i] == UNKNOWNOID && function_typeids[i] != InvalidOid)
{ {
lfirst(current_fargs) = lfirst(current_fargs) = parser_typecast2(lfirst(current_fargs),
parser_typecast2(lfirst(current_fargs),
input_typeids[i], input_typeids[i],
typeidType(function_typeids[i]), typeidType(function_typeids[i]),
-1); -1);
@ -1420,8 +1415,7 @@ ParseComplexProjection(ParseState *pstate,
} }
if (RelationIsValid(rd)) if (RelationIsValid(rd))
{ {
func->func_tlist = func->func_tlist = setup_tlist(funcname, argrelid);
setup_tlist(funcname, argrelid);
iter->itertype = attnumTypeId(rd, attnum); iter->itertype = attnumTypeId(rd, attnum);
return (Node *) iter; return (Node *) iter;
} }
@ -1480,8 +1474,7 @@ ParseComplexProjection(ParseState *pstate,
{ {
Expr *newexpr; Expr *newexpr;
funcnode->func_tlist = funcnode->func_tlist = setup_tlist(funcname, argrelid);
setup_tlist(funcname, argrelid);
funcnode->functype = attnumTypeId(rd, attnum); funcnode->functype = attnumTypeId(rd, attnum);
newexpr = makeNode(Expr); newexpr = makeNode(Expr);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.33 1999/01/24 00:28:30 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.34 1999/02/03 21:16:59 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -612,8 +612,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
p_target = tail_p_target = expandAll(pstate, att->relname, p_target = tail_p_target = expandAll(pstate, att->relname,
att->relname, &pstate->p_last_resno); att->relname, &pstate->p_last_resno);
else else
lnext(tail_p_target) = lnext(tail_p_target) = expandAll(pstate, att->relname, att->relname,
expandAll(pstate, att->relname, att->relname,
&pstate->p_last_resno); &pstate->p_last_resno);
expand_star = true; expand_star = true;
} }

View File

@ -73,7 +73,7 @@ typedef unsigned long long ulong_long;
* causing nast effects. * causing nast effects.
**************************************************************/ **************************************************************/
/*static char _id[] = "$Id: snprintf.c,v 1.18 1999/01/17 21:44:46 tgl Exp $";*/ /*static char _id[] = "$Id: snprintf.c,v 1.19 1999/02/03 21:17:00 momjian Exp $";*/
static char *end; static char *end;
static int SnprfOverflow; static int SnprfOverflow;
@ -380,8 +380,7 @@ int base,
} }
do do
{ {
convert[place++] = convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
(caps ? "0123456789ABCDEF" : "0123456789abcdef")
[uvalue % (unsigned) base]; [uvalue % (unsigned) base];
uvalue = (uvalue / (unsigned) base); uvalue = (uvalue / (unsigned) base);
} while (uvalue); } while (uvalue);

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.33 1999/02/02 03:44:45 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.34 1999/02/03 21:17:04 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -2492,11 +2492,9 @@ RewriteQuery(Query *parsetree, bool *instead_flag, List **qual_products)
if (rt_entry_locks != NULL) if (rt_entry_locks != NULL)
{ {
List *locks = List *locks = matchLocks(event, rt_entry_locks, result_relation, parsetree);
matchLocks(event, rt_entry_locks, result_relation, parsetree);
product_queries = product_queries = fireRules(parsetree,
fireRules(parsetree,
result_relation, result_relation,
event, event,
instead_flag, instead_flag,

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.26 1999/01/25 18:02:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.27 1999/02/03 21:17:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -503,8 +503,7 @@ AddQual(Query *parsetree, Node *qual)
if (old == NULL) if (old == NULL)
parsetree->qual = copy; parsetree->qual = copy;
else else
parsetree->qual = parsetree->qual = (Node *) make_andclause(makeList(parsetree->qual, copy, -1));
(Node *) make_andclause(makeList(parsetree->qual, copy, -1));
} }
/* Adds the given havingQual to the one already contained in the parsetree just as /* Adds the given havingQual to the one already contained in the parsetree just as
@ -526,8 +525,7 @@ AddHavingQual(Query *parsetree, Node *havingQual)
if (old == NULL) if (old == NULL)
parsetree->havingQual = copy; parsetree->havingQual = copy;
else else
parsetree->havingQual = parsetree->havingQual = (Node *) make_andclause(makeList(parsetree->havingQual, copy, -1));
(Node *) make_andclause(makeList(parsetree->havingQual, copy, -1));
} }
void void

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.30 1998/12/15 12:46:18 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.31 1999/02/03 21:17:08 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -203,8 +203,7 @@ prs2_addToRelation(Oid relid,
numlock = rulelock->numLocks; numlock = rulelock->numLocks;
/* expand, for safety reasons */ /* expand, for safety reasons */
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt); oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
rulelock->rules = rulelock->rules = (RewriteRule **) repalloc(rulelock->rules,
(RewriteRule **) repalloc(rulelock->rules,
sizeof(RewriteRule *) * (numlock + 1)); sizeof(RewriteRule *) * (numlock + 1));
MemoryContextSwitchTo(oldcxt); MemoryContextSwitchTo(oldcxt);
rulelock->rules[numlock] = thisRule; rulelock->rules[numlock] = thisRule;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.46 1999/02/02 03:44:46 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.47 1999/02/03 21:17:09 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1373,8 +1373,7 @@ BufferReplace(BufferDesc *bufHdr, bool bufferLockHeld)
BlockNumber BlockNumber
RelationGetNumberOfBlocks(Relation relation) RelationGetNumberOfBlocks(Relation relation)
{ {
return return ((relation->rd_myxactonly) ? relation->rd_nblocks :
((relation->rd_myxactonly) ? relation->rd_nblocks :
smgrnblocks(DEFAULT_SMGR, relation)); smgrnblocks(DEFAULT_SMGR, relation));
} }

View File

@ -15,7 +15,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.19 1998/08/19 02:02:37 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.20 1999/02/03 21:17:12 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -245,8 +245,7 @@ InitLocalBuffer(void)
buf->buf_id = -i - 2; buf->buf_id = -i - 2;
} }
LocalRefCount = LocalRefCount = (long *) malloc(sizeof(long) * NLocBuffer);
(long *) malloc(sizeof(long) * NLocBuffer);
MemSet(LocalRefCount, 0, sizeof(long) * NLocBuffer); MemSet(LocalRefCount, 0, sizeof(long) * NLocBuffer);
} }

View File

@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Id: fd.c,v 1.35 1998/10/26 01:00:13 tgl Exp $ * $Id: fd.c,v 1.36 1999/02/03 21:17:14 momjian Exp $
* *
* NOTES: * NOTES:
* *
@ -235,10 +235,8 @@ Delete(File file)
fileP = &VfdCache[file]; fileP = &VfdCache[file];
VfdCache[fileP->lruLessRecently].lruMoreRecently = VfdCache[fileP->lruLessRecently].lruMoreRecently = VfdCache[file].lruMoreRecently;
VfdCache[file].lruMoreRecently; VfdCache[fileP->lruMoreRecently].lruLessRecently = VfdCache[file].lruLessRecently;
VfdCache[fileP->lruMoreRecently].lruLessRecently =
VfdCache[file].lruLessRecently;
DO_DB(_dump_lru()); DO_DB(_dump_lru());
} }
@ -347,8 +345,7 @@ tryAgain:
/* seek to the right position */ /* seek to the right position */
if (vfdP->seekPos != 0L) if (vfdP->seekPos != 0L)
{ {
returnValue = returnValue = lseek(vfdP->fd, vfdP->seekPos, SEEK_SET);
lseek(vfdP->fd, vfdP->seekPos, SEEK_SET);
Assert(returnValue != -1); Assert(returnValue != -1);
} }
@ -751,8 +748,7 @@ FileSeek(File file, long offset, int whence)
return VfdCache[file].seekPos; return VfdCache[file].seekPos;
case SEEK_END: case SEEK_END:
FileAccess(file); FileAccess(file);
returnCode = VfdCache[file].seekPos = returnCode = VfdCache[file].seekPos = lseek(VfdCache[file].fd, offset, whence);
lseek(VfdCache[file].fd, offset, whence);
return returnCode; return returnCode;
default: default:
elog(ERROR, "FileSeek: invalid whence: %d", whence); elog(ERROR, "FileSeek: invalid whence: %d", whence);
@ -761,8 +757,7 @@ FileSeek(File file, long offset, int whence)
} }
else else
{ {
returnCode = VfdCache[file].seekPos = returnCode = VfdCache[file].seekPos = lseek(VfdCache[file].fd, offset, whence);
lseek(VfdCache[file].fd, offset, whence);
return returnCode; return returnCode;
} }
/* NOTREACHED */ /* NOTREACHED */

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.34 1998/12/18 09:10:34 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.35 1999/02/03 21:17:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -189,8 +189,7 @@ InitShmem(unsigned int key, unsigned int size)
/* next is ShmemVariableCache */ /* next is ShmemVariableCache */
ShmemVariableCache = (VariableCache) (ShmemIndexOffset + 1); ShmemVariableCache = (VariableCache) (ShmemIndexOffset + 1);
currFreeSpace += currFreeSpace += sizeof(ShmemFreeStart) + sizeof(ShmemIndexOffset) +
sizeof(ShmemFreeStart) + sizeof(ShmemIndexOffset) +
LONGALIGN(sizeof(VariableCacheData)); LONGALIGN(sizeof(VariableCacheData));
/* /*
@ -360,8 +359,7 @@ ShmemInitHash(char *name, /* table string name for shmem index */
hash_flags |= HASH_SHARED_MEM; hash_flags |= HASH_SHARED_MEM;
/* look it up in the shmem index */ /* look it up in the shmem index */
location = location = ShmemInitStruct(name, my_log2(max_size) + sizeof(HHDR), &found);
ShmemInitStruct(name, my_log2(max_size) + sizeof(HHDR), &found);
/* /*
* shmem index is corrupted. Let someone else give the error * shmem index is corrupted. Let someone else give the error

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.46 1999/02/02 03:44:50 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.47 1999/02/03 21:17:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -192,8 +192,7 @@ inv_create(int flags)
retval->iscan = (IndexScanDesc) NULL; retval->iscan = (IndexScanDesc) NULL;
retval->hdesc = RelationGetDescr(r); retval->hdesc = RelationGetDescr(r);
retval->idesc = RelationGetDescr(indr); retval->idesc = RelationGetDescr(indr);
retval->offset = retval->lowbyte = retval->offset = retval->lowbyte = retval->highbyte = 0;
retval->highbyte = 0;
ItemPointerSetInvalid(&(retval->htid)); ItemPointerSetInvalid(&(retval->htid));
if (flags & INV_WRITE) if (flags & INV_WRITE)
@ -631,8 +630,7 @@ inv_fetchtup(LargeObjectDesc *obj_desc, HeapTuple tuple, Buffer *buffer)
*/ */
ScanKeyEntryInitialize(&skey, 0x0, 1, F_INT4GE, ScanKeyEntryInitialize(&skey, 0x0, 1, F_INT4GE,
Int32GetDatum(obj_desc->offset)); Int32GetDatum(obj_desc->offset));
obj_desc->iscan = obj_desc->iscan = index_beginscan(obj_desc->index_r,
index_beginscan(obj_desc->index_r,
(bool) 0, (uint16) 1, (bool) 0, (uint16) 1,
&skey); &skey);
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.31 1998/09/01 04:32:23 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.32 1999/02/03 21:17:24 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -445,16 +445,13 @@ aclinsert3(Acl *old_acl, AclItem *mod_aip, unsigned modechg)
switch (modechg) switch (modechg)
{ {
case ACL_MODECHG_ADD: case ACL_MODECHG_ADD:
new_aip[dst].ai_mode = new_aip[dst].ai_mode = old_aip[src].ai_mode | mod_aip->ai_mode;
old_aip[src].ai_mode | mod_aip->ai_mode;
break; break;
case ACL_MODECHG_DEL: case ACL_MODECHG_DEL:
new_aip[dst].ai_mode = new_aip[dst].ai_mode = old_aip[src].ai_mode & ~mod_aip->ai_mode;
old_aip[src].ai_mode & ~mod_aip->ai_mode;
break; break;
case ACL_MODECHG_EQL: case ACL_MODECHG_EQL:
new_aip[dst].ai_mode = new_aip[dst].ai_mode = mod_aip->ai_mode;
mod_aip->ai_mode;
break; break;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.36 1999/01/17 21:12:55 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.37 1999/02/03 21:17:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -196,8 +196,7 @@ array_in(char *string, /* input array in external form */
if (*p == '{') if (*p == '{')
{ {
/* array not a large object */ /* array not a large object */
dataPtr = dataPtr = (char *) _ReadArrayStr(p, nitems, ndim, dim, &inputproc, typelem,
(char *) _ReadArrayStr(p, nitems, ndim, dim, &inputproc, typelem,
typmod, typdelim, typlen, typbyval, typalign, typmod, typdelim, typlen, typbyval, typalign,
&nbytes); &nbytes);
nbytes += ARR_OVERHEAD(ndim); nbytes += ARR_OVERHEAD(ndim);

View File

@ -16,7 +16,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$Id: inet_net_pton.c,v 1.6 1998/10/22 13:16:26 momjian Exp $"; static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7 1999/02/03 21:17:27 momjian Exp $";
#endif #endif
@ -113,6 +113,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size)
if (size <= 0) if (size <= 0)
goto emsgsize; goto emsgsize;
dirty = 0; dirty = 0;
tmp = 0;
src++; /* skip x or X. */ src++; /* skip x or X. */
while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) { while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) {
if (isupper(ch)) if (isupper(ch))

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.20 1998/09/01 04:32:46 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.21 1999/02/03 21:17:28 momjian Exp $
* *
* Alistair Crooks added the code for the regex caching * Alistair Crooks added the code for the regex caching
* agc - cached the regular expressions used - there's a good chance * agc - cached the regular expressions used - there's a good chance
@ -108,8 +108,7 @@ RE_compile_and_execute(struct varlena * text_re, char *text, int cflags)
{ {
for (lru = i = 0; i < rec; i++) for (lru = i = 0; i < rec; i++)
{ {
rev[i].cre_lru = rev[i].cre_lru = (rev[i].cre_lru - rev[oldest].cre_lru) / 2;
(rev[i].cre_lru - rev[oldest].cre_lru) / 2;
if (rev[i].cre_lru > lru) if (rev[i].cre_lru > lru)
lru = rev[i].cre_lru; lru = rev[i].cre_lru;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.37 1999/02/02 03:44:58 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.38 1999/02/03 21:17:30 momjian Exp $
* *
* Notes: * Notes:
* XXX This needs to use exception.h to handle recovery when * XXX This needs to use exception.h to handle recovery when
@ -210,8 +210,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
else else
cache->cc_klen[i] = tupdesc->attrs[cache->cc_key[i] - 1]->attlen; cache->cc_klen[i] = tupdesc->attrs[cache->cc_key[i] - 1]->attlen;
cache->cc_skey[i].sk_procedure = cache->cc_skey[i].sk_procedure = EQPROC(tupdesc->attrs[cache->cc_key[i] - 1]->atttypid);
EQPROC(tupdesc->attrs[cache->cc_key[i] - 1]->atttypid);
fmgr_info(cache->cc_skey[i].sk_procedure, fmgr_info(cache->cc_skey[i].sk_procedure,
&cache->cc_skey[i].sk_func); &cache->cc_skey[i].sk_func);
@ -429,8 +428,7 @@ CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP,
break; break;
} }
return return CatalogCacheComputeHashIndex(cacheInOutP);
CatalogCacheComputeHashIndex(cacheInOutP);
} }
/* -------------------------------- /* --------------------------------

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.19 1998/11/27 19:52:27 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.20 1999/02/03 21:17:31 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -219,8 +219,7 @@ init_fcache(Oid foid,
int i; int i;
List *oneArg; List *oneArg;
retval->argOidVect = retval->argOidVect = (Oid *) palloc(retval->nargs * sizeof(Oid));
(Oid *) palloc(retval->nargs * sizeof(Oid));
argTypes = procedureStruct->proargtypes; argTypes = procedureStruct->proargtypes;
memmove(retval->argOidVect, memmove(retval->argOidVect,
argTypes, argTypes,

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.19 1999/02/02 03:45:01 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.20 1999/02/03 21:17:32 momjian Exp $
* *
* Note - this code is real crufty... * Note - this code is real crufty...
* *
@ -117,7 +117,7 @@ LocalInvalidRegister(LocalInvalid invalid,
Assert(PointerIsValid(entry)); Assert(PointerIsValid(entry));
((InvalidationUserData *) entry)->dataP[-1] = ((InvalidationUserData *) entry)->dataP[-1] =
(InvalidationUserData *) invalid; (InvalidationUserData *) invalid;
return entry; return entry;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.22 1998/09/01 04:33:01 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.23 1999/02/03 21:17:33 momjian Exp $
* *
* NOTES * NOTES
* Eventually, the index information should go through here, too. * Eventually, the index information should go through here, too.
@ -477,8 +477,7 @@ get_typalign(Oid typid)
struct varlena * struct varlena *
get_typdefault(Oid typid) get_typdefault(Oid typid)
{ {
struct varlena *typdefault = struct varlena *typdefault = (struct varlena *) TypeDefaultRetrieve(typid);
(struct varlena *) TypeDefaultRetrieve(typid);
return typdefault; return typdefault;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.56 1999/02/02 03:45:02 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.57 1999/02/03 21:17:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -713,25 +713,20 @@ RelationBuildRuleLock(Relation relation)
rule->ruleId = pg_rewrite_tuple->t_data->t_oid; rule->ruleId = pg_rewrite_tuple->t_data->t_oid;
rule->event = rule->event = (int) heap_getattr(pg_rewrite_tuple,
(int) heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_ev_type, pg_rewrite_tupdesc, Anum_pg_rewrite_ev_type, pg_rewrite_tupdesc,
&isnull) - 48; &isnull) - 48;
rule->attrno = rule->attrno = (int) heap_getattr(pg_rewrite_tuple,
(int) heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_ev_attr, pg_rewrite_tupdesc, Anum_pg_rewrite_ev_attr, pg_rewrite_tupdesc,
&isnull); &isnull);
rule->isInstead = rule->isInstead = !!heap_getattr(pg_rewrite_tuple,
!!heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc, Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc,
&isnull); &isnull);
ruleaction = ruleaction = heap_getattr(pg_rewrite_tuple,
heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc, Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc,
&isnull); &isnull);
rule_evqual_string = rule_evqual_string = heap_getattr(pg_rewrite_tuple,
heap_getattr(pg_rewrite_tuple,
Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc, Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc,
&isnull); &isnull);
@ -745,8 +740,7 @@ RelationBuildRuleLock(Relation relation)
if (numlocks == maxlocks) if (numlocks == maxlocks)
{ {
maxlocks *= 2; maxlocks *= 2;
rules = rules = (RewriteRule **) repalloc(rules, sizeof(RewriteRule *) * maxlocks);
(RewriteRule **) repalloc(rules, sizeof(RewriteRule *) * maxlocks);
} }
} }
@ -1035,8 +1029,7 @@ formrdesc(char *relationName,
if (IsSystemRelationName(relationName)) if (IsSystemRelationName(relationName))
{ {
relation->rd_rel->relowner = 6; /* XXX use sym const */ relation->rd_rel->relowner = 6; /* XXX use sym const */
relation->rd_rel->relisshared = relation->rd_rel->relisshared = IsSharedSystemRelationName(relationName);
IsSharedSystemRelationName(relationName);
} }
else else
{ {
@ -1056,8 +1049,7 @@ formrdesc(char *relationName,
*/ */
for (i = 0; i < natts; i++) for (i = 0; i < natts; i++)
{ {
relation->rd_att->attrs[i] = relation->rd_att->attrs[i] = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
(Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
MemSet((char *) relation->rd_att->attrs[i], 0, MemSet((char *) relation->rd_att->attrs[i], 0,
ATTRIBUTE_TUPLE_SIZE); ATTRIBUTE_TUPLE_SIZE);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.22 1998/09/01 04:33:03 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.23 1999/02/03 21:17:35 momjian Exp $
* *
* NOTES * NOTES
* These routines allow the parser/planner/executor to perform * These routines allow the parser/planner/executor to perform
@ -420,8 +420,7 @@ InitCatalogCache()
Assert(!PointerIsValid((Pointer) SysCache[cacheId])); Assert(!PointerIsValid((Pointer) SysCache[cacheId]));
SysCache[cacheId] = SysCache[cacheId] = InitSysCache(cacheinfo[cacheId].name,
InitSysCache(cacheinfo[cacheId].name,
cacheinfo[cacheId].indname, cacheinfo[cacheId].indname,
cacheId, cacheId,
cacheinfo[cacheId].nkeys, cacheinfo[cacheId].nkeys,
@ -492,8 +491,7 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
if (!PointerIsValid(SysCache[cacheId])) if (!PointerIsValid(SysCache[cacheId]))
{ {
SysCache[cacheId] = SysCache[cacheId] = InitSysCache(cacheinfo[cacheId].name,
InitSysCache(cacheinfo[cacheId].name,
cacheinfo[cacheId].indname, cacheinfo[cacheId].indname,
cacheId, cacheId,
cacheinfo[cacheId].nkeys, cacheinfo[cacheId].nkeys,
@ -604,10 +602,8 @@ SearchSysCacheGetAttribute(int cacheId,
else if (attributeNumber > 0 && else if (attributeNumber > 0 &&
attributeNumber <= relation->rd_rel->relnatts) attributeNumber <= relation->rd_rel->relnatts)
{ {
attributeLength = attributeLength = relation->rd_att->attrs[attributeNumber - 1]->attlen;
relation->rd_att->attrs[attributeNumber - 1]->attlen; attributeByValue = relation->rd_att->attrs[attributeNumber - 1]->attbyval;
attributeByValue =
relation->rd_att->attrs[attributeNumber - 1]->attbyval;
} }
else else
{ {

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.20 1998/09/01 04:33:10 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.21 1999/02/03 21:17:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -190,8 +190,7 @@ fmgr_info(Oid procedureId, FmgrInfo *finfo)
switch (language) switch (language)
{ {
case INTERNALlanguageId: case INTERNALlanguageId:
finfo->fn_addr = finfo->fn_addr = fmgr_lookupByName(procedureStruct->proname.data);
fmgr_lookupByName(procedureStruct->proname.data);
if (!finfo->fn_addr) if (!finfo->fn_addr)
elog(ERROR, "fmgr_info: function %s: not in internal table", elog(ERROR, "fmgr_info: function %s: not in internal table",
procedureStruct->proname.data); procedureStruct->proname.data);
@ -342,8 +341,7 @@ fmgr_array_args(Oid procedureId, int nargs, char *args[], bool *isNull)
finfo.fn_nargs = nargs; finfo.fn_nargs = nargs;
/* XXX see WAY_COOL_ORTHOGONAL_FUNCTIONS */ /* XXX see WAY_COOL_ORTHOGONAL_FUNCTIONS */
return return (fmgr_c(&finfo,
(fmgr_c(&finfo,
(FmgrValues *) args, (FmgrValues *) args,
isNull)); isNull));
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.16 1998/09/01 04:33:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.17 1999/02/03 21:17:38 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -329,8 +329,7 @@ init_htab(HTAB *hashp, int nelem)
/* allocate a directory */ /* allocate a directory */
if (!(hashp->dir)) if (!(hashp->dir))
{ {
hashp->dir = hashp->dir = (SEG_OFFSET *) hashp->alloc(hctl->dsize * sizeof(SEG_OFFSET));
(SEG_OFFSET *) hashp->alloc(hctl->dsize * sizeof(SEG_OFFSET));
if (!hashp->dir) if (!hashp->dir)
return -1; return -1;
} }
@ -850,8 +849,7 @@ bucket_alloc(HTAB *hashp)
BUCKET_INDEX tmpIndex, BUCKET_INDEX tmpIndex,
lastIndex; lastIndex;
bucketSize = bucketSize = sizeof(BUCKET_INDEX) + hashp->hctl->keysize + hashp->hctl->datasize;
sizeof(BUCKET_INDEX) + hashp->hctl->keysize + hashp->hctl->datasize;
/* make sure its aligned correctly */ /* make sure its aligned correctly */
bucketSize += sizeof(long *) - (bucketSize % sizeof(long *)); bucketSize += sizeof(long *) - (bucketSize % sizeof(long *));

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.15 1999/01/01 04:48:47 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.16 1999/02/03 21:17:40 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -883,8 +883,7 @@ StartPortalAllocMode(AllocMode mode, Size limit)
FixedStackPush(&context->stackData, context->block); FixedStackPush(&context->stackData, context->block);
/* allocate and initialize new block */ /* allocate and initialize new block */
context->block = context->block = MemoryContextAlloc(
MemoryContextAlloc(
(MemoryContext) PortalHeapMemoryGetVariableMemory(context), (MemoryContext) PortalHeapMemoryGetVariableMemory(context),
sizeof(HeapMemoryBlockData)); sizeof(HeapMemoryBlockData));

View File

@ -4,7 +4,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: psort.c,v 1.48 1999/02/02 03:45:12 momjian Exp $ * $Id: psort.c,v 1.49 1999/02/03 21:17:42 momjian Exp $
* *
* NOTES * NOTES
* Sorts the first relation into the second relation. * Sorts the first relation into the second relation.
@ -134,8 +134,7 @@ psort_begin(Sort *node, int nkeys, ScanKey key)
PS(node)->BytesRead = 0; PS(node)->BytesRead = 0;
PS(node)->BytesWritten = 0; PS(node)->BytesWritten = 0;
PS(node)->treeContext.tupDesc = PS(node)->treeContext.tupDesc = ExecGetTupType(outerPlan((Plan *) node));
ExecGetTupType(outerPlan((Plan *) node));
PS(node)->treeContext.nKeys = nkeys; PS(node)->treeContext.nKeys = nkeys;
PS(node)->treeContext.scanKeys = key; PS(node)->treeContext.scanKeys = key;
PS(node)->treeContext.sortMem = SortMem * 1024; PS(node)->treeContext.sortMem = SortMem * 1024;
@ -336,8 +335,7 @@ initialrun(Sort *node)
for (tp = PS(node)->Tape; for (tp = PS(node)->Tape;
tp - PS(node)->Tape < PS(node)->TapeRange; tp++) tp - PS(node)->Tape < PS(node)->TapeRange; tp++)
{ {
PS(node)->TotalDummy += PS(node)->TotalDummy += (tp->tp_dummy = baseruns
(tp->tp_dummy = baseruns
+ (tp + 1)->tp_fib + (tp + 1)->tp_fib
- tp->tp_fib); - tp->tp_fib);
tp->tp_fib = baseruns tp->tp_fib = baseruns
@ -945,10 +943,8 @@ psort_end(Sort *node)
else if (PS(node)->memtuples) else if (PS(node)->memtuples)
pfree(PS(node)->memtuples); pfree(PS(node)->memtuples);
NDirectFileRead += NDirectFileRead += (int) ceil((double) PS(node)->BytesRead / BLCKSZ);
(int) ceil((double) PS(node)->BytesRead / BLCKSZ); NDirectFileWrite += (int) ceil((double) PS(node)->BytesWritten / BLCKSZ);
NDirectFileWrite +=
(int) ceil((double) PS(node)->BytesWritten / BLCKSZ);
pfree((void *) node->psortstate); pfree((void *) node->psortstate);
node->psortstate = NULL; node->psortstate = NULL;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.167 1999/01/27 01:18:21 scrappy Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.168 1999/02/03 21:17:44 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -2422,8 +2422,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
{ {
if (pset->prompt) if (pset->prompt)
free(pset->prompt); free(pset->prompt);
pset->prompt = pset->prompt = malloc(strlen(PQdb(pset->db)) + strlen(PROMPT) + 1);
malloc(strlen(PQdb(pset->db)) + strlen(PROMPT) + 1);
if (pset->quiet) if (pset->quiet)
pset->prompt[0] = '\0'; pset->prompt[0] = '\0';
else else

View File

@ -71,8 +71,7 @@ void
ECPGmake_struct_member(char *name, struct ECPGtype * type, struct ECPGstruct_member ** start) ECPGmake_struct_member(char *name, struct ECPGtype * type, struct ECPGstruct_member ** start)
{ {
struct ECPGstruct_member *ptr, struct ECPGstruct_member *ptr,
*ne = *ne = (struct ECPGstruct_member *) mm_alloc(sizeof(struct ECPGstruct_member));
(struct ECPGstruct_member *) mm_alloc(sizeof(struct ECPGstruct_member));
ne->name = strdup(name); ne->name = strdup(name);
ne->typ = type; ne->typ = type;

View File

@ -9,7 +9,7 @@
* didn't really belong there. * didn't really belong there.
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.16 1999/01/27 01:18:23 scrappy Exp $ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.17 1999/02/03 21:17:50 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -130,8 +130,7 @@ PQprint(FILE *fout,
for (j = 0; j < nFields; j++) for (j = 0; j < nFields; j++)
{ {
int len; int len;
char *s = char *s = (j < numFieldName && po->fieldName[j][0]) ?
(j < numFieldName && po->fieldName[j][0]) ?
po->fieldName[j] : PQfname(res, j); po->fieldName[j] : PQfname(res, j);
fieldNames[j] = s; fieldNames[j] = s;
@ -175,8 +174,7 @@ PQprint(FILE *fout,
nTups * (nFields + 1) >= screen_size.ws_row) || nTups * (nFields + 1) >= screen_size.ws_row) ||
(!po->expanded && (!po->expanded &&
nTups * (total_line_length / screen_size.ws_col + 1) * nTups * (total_line_length / screen_size.ws_col + 1) *
(1 + (po->standard != 0)) >= (1 + (po->standard != 0)) >= screen_size.ws_row -
screen_size.ws_row -
(po->header != 0) * (po->header != 0) *
(total_line_length / screen_size.ws_col + 1) * 2 (total_line_length / screen_size.ws_col + 1) * 2
- (po->header != 0) * 2 /* row count and newline */ - (po->header != 0) * 2 /* row count and newline */

View File

@ -113,8 +113,7 @@ LPSETUPDLG lpsetupdlg;
lpsetupdlg->hwndParent = hwnd; lpsetupdlg->hwndParent = hwnd;
lpsetupdlg->lpszDrvr = lpszDriver; lpsetupdlg->lpszDrvr = lpszDriver;
lpsetupdlg->fNewDSN = (ODBC_ADD_DSN == fRequest); lpsetupdlg->fNewDSN = (ODBC_ADD_DSN == fRequest);
lpsetupdlg->fDefault = lpsetupdlg->fDefault = !lstrcmpi(lpsetupdlg->ci.dsn, INI_DSN);
!lstrcmpi(lpsetupdlg->ci.dsn, INI_DSN);
// Display the appropriate dialog (if parent window handle supplied) // Display the appropriate dialog (if parent window handle supplied)
if (hwnd) { if (hwnd) {

View File

@ -3,7 +3,7 @@
* procedural language * procedural language
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.6 1999/01/27 16:15:22 wieck Exp $ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.7 1999/02/03 21:17:58 momjian Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
@ -2540,8 +2540,7 @@ exec_simple_check_plan(PLpgSQL_expr * expr)
((Param *)(tle->expr))->paramtype; ((Param *)(tle->expr))->paramtype;
break; break;
case T_Const: expr->plan_simple_type = case T_Const: expr->plan_simple_type = ((Const *)(tle->expr))->consttype;
((Const *)(tle->expr))->consttype;
break; break;
default: expr->plan_simple_type = InvalidOid; default: expr->plan_simple_type = InvalidOid;

Some files were not shown because too many files have changed in this diff Show More