Commit 52f77df6 authored by Bruce Momjian's avatar Bruce Momjian

Ye-old pgindent run. Same 4-space tabs.

parent db451872
......@@ -34,6 +34,7 @@ int32 array_all_int4le(ArrayType *array, int4 value);
int32 array_oideq(ArrayType *array, Oid value);
int32 array_all_oidne(ArrayType *array, Oid value);
#endif
/*
......
This diff is collapsed.
......@@ -52,22 +52,22 @@ struct varbita
#define BITHIGH 0x80
bits8 * zpbitin(char *s, int dummy, int32 atttypmod);
char * zpbitout(bits8 *s);
char * zpbitsout(bits8 *s);
bits8 * varbitin(char *s, int dummy, int32 atttypmod);
bool biteq (bits8 *arg1, bits8 *arg2);
bool bitne (bits8 *arg1, bits8 *arg2);
bool bitge (bits8 *arg1, bits8 *arg2);
bool bitgt (bits8 *arg1, bits8 *arg2);
bool bitle (bits8 *arg1, bits8 *arg2);
bool bitlt (bits8 *arg1, bits8 *arg2);
int bitcmp (bits8 *arg1, bits8 *arg2);
bits8 * bitand (bits8 * arg1, bits8 * arg2);
bits8 * bitor (bits8 * arg1, bits8 * arg2);
bits8 * bitxor (bits8 * arg1, bits8 * arg2);
bits8 * bitnot (bits8 * arg);
bits8 * bitshiftright (bits8 * arg, int shft);
bits8 * bitshiftleft (bits8 * arg, int shft);
bits8 * bitcat (bits8 *arg1, bits8 *arg2);
bits8 * bitsubstr (bits8 *arg, int32 s, int32 l);
bits8 *zpbitin(char *s, int dummy, int32 atttypmod);
char *zpbitout(bits8 *s);
char *zpbitsout(bits8 *s);
bits8 *varbitin(char *s, int dummy, int32 atttypmod);
bool biteq(bits8 *arg1, bits8 *arg2);
bool bitne(bits8 *arg1, bits8 *arg2);
bool bitge(bits8 *arg1, bits8 *arg2);
bool bitgt(bits8 *arg1, bits8 *arg2);
bool bitle(bits8 *arg1, bits8 *arg2);
bool bitlt(bits8 *arg1, bits8 *arg2);
int bitcmp(bits8 *arg1, bits8 *arg2);
bits8 *bitand(bits8 *arg1, bits8 *arg2);
bits8 *bitor(bits8 *arg1, bits8 *arg2);
bits8 *bitxor(bits8 *arg1, bits8 *arg2);
bits8 *bitnot(bits8 *arg);
bits8 *bitshiftright(bits8 *arg, int shft);
bits8 *bitshiftleft(bits8 *arg, int shft);
bits8 *bitcat(bits8 *arg1, bits8 *arg2);
bits8 *bitsubstr(bits8 *arg, int32 s, int32 l);
......@@ -2,12 +2,13 @@
#include "varbit.h"
bits8 * varbit_in (char * s);
char * varbit_out (bits8 *s);
bits8 *varbit_in(char *s);
char *varbit_out(bits8 *s);
bits8 *
varbit_in (char * s) {
return varbitin (s, 0, -1);
varbit_in(char *s)
{
return varbitin(s, 0, -1);
}
/*char *
......@@ -17,6 +18,7 @@ varbit_out (bits8 *s) {
*/
char *
varbit_out (bits8 *s) {
varbit_out(bits8 *s)
{
return zpbitsout(s);
}
This diff is collapsed.
......@@ -36,7 +36,7 @@
* Decode time string 00:00:00 through 24:00:00.
*/
static int
decode_24h_time(char *str, struct tm *tm, double *fsec)
decode_24h_time(char *str, struct tm * tm, double *fsec)
{
char *cp;
......@@ -51,9 +51,7 @@ decode_24h_time(char *str, struct tm *tm, double *fsec)
*fsec = 0;
}
else if (*cp != ':')
{
return -1;
}
else
{
str = cp + 1;
......@@ -72,10 +70,10 @@ decode_24h_time(char *str, struct tm *tm, double *fsec)
}
/* do a sanity check */
if ( (tm->tm_hour < 0) || (tm->tm_hour > 24)
if ((tm->tm_hour < 0) || (tm->tm_hour > 24)
|| (tm->tm_min < 0) || (tm->tm_min > 59)
|| (tm->tm_sec < 0) || (tm->tm_sec > 59)
|| (*fsec < 0) )
|| (*fsec < 0))
return -1;
return 0;
......
......@@ -38,6 +38,7 @@ extern int assertTest(int val);
#ifdef ASSERT_CHECKING_TEST
extern int assertEnable(int val);
#endif
int
......@@ -84,7 +85,8 @@ active_listeners(text *relname)
ScanKeyData key;
Datum d;
bool isnull;
int len, pid;
int len,
pid;
int count = 0;
int ourpid = getpid();
char listen_name[NAMEDATALEN];
......@@ -92,8 +94,9 @@ active_listeners(text *relname)
lRel = heap_openr(ListenerRelationName, AccessShareLock);
tdesc = RelationGetDescr(lRel);
if (relname && (VARSIZE(relname) > VARHDRSZ)) {
len = MIN(VARSIZE(relname)-VARHDRSZ, NAMEDATALEN-1);
if (relname && (VARSIZE(relname) > VARHDRSZ))
{
len = MIN(VARSIZE(relname) - VARHDRSZ, NAMEDATALEN - 1);
strncpy(listen_name, VARDATA(relname), len);
listen_name[len] = '\0';
ScanKeyEntryInitialize(&key, 0,
......@@ -101,15 +104,16 @@ active_listeners(text *relname)
F_NAMEEQ,
PointerGetDatum(listen_name));
sRel = heap_beginscan(lRel, 0, SnapshotNow, 1, &key);
} else {
sRel = heap_beginscan(lRel, 0, SnapshotNow, 0, (ScanKey)NULL);
}
else
sRel = heap_beginscan(lRel, 0, SnapshotNow, 0, (ScanKey) NULL);
while (HeapTupleIsValid(lTuple = heap_getnext(sRel, 0)))
{
d = heap_getattr(lTuple, Anum_pg_listener_pid, tdesc, &isnull);
pid = DatumGetInt32(d);
if ((pid == ourpid) || (kill(pid, SIGTSTP) == 0)) {
if ((pid == ourpid) || (kill(pid, SIGTSTP) == 0))
{
/* elog(NOTICE, "%d ok", pid); */
count++;
}
......@@ -134,6 +138,7 @@ assert_test(int val)
{
return assertTest(val);
}
#endif
#endif
......
......@@ -10,8 +10,10 @@ int active_listeners(text *relname);
#ifdef USE_ASSERT_CHECKING
int assert_enable(int val);
#ifdef ASSERT_CHECKING_TEST
int assert_test(int val);
#endif
#endif
......
This diff is collapsed.
......@@ -89,9 +89,8 @@ string_output(unsigned char *data, int size)
break;
case '{':
/* Escape beginning of string, to distinguish from arrays */
if (p == data) {
if (p == data)
len++;
}
break;
default:
if (NOTPRINTABLE(*p))
......@@ -137,9 +136,8 @@ string_output(unsigned char *data, int size)
break;
case '{':
/* Escape beginning of string, to distinguish from arrays */
if (p == data) {
if (p == data)
*r++ = '\\';
}
*r++ = c;
break;
default:
......@@ -361,6 +359,7 @@ c_charin(unsigned char *str)
{
return (string_input(str, 1, 0, NULL));
}
#endif
/* end of file */
......
#ifndef STRING_IO_H
#define STRING_IO_H
unsigned char* string_output(unsigned char *data, int size);
unsigned char* string_input(unsigned char *str, int size, int hdrsize,
unsigned char *string_output(unsigned char *data, int size);
unsigned char *string_input(unsigned char *str, int size, int hdrsize,
int *rtn_size);
unsigned char* c_charout(int32 c);
unsigned char* c_textout(struct varlena * vlena);
unsigned char* c_varcharout(unsigned char *s);
unsigned char *c_charout(int32 c);
unsigned char *c_textout(struct varlena * vlena);
unsigned char *c_varcharout(unsigned char *s);
#if 0
struct varlena* c_textin(unsigned char *str);
int32* c_charin(unsigned char *str)
struct varlena *c_textin(unsigned char *str);
int32 *
c_charin(unsigned char *str)
#endif
#endif
......
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.61 2000/01/26 05:55:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.62 2000/04/12 17:14:36 momjian Exp $
*
* NOTES
* The old interface functions have been converted to macros
......@@ -139,7 +139,7 @@ DataFill(char *data,
default:
Assert(att[i]->attlen >= 0);
memmove(data, DatumGetPointer(value[i]),
(size_t)(att[i]->attlen));
(size_t) (att[i]->attlen));
break;
}
data = (char *) att_addlength((long) data, att[i]->attlen, value[i]);
......@@ -326,7 +326,7 @@ nocachegetattr(HeapTuple tuple,
Form_pg_attribute *att = tupleDesc->attrs;
int slow = 0; /* do we have to walk nulls? */
(void)isnull; /*not used*/
(void) isnull; /* not used */
#ifdef IN_MACRO
/* This is handled in the macro */
Assert(attnum > 0);
......@@ -806,11 +806,9 @@ void
heap_freetuple(HeapTuple htup)
{
if (htup->t_data != NULL)
if (htup->t_datamcxt != NULL && (char *)(htup->t_data) !=
if (htup->t_datamcxt != NULL && (char *) (htup->t_data) !=
((char *) htup + HEAPTUPLESIZE))
{
elog(NOTICE, "TELL Jan Wieck: heap_freetuple() found separate t_data");
}
pfree(htup);
}
......@@ -851,7 +849,7 @@ heap_addheader(uint32 natts, /* max domain index */
td->t_infomask |= HEAP_XMAX_INVALID;
if (structlen > 0)
memmove((char *) td + hoff, structure, (size_t)structlen);
memmove((char *) td + hoff, structure, (size_t) structlen);
return tuple;
}
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.42 2000/01/26 05:55:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.43 2000/04/12 17:14:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -134,7 +134,7 @@ nocache_index_getattr(IndexTuple tup,
int data_off; /* tuple data offset */
Form_pg_attribute *att = tupleDesc->attrs;
(void)isnull;
(void) isnull;
/* ----------------
* sanity checks
* ----------------
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.61 2000/01/31 04:35:48 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.62 2000/04/12 17:14:37 momjian Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
......@@ -238,8 +238,10 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
Form_pg_attribute attr1 = tupdesc1->attrs[i];
Form_pg_attribute attr2 = tupdesc2->attrs[i];
/* We do not need to check every single field here, and in fact
* some fields such as attdisbursion probably shouldn't be compared.
/*
* We do not need to check every single field here, and in fact
* some fields such as attdisbursion probably shouldn't be
* compared.
*/
if (strcmp(NameStr(attr1->attname), NameStr(attr2->attname)) != 0)
return false;
......@@ -585,8 +587,9 @@ BuildDescForRelation(List *schema, char *relname)
constr->has_not_null = true;
desc->attrs[attnum - 1]->attnotnull = entry->is_not_null;
/* Note we copy only pre-cooked default expressions.
* Digestion of raw ones is someone else's problem.
/*
* Note we copy only pre-cooked default expressions. Digestion of
* raw ones is someone else's problem.
*/
if (entry->cooked_default != NULL)
{
......
......@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.52 2000/03/17 02:36:00 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.53 2000/04/12 17:14:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -52,8 +52,10 @@ void gistdelete(Relation r, ItemPointer tid);
static IndexTuple gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t);
static void gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
Relation r, Page pg, OffsetNumber o, int b, bool l);
#ifdef GISTDEBUG
static char *int_range_out(INTRANGE *r);
#endif
/*
......@@ -186,7 +188,7 @@ gistbuild(Relation heap,
#ifndef OMIT_PARTIAL_INDEX
/* SetSlotContents(slot, htup); */
slot->val = htup;
if (! ExecQual((List *) pred, econtext, false))
if (!ExecQual((List *) pred, econtext, false))
continue;
#endif /* OMIT_PARTIAL_INDEX */
}
......@@ -272,13 +274,13 @@ gistbuild(Relation heap,
/*
* Since we just counted the tuples in the heap, we update its stats
* in pg_class to guarantee that the planner takes advantage of the
* index we just created. But, only update statistics during
* normal index definitions, not for indices on system catalogs
* created during bootstrap processing. We must close the relations
* before updating statistics to guarantee that the relcache entries
* are flushed when we increment the command counter in UpdateStats().
* But we do not release any locks on the relations; those will be
* held until end of transaction.
* index we just created. But, only update statistics during normal
* index definitions, not for indices on system catalogs created
* during bootstrap processing. We must close the relations before
* updating statistics to guarantee that the relcache entries are
* flushed when we increment the command counter in UpdateStats(). But
* we do not release any locks on the relations; those will be held
* until end of transaction.
*/
if (IsNormalProcessingMode())
{
......
......@@ -266,7 +266,7 @@ gistdropscan(IndexScanDesc s)
prev = l;
if (l == (GISTScanList) NULL)
elog(ERROR, "GiST scan list corrupted -- cannot find 0x%p", (void*)s);
elog(ERROR, "GiST scan list corrupted -- cannot find 0x%p", (void *) s);
if (prev == (GISTScanList) NULL)
GISTScans = l->gsl_next;
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.36 2000/03/01 05:39:22 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.37 2000/04/12 17:14:43 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
......@@ -149,7 +149,7 @@ hashbuild(Relation heap,
#ifndef OMIT_PARTIAL_INDEX
/* SetSlotContents(slot, htup); */
slot->val = htup;
if (! ExecQual((List *) pred, econtext, false))
if (!ExecQual((List *) pred, econtext, false))
continue;
#endif /* OMIT_PARTIAL_INDEX */
}
......@@ -230,13 +230,13 @@ hashbuild(Relation heap,
/*
* Since we just counted the tuples in the heap, we update its stats
* in pg_class to guarantee that the planner takes advantage of the
* index we just created. But, only update statistics during
* normal index definitions, not for indices on system catalogs
* created during bootstrap processing. We must close the relations
* before updating statistics to guarantee that the relcache entries
* are flushed when we increment the command counter in UpdateStats().
* But we do not release any locks on the relations; those will be
* held until end of transaction.
* index we just created. But, only update statistics during normal
* index definitions, not for indices on system catalogs created
* during bootstrap processing. We must close the relations before
* updating statistics to guarantee that the relcache entries are
* flushed when we increment the command counter in UpdateStats(). But
* we do not release any locks on the relations; those will be held
* until end of transaction.
*/
if (IsNormalProcessingMode())
{
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.24 2000/02/21 03:36:46 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.25 2000/04/12 17:14:44 momjian Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
......@@ -146,7 +146,7 @@ hashoidvector(Oid *key)
int i;
uint32 result = 0;
for (i = INDEX_MAX_KEYS; --i >= 0; )
for (i = INDEX_MAX_KEYS; --i >= 0;)
result = (result << 1) ^ (~(uint32) key[i]);
return result;
}
......@@ -162,7 +162,7 @@ hashint2vector(int16 *key)
int i;
uint32 result = 0;
for (i = INDEX_MAX_KEYS; --i >= 0; )
for (i = INDEX_MAX_KEYS; --i >= 0;)
result = (result << 1) ^ (~(uint32) key[i]);
return result;
}
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.22 2000/01/26 05:55:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.23 2000/04/12 17:14:44 momjian Exp $
*
* NOTES
* Because we can be doing an index scan on a relation while we
......@@ -75,7 +75,7 @@ _hash_dropscan(IndexScanDesc scan)
last = chk;
if (chk == (HashScanList) NULL)
elog(ERROR, "hash scan list trashed; can't find 0x%p", (void*)scan);
elog(ERROR, "hash scan list trashed; can't find 0x%p", (void *) scan);
if (last == (HashScanList) NULL)
HashScans = chk->hashsl_next;
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.23 2000/03/17 02:36:02 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.24 2000/04/12 17:14:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.66 2000/02/09 03:49:47 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.67 2000/04/12 17:14:45 momjian Exp $
*
*
* INTERFACE ROUTINES
......@@ -188,8 +188,9 @@ unpinscan(HeapScanDesc scan)
if (BufferIsValid(scan->rs_nbuf))
ReleaseBuffer(scan->rs_nbuf);
/* we don't bother to clear rs_pbuf etc --- caller must
* reinitialize them if scan descriptor is not being deleted.
/*
* we don't bother to clear rs_pbuf etc --- caller must reinitialize
* them if scan descriptor is not being deleted.
*/
}
......@@ -544,7 +545,7 @@ heap_open(Oid relationId, LOCKMODE lockmode)
if (lockmode == NoLock)
return r; /* caller must check RelationIsValid! */
if (! RelationIsValid(r))
if (!RelationIsValid(r))
elog(ERROR, "Relation %u does not exist", relationId);
LockRelation(r, lockmode);
......@@ -586,7 +587,7 @@ heap_openr(const char *relationName, LOCKMODE lockmode)
if (lockmode == NoLock)
return r; /* caller must check RelationIsValid! */
if (! RelationIsValid(r))
if (!RelationIsValid(r))
elog(ERROR, "Relation '%s' does not exist", relationName);
LockRelation(r, lockmode);
......@@ -646,7 +647,7 @@ heap_beginscan(Relation relation,
* sanity checks
* ----------------
*/
if (! RelationIsValid(relation))
if (!RelationIsValid(relation))
elog(ERROR, "heap_beginscan: !RelationIsValid(relation)");
/* ----------------
......@@ -681,6 +682,7 @@ heap_beginscan(Relation relation,
scan->rs_nkeys = (short) nkeys;
if (nkeys)
/*
* we do this here instead of in initscan() because heap_rescan
* also calls initscan() and we don't want to allocate memory
......@@ -847,9 +849,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
if (scan->rs_ptup.t_data == scan->rs_ctup.t_data &&
BufferIsInvalid(scan->rs_pbuf))
{
return NULL;
}
/*
* Copy the "current" tuple/buffer to "next". Pin/unpin the
......@@ -1095,8 +1095,10 @@ heap_fetch(Relation relation,
}
else
{
/* All checks passed, so return the tuple as valid.
* Caller is now responsible for releasing the buffer.
/*
* All checks passed, so return the tuple as valid. Caller is now
* responsible for releasing the buffer.
*/
*userbuf = buffer;
}
......@@ -1119,7 +1121,8 @@ heap_get_latest_tid(Relation relation,
HeapTupleData tp;
HeapTupleHeader t_data;
ItemPointerData ctid;
bool invalidBlock,linkend;
bool invalidBlock,
linkend;
/* ----------------
* get the buffer from the relation descriptor
......@@ -1300,10 +1303,11 @@ l1:
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
if (TransactionIdDidAbort(xwait))
goto l1;
/*
* xwait is committed but if xwait had just marked
* the tuple for update then some other xaction could
* update this tuple before we got to this point.
* xwait is committed but if xwait had just marked the tuple for
* update then some other xaction could update this tuple before
* we got to this point.
*/
if (tp.t_data->t_xmax != xwait)
goto l1;
......@@ -1396,10 +1400,11 @@ l2:
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
if (TransactionIdDidAbort(xwait))
goto l2;
/*
* xwait is committed but if xwait had just marked
* the tuple for update then some other xaction could
* update this tuple before we got to this point.
* xwait is committed but if xwait had just marked the tuple for
* update then some other xaction could update this tuple before
* we got to this point.
*/
if (oldtup.t_data->t_xmax != xwait)
goto l2;
......@@ -1521,10 +1526,11 @@ l3:
LockBuffer(*buffer, BUFFER_LOCK_EXCLUSIVE);
if (TransactionIdDidAbort(xwait))
goto l3;
/*
* xwait is committed but if xwait had just marked
* the tuple for update then some other xaction could
* update this tuple before we got to this point.
* xwait is committed but if xwait had just marked the tuple for
* update then some other xaction could update this tuple before
* we got to this point.
*/
if (tuple->t_data->t_xmax != xwait)
goto l3;
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Id: hio.c,v 1.30 2000/03/17 02:36:02 tgl Exp $
* $Id: hio.c,v 1.31 2000/04/12 17:14:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -111,8 +111,8 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
len = MAXALIGN(tuple->t_len); /* be conservative */
/*
* If we're gonna fail for oversize tuple, do it right away...
* this code should go away eventually.
* If we're gonna fail for oversize tuple, do it right away... this
* code should go away eventually.
*/
if (len > MaxTupleSize)
elog(ERROR, "Tuple is too big: size %u, max size %ld",
......@@ -136,8 +136,8 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
lastblock = RelationGetNumberOfBlocks(relation);
/*
* Get the last existing page --- may need to create the first one
* if this is a virgin relation.
* Get the last existing page --- may need to create the first one if
* this is a virgin relation.
*/
if (lastblock == 0)
{
......@@ -168,12 +168,14 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
if (len > PageGetFreeSpace(pageHeader))
{
/*
* BUG: by elog'ing here, we leave the new buffer locked and not
* marked dirty, which may result in an invalid page header
* being left on disk. But we should not get here given the
* test at the top of the routine, and the whole deal should
* go away when we implement tuple splitting anyway...
* BUG: by elog'ing here, we leave the new buffer locked and
* not marked dirty, which may result in an invalid page
* header being left on disk. But we should not get here
* given the test at the top of the routine, and the whole
* deal should go away when we implement tuple splitting
* anyway...
*/
elog(ERROR, "Tuple is too big: size %u", len);
}
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/tuptoaster.c,v 1.2 2000/01/20 21:50:59 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/tuptoaster.c,v 1.3 2000/04/12 17:14:45 momjian Exp $
*
*
* INTERFACE ROUTINES
......@@ -30,14 +30,14 @@
#ifdef TUPLE_TOASTER_ACTIVE
void
heap_tuple_toast_attrs (Relation rel, HeapTuple newtup, HeapTuple oldtup)
heap_tuple_toast_attrs(Relation rel, HeapTuple newtup, HeapTuple oldtup)
{
return;
}
varattrib *
heap_tuple_untoast_attr (varattrib *attr)
heap_tuple_untoast_attr(varattrib * attr)
{
elog(ERROR, "heap_tuple_untoast_attr() called");
}
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.24 2000/03/14 23:52:01 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.25 2000/04/12 17:14:47 momjian Exp $
*
* NOTES
* many of the old access method routines have been turned into
......@@ -114,7 +114,10 @@ RelationGetIndexScan(Relation relation,
ItemPointerSetInvalid(&scan->currentMarkData);
ItemPointerSetInvalid(&scan->nextMarkData);
/* mark cached function lookup data invalid; it will be set on first use */
/*
* mark cached function lookup data invalid; it will be set on first
* use
*/
scan->fn_getnext.fn_oid = InvalidOid;
if (numberOfKeys > 0)
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.41 2000/03/14 23:52:01 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.42 2000/04/12 17:14:47 momjian Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relationId
......@@ -129,7 +129,7 @@ index_open(Oid relationId)
r = RelationIdGetRelation(relationId);
if (! RelationIsValid(r))
if (!RelationIsValid(r))
elog(ERROR, "Index %u does not exist", relationId);
if (r->rd_rel->relkind != RELKIND_INDEX)
......@@ -151,7 +151,7 @@ index_openr(char *relationName)
r = RelationNameGetRelation(relationName);
if (! RelationIsValid(r))
if (!RelationIsValid(r))
elog(ERROR, "Index '%s' does not exist", relationName);
if (r->rd_rel->relkind != RELKIND_INDEX)
......
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.41 2000/02/18 09:29:16 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.42 2000/04/12 17:14:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.33 2000/02/10 19:51:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.34 2000/04/12 17:14:49 momjian Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.56 2000/03/17 02:36:03 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.57 2000/04/12 17:14:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -267,21 +267,20 @@ _bt_insertonpg(Relation rel,
itemsz = IndexTupleDSize(btitem->bti_itup)
+ (sizeof(BTItemData) - sizeof(IndexTupleData));
itemsz = MAXALIGN(itemsz); /* be safe, PageAddItem will do
* this but we need to be
* consistent */
itemsz = MAXALIGN(itemsz); /* be safe, PageAddItem will do this but
* we need to be consistent */
/*
* Check whether the item can fit on a btree page at all.
* (Eventually, we ought to try to apply TOAST methods if not.)
* We actually need to be able to fit three items on every page,
* so restrict any one item to 1/3 the per-page available space.
* Note that at this point, itemsz doesn't include the ItemId.
* Check whether the item can fit on a btree page at all. (Eventually,
* we ought to try to apply TOAST methods if not.) We actually need to
* be able to fit three items on every page, so restrict any one item
* to 1/3 the per-page available space. Note that at this point,
* itemsz doesn't include the ItemId.
*/
if (itemsz > (PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData))
if (itemsz > (PageGetPageSize(page) - sizeof(PageHeaderData) - MAXALIGN(sizeof(BTPageOpaqueData))) / 3 - sizeof(ItemIdData))
elog(ERROR, "btree: index item size %u exceeds maximum %lu",
itemsz,
(PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData));
(PageGetPageSize(page) - sizeof(PageHeaderData) - MAXALIGN(sizeof(BTPageOpaqueData))) /3 - sizeof(ItemIdData));
/*
* If we have to insert item on the leftmost page which is the first
......@@ -415,8 +414,8 @@ _bt_insertonpg(Relation rel,
bool is_root = lpageop->btpo_flags & BTP_ROOT;
/*
* Instead of splitting leaf page in the chain of duplicates
* by new duplicate, insert it into some right page.
* Instead of splitting leaf page in the chain of duplicates by
* new duplicate, insert it into some right page.
*/
if ((lpageop->btpo_flags & BTP_CHAIN) &&
(lpageop->btpo_flags & BTP_LEAF) && keys_equal)
......@@ -424,6 +423,7 @@ _bt_insertonpg(Relation rel,
rbuf = _bt_getbuf(rel, lpageop->btpo_next, BT_WRITE);
rpage = BufferGetPage(rbuf);
rpageop = (BTPageOpaque) PageGetSpecialPointer(rpage);
/*
* some checks
*/
......@@ -442,6 +442,7 @@ _bt_insertonpg(Relation rel,
BTGreaterStrategyNumber))
elog(FATAL, "btree: hikey is out of order");
else if (rpageop->btpo_flags & BTP_CHAIN)
/*
* If hikey > scankey then it's last page in chain and
* BTP_CHAIN must be OFF
......@@ -450,9 +451,7 @@ _bt_insertonpg(Relation rel,
}
else
/* rightmost page */
{
Assert(!(rpageop->btpo_flags & BTP_CHAIN));
}
_bt_relbuf(rel, buf, BT_WRITE);
return (_bt_insertonpg(rel, rbuf, stack, keysz,
scankey, btitem, afteritem));
......
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.35 2000/01/26 05:55:58 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.36 2000/04/12 17:14:49 momjian Exp $
*
* NOTES
* Postgres btree pages look like ordinary relation pages. The opaque
......
......@@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.53 2000/02/18 09:29:54 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.54 2000/04/12 17:14:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -185,7 +185,7 @@ btbuild(Relation heap,
#ifndef OMIT_PARTIAL_INDEX
/* SetSlotContents(slot, htup); */
slot->val = htup;
if (! ExecQual((List *) pred, econtext, false))
if (!ExecQual((List *) pred, econtext, false))
continue;
#endif /* OMIT_PARTIAL_INDEX */
}
......@@ -276,9 +276,9 @@ btbuild(Relation heap,
}
/*
* if we are doing bottom-up btree build, finish the build by
* (1) completing the sort of the spool file, (2) inserting the
* sorted tuples into btree pages and (3) building the upper levels.
* if we are doing bottom-up btree build, finish the build by (1)
* completing the sort of the spool file, (2) inserting the sorted
* tuples into btree pages and (3) building the upper levels.
*/
if (usefast)
{
......@@ -298,13 +298,13 @@ btbuild(Relation heap,
/*
* Since we just counted the tuples in the heap, we update its stats
* in pg_class to guarantee that the planner takes advantage of the
* index we just created. But, only update statistics during
* normal index definitions, not for indices on system catalogs
* created during bootstrap processing. We must close the relations
* before updating statistics to guarantee that the relcache entries
* are flushed when we increment the command counter in UpdateStats().
* But we do not release any locks on the relations; those will be
* held until end of transaction.
* index we just created. But, only update statistics during normal
* index definitions, not for indices on system catalogs created
* during bootstrap processing. We must close the relations before
* updating statistics to guarantee that the relcache entries are
* flushed when we increment the command counter in UpdateStats(). But
* we do not release any locks on the relations; those will be held
* until end of transaction.
*/
if (IsNormalProcessingMode())
{
......@@ -314,9 +314,10 @@ btbuild(Relation heap,
heap_close(heap, NoLock);
index_close(index);
/*
UpdateStats(hrelid, nhtups, true);
UpdateStats(irelid, nitups, false);
* UpdateStats(hrelid, nhtups, true); UpdateStats(irelid, nitups,
* false);
*/
UpdateStats(hrelid, nhtups, inplace);
UpdateStats(irelid, nitups, inplace);
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.30 2000/01/26 05:55:58 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.31 2000/04/12 17:14:49 momjian Exp $
*
*
* NOTES
......@@ -52,13 +52,16 @@ static void _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offn
void
AtEOXact_nbtree(void)
{
/* Note: these actions should only be necessary during xact abort;
* but they can't hurt during a commit.
/*
* Note: these actions should only be necessary during xact abort; but
* they can't hurt during a commit.
*/
/* Reset the active-scans list to empty.
* We do not need to free the list elements, because they're all
* palloc()'d, so they'll go away at end of transaction anyway.
/*
* Reset the active-scans list to empty. We do not need to free the
* list elements, because they're all palloc()'d, so they'll go away
* at end of transaction anyway.
*/
BTScans = NULL;
......@@ -96,7 +99,7 @@ _bt_dropscan(IndexScanDesc scan)
last = chk;
if (chk == (BTScanList) NULL)
elog(ERROR, "btree scan list trashed; can't find 0x%p", (void*)scan);
elog(ERROR, "btree scan list trashed; can't find 0x%p", (void *) scan);
if (last == (BTScanList) NULL)
BTScans = chk->btsl_next;
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.58 2000/03/17 02:36:04 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.59 2000/04/12 17:14:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -299,9 +299,7 @@ _bt_skeycmp(Relation rel,
compare = -1; /* not-NULL key "<" NULL datum */
}
else
{
compare = (int32) FMGR_PTR2(&entry->sk_func, keyDatum, attrDatum);
}
if (compare != 0)
break; /* done when we find unequal attributes */
......@@ -368,19 +366,18 @@ _bt_binsrch(Relation rel,
/*
* If there are no keys on the page, return the first available slot.
* Note this covers two cases: the page is really empty (no keys),
* or it contains only a high key. The latter case is possible after
* Note this covers two cases: the page is really empty (no keys), or
* it contains only a high key. The latter case is possible after
* vacuuming.
*/
if (high < low)
return low;
/*
* Binary search to find the first key on the page >= scan key.
* Loop invariant: all slots before 'low' are < scan key, all slots
* at or after 'high' are >= scan key. Also, haveEq is true if the
* tuple at 'high' is == scan key.
* We can fall out when high == low.
* Binary search to find the first key on the page >= scan key. Loop
* invariant: all slots before 'low' are < scan key, all slots at or
* after 'high' are >= scan key. Also, haveEq is true if the tuple at
* 'high' is == scan key. We can fall out when high == low.
*/
high++; /* establish the loop invariant for high */
haveEq = false;
......@@ -388,6 +385,7 @@ _bt_binsrch(Relation rel,
while (high > low)
{
OffsetNumber mid = low + ((high - low) / 2);
/* We have low <= mid < high, so mid points at a real slot */
result = _bt_compare(rel, itupdesc, page, keysz, scankey, mid);
......@@ -443,18 +441,20 @@ _bt_binsrch(Relation rel,
if (haveEq)
{
/*
* There is an equal key. We return either the first equal key
* (which we just found), or the last lesser key.
*
* We need not check srchtype != BT_DESCENT here, since if that
* is true then natts == keysz by assumption.
* We need not check srchtype != BT_DESCENT here, since if that is
* true then natts == keysz by assumption.
*/
if (natts == keysz)
return low; /* return first equal key */
}
else
{
/*
* There is no equal key. We return either the first greater key
* (which we just found), or the last lesser key.
......@@ -524,6 +524,7 @@ _bt_compare(Relation rel,
&& P_LEFTMOST(opaque)
&& offnum == P_HIKEY)
{
/*
* we just have to believe that this will only be called with
* offnum == P_HIKEY when P_HIKEY is the OffsetNumber of the first
......@@ -704,7 +705,8 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
ScanKey scankeys = 0;
int keysCount = 0;
int *nKeyIs = 0;
int i, j;
int i,
j;
StrategyNumber strat_total;
rel = scan->relation;
......@@ -730,8 +732,8 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
{
AttrNumber attno;
nKeyIs = (int *)palloc(so->numberOfKeys*sizeof(int));
for (i=0; i < so->numberOfKeys; i++)
nKeyIs = (int *) palloc(so->numberOfKeys * sizeof(int));
for (i = 0; i < so->numberOfKeys; i++)
{
attno = so->keyData[i].sk_attno;
if (attno == keysCount)
......@@ -748,7 +750,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
}
if (ScanDirectionIsBackward(dir) &&
(strat == BTLessStrategyNumber ||
strat == BTLessEqualStrategyNumber) )
strat == BTLessEqualStrategyNumber))
{
nKeyIs[keysCount++] = i;
strat_total = strat;
......@@ -758,7 +760,7 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
}
if (ScanDirectionIsForward(dir) &&
(strat == BTGreaterStrategyNumber ||
strat == BTGreaterEqualStrategyNumber) )
strat == BTGreaterEqualStrategyNumber))
{
nKeyIs[keysCount++] = i;
strat_total = strat;
......@@ -794,8 +796,8 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
* at the right place in the scan.
*/
/* _bt_orderkeys disallows it, but it's place to add some code latter */
scankeys = (ScanKey)palloc(keysCount*sizeof(ScanKeyData));
for (i=0; i < keysCount; i++)
scankeys = (ScanKey) palloc(keysCount * sizeof(ScanKeyData));
for (i = 0; i < keysCount; i++)
{
j = nKeyIs[i];
if (so->keyData[j].sk_flags & SK_ISNULL)
......@@ -805,11 +807,12 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
elog(ERROR, "_bt_first: btree doesn't support is(not)null, yet");
return ((RetrieveIndexResult) NULL);
}
proc = index_getprocid(rel, i+1, BTORDER_PROC);
ScanKeyEntryInitialize(scankeys+i, so->keyData[j].sk_flags,
i+1, proc, so->keyData[j].sk_argument);
proc = index_getprocid(rel, i + 1, BTORDER_PROC);
ScanKeyEntryInitialize(scankeys + i, so->keyData[j].sk_flags,
i + 1, proc, so->keyData[j].sk_argument);
}
if (nKeyIs) pfree(nKeyIs);
if (nKeyIs)
pfree(nKeyIs);
stack = _bt_search(rel, keysCount, scankeys, &buf);
_bt_freestack(stack);
......
......@@ -28,7 +28,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.51 2000/02/18 06:32:39 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.52 2000/04/12 17:14:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -99,9 +99,9 @@ _bt_spoolinit(Relation index, bool isunique)
btspool->sortstate = tuplesort_begin_index(index, isunique, false);
/*
* Currently, tuplesort provides sort functions on IndexTuples.
* If we kept anything in a BTItem other than a regular IndexTuple,
* we'd need to modify tuplesort to understand BTItems as such.
* Currently, tuplesort provides sort functions on IndexTuples. If we
* kept anything in a BTItem other than a regular IndexTuple, we'd
* need to modify tuplesort to understand BTItems as such.
*/
Assert(sizeof(BTItemData) == sizeof(IndexTupleData));
......@@ -306,20 +306,20 @@ _bt_buildadd(Relation index, Size keysz, ScanKey scankey,
btisz = MAXALIGN(btisz);
/*
* Check whether the item can fit on a btree page at all.
* (Eventually, we ought to try to apply TOAST methods if not.)
* We actually need to be able to fit three items on every page,
* so restrict any one item to 1/3 the per-page available space.
* Note that at this point, btisz doesn't include the ItemId.
* Check whether the item can fit on a btree page at all. (Eventually,
* we ought to try to apply TOAST methods if not.) We actually need to
* be able to fit three items on every page, so restrict any one item
* to 1/3 the per-page available space. Note that at this point, btisz
* doesn't include the ItemId.
*
* NOTE: similar code appears in _bt_insertonpg() to defend against
* oversize items being inserted into an already-existing index.
* But during creation of an index, we don't go through there.
* oversize items being inserted into an already-existing index. But
* during creation of an index, we don't go through there.
*/
if (btisz > (PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData))
if (btisz > (PageGetPageSize(npage) - sizeof(PageHeaderData) - MAXALIGN(sizeof(BTPageOpaqueData))) / 3 - sizeof(ItemIdData))
elog(ERROR, "btree: index item size %d exceeds maximum %ld",
btisz,
(PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData));
(PageGetPageSize(npage) - sizeof(PageHeaderData) - MAXALIGN(sizeof(BTPageOpaqueData))) /3 - sizeof(ItemIdData));
if (pgspc < btisz)
{
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.35 2000/02/18 06:32:39 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.36 2000/04/12 17:14:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -141,7 +141,8 @@ _bt_orderkeys(Relation relation, BTScanOpaque so)
uint16 numberOfKeys = so->numberOfKeys;
uint16 new_numberOfKeys = 0;
AttrNumber attno = 1;
bool equalStrategyEnd, underEqualStrategy;
bool equalStrategyEnd,
underEqualStrategy;
if (numberOfKeys < 1)
return;
......@@ -194,6 +195,7 @@ _bt_orderkeys(Relation relation, BTScanOpaque so)
elog(ERROR, "_bt_orderkeys: key(s) for attribute %d missed", attno + 1);
underEqualStrategy = (!equalStrategyEnd);
/*
* If = has been specified, no other key will be used. In case
* of key < 2 && key == 1 and so on we have to set qual_ok to
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.44 2000/03/01 05:39:23 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.45 2000/04/12 17:14:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -181,7 +181,7 @@ rtbuild(Relation heap,
#ifndef OMIT_PARTIAL_INDEX
/* SetSlotContents(slot, htup); */
slot->val = htup;
if (! ExecQual((List *) pred, econtext, false))
if (!ExecQual((List *) pred, econtext, false))
continue;
#endif /* OMIT_PARTIAL_INDEX */
}
......@@ -249,13 +249,13 @@ rtbuild(Relation heap,
/*
* Since we just counted the tuples in the heap, we update its stats
* in pg_class to guarantee that the planner takes advantage of the
* index we just created. But, only update statistics during
* normal index definitions, not for indices on system catalogs
* created during bootstrap processing. We must close the relations
* before updating statistics to guarantee that the relcache entries
* are flushed when we increment the command counter in UpdateStats().
* But we do not release any locks on the relations; those will be
* held until end of transaction.
* index we just created. But, only update statistics during normal
* index definitions, not for indices on system catalogs created
* during bootstrap processing. We must close the relations before
* updating statistics to guarantee that the relcache entries are
* flushed when we increment the command counter in UpdateStats(). But
* we do not release any locks on the relations; those will be held
* until end of transaction.
*/
if (IsNormalProcessingMode())
{
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.31 2000/01/26 05:56:00 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.32 2000/04/12 17:14:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -268,7 +268,7 @@ rtdropscan(IndexScanDesc s)
prev = l;
if (l == (RTScanList) NULL)
elog(ERROR, "rtree scan list corrupted -- cannot find 0x%p", (void*)s);
elog(ERROR, "rtree scan list corrupted -- cannot find 0x%p", (void *) s);
if (prev == (RTScanList) NULL)
RTScans = l->rtsl_next;
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.33 2000/01/26 05:56:03 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.34 2000/04/12 17:14:52 momjian Exp $
*
* NOTES
* This file contains the high level access-method interface to the
......@@ -162,6 +162,7 @@ TransactionLogTest(TransactionId transactionId, /* transaction id to test */
if (!fail)
{
/*
* DO NOT cache status for transactions in unknown state !!!
*/
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.27 2000/03/31 02:43:31 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.28 2000/04/12 17:14:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -331,8 +331,8 @@ ReadNewTransactionId(TransactionId *xid)
SpinAcquire(OidGenLockId); /* not good for concurrency... */
/*
* Note that we don't check is ShmemVariableCache->xid_count equal
* to 0 or not. This will work as long as we don't call
* Note that we don't check is ShmemVariableCache->xid_count equal to
* 0 or not. This will work as long as we don't call
* ReadNewTransactionId() before GetNewTransactionId().
*/
if (ShmemVariableCache->nextXid == 0)
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.63 2000/04/09 04:43:16 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.64 2000/04/12 17:14:53 momjian Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
......@@ -517,8 +517,8 @@ CommandCounterIncrement()
CurrentTransactionStateData.scanCommandId = CurrentTransactionStateData.commandId;
/*
* make cache changes visible to me. AtCommit_LocalCache()
* instead of AtCommit_Cache() is called here.
* make cache changes visible to me. AtCommit_LocalCache() instead of
* AtCommit_Cache() is called here.
*/
AtCommit_LocalCache();
AtStart_Cache();
......@@ -628,15 +628,14 @@ RecordTransactionCommit()
xid = GetCurrentTransactionId();
/*
* flush the buffer manager pages. Note: if we have stable
* main memory, dirty shared buffers are not flushed
* plai 8/7/90
* flush the buffer manager pages. Note: if we have stable main
* memory, dirty shared buffers are not flushed plai 8/7/90
*/
leak = BufferPoolCheckLeak();
/*
* If no one shared buffer was changed by this transaction then
* we don't flush shared buffers and don't record commit status.
* If no one shared buffer was changed by this transaction then we
* don't flush shared buffers and don't record commit status.
*/
if (SharedBufferChanged)
{
......@@ -645,8 +644,8 @@ RecordTransactionCommit()
ResetBufferPool(true);
/*
* have the transaction access methods record the status
* of this transaction id in the pg_log relation.
* have the transaction access methods record the status of this
* transaction id in the pg_log relation.
*/
TransactionIdCommit(xid);
......@@ -752,9 +751,9 @@ RecordTransactionAbort()
xid = GetCurrentTransactionId();
/*
* Have the transaction access methods record the status of
* this transaction id in the pg_log relation. We skip it
* if no one shared buffer was changed by this transaction.
* Have the transaction access methods record the status of this
* transaction id in the pg_log relation. We skip it if no one shared
* buffer was changed by this transaction.
*/
if (SharedBufferChanged && !TransactionIdDidCommit(xid))
TransactionIdAbort(xid);
......@@ -965,13 +964,13 @@ CommitTransaction()
RecordTransactionCommit();
/*
* Let others know about no transaction in progress by me.
* Note that this must be done _before_ releasing locks we hold
* and SpinAcquire(SInvalLock) is required: UPDATE with xid 0 is
* blocked by xid 1' UPDATE, xid 1 is doing commit while xid 2
* gets snapshot - if xid 2' GetSnapshotData sees xid 1 as running
* then it must see xid 0 as running as well or it will see two
* tuple versions - one deleted by xid 1 and one inserted by xid 0.
* Let others know about no transaction in progress by me. Note that
* this must be done _before_ releasing locks we hold and
* SpinAcquire(SInvalLock) is required: UPDATE with xid 0 is blocked
* by xid 1' UPDATE, xid 1 is doing commit while xid 2 gets snapshot -
* if xid 2' GetSnapshotData sees xid 1 as running then it must see
* xid 0 as running as well or it will see two tuple versions - one
* deleted by xid 1 and one inserted by xid 0.
*/
if (MyProc != (PROC *) NULL)
{
......@@ -995,7 +994,7 @@ CommitTransaction()
* ----------------
*/
s->state = TRANS_DEFAULT;
SharedBufferChanged = false; /* safest place to do it */
SharedBufferChanged = false;/* safest place to do it */
}
......@@ -1070,7 +1069,7 @@ AbortTransaction()
* ----------------
*/
s->state = TRANS_DEFAULT;
SharedBufferChanged = false; /* safest place to do it */
SharedBufferChanged = false;/* safest place to do it */
}
/* --------------------------------
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.80 2000/02/18 09:28:39 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.81 2000/04/12 17:14:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -107,7 +107,7 @@ static struct typinfo Procid[] = {
{"char", CHAROID, 0, 1, F_CHARIN, F_CHAROUT},
{"name", NAMEOID, 0, NAMEDATALEN, F_NAMEIN, F_NAMEOUT},
{"int2", INT2OID, 0, 2, F_INT2IN, F_INT2OUT},
{"int2vector", INT2VECTOROID, 0, INDEX_MAX_KEYS*2, F_INT2VECTORIN, F_INT2VECTOROUT},
{"int2vector", INT2VECTOROID, 0, INDEX_MAX_KEYS * 2, F_INT2VECTORIN, F_INT2VECTOROUT},
{"int4", INT4OID, 0, 4, F_INT4IN, F_INT4OUT},
{"regproc", REGPROCOID, 0, 4, F_REGPROCIN, F_REGPROCOUT},
{"text", TEXTOID, 0, -1, F_TEXTIN, F_TEXTOUT},
......@@ -115,7 +115,7 @@ static struct typinfo Procid[] = {
{"tid", TIDOID, 0, 6, F_TIDIN, F_TIDOUT},
{"xid", XIDOID, 0, 4, F_XIDIN, F_XIDOUT},
{"cid", CIDOID, 0, 4, F_CIDIN, F_CIDOUT},
{"oidvector", 30, 0, INDEX_MAX_KEYS*4, F_OIDVECTORIN, F_OIDVECTOROUT},
{"oidvector", 30, 0, INDEX_MAX_KEYS * 4, F_OIDVECTORIN, F_OIDVECTOROUT},
{"smgr", 210, 0, 2, F_SMGRIN, F_SMGROUT},
{"_int4", 1007, INT4OID, -1, F_ARRAY_IN, F_ARRAY_OUT},
{"_aclitem", 1034, 1033, -1, F_ARRAY_IN, F_ARRAY_OUT}
......@@ -325,8 +325,8 @@ BootstrapMain(int argc, char *argv[])
}
/*
* Bootstrap under Postmaster means two things:
* (xloginit) ? StartupXLOG : ShutdownXLOG
* Bootstrap under Postmaster means two things: (xloginit) ?
* StartupXLOG : ShutdownXLOG
*
* If !under Postmaster and xloginit then BootStrapXLOG.
*/
......@@ -345,9 +345,7 @@ BootstrapMain(int argc, char *argv[])
}
if (!IsUnderPostmaster && xloginit)
{
BootStrapXLOG();
}
/*
* backend initialization
......@@ -1153,8 +1151,10 @@ build_indices()
index_build(heap, ind, ILHead->il_natts, ILHead->il_attnos,
ILHead->il_nparams, ILHead->il_params, ILHead->il_finfo,
ILHead->il_predInfo);
/* In normal processing mode, index_build would close the heap
* and index, but in bootstrap mode it will not.
/*
* In normal processing mode, index_build would close the heap and
* index, but in bootstrap mode it will not.
*/
/*
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.37 2000/01/26 05:56:09 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.38 2000/04/12 17:14:55 momjian Exp $
*
* NOTES
* See acl.h.
......@@ -364,7 +364,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
*/
if (((mode & ACL_WR) || (mode & ACL_AP)) &&
!allowSystemTableMods && IsSystemRelationName(relname) &&
strncmp(relname,"pg_temp.", strlen("pg_temp.")) != 0 &&
strncmp(relname, "pg_temp.", strlen("pg_temp.")) != 0 &&
!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)
{
elog(DEBUG, "pg_aclcheck: catalog update to \"%s\": permission denied",
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.31 2000/04/09 04:43:15 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.32 2000/04/12 17:14:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -44,6 +44,7 @@ relpath(const char *relname)
snprintf(path, bufsize, "%s%c%s", DataDir, SEP_CHAR, relname);
return path;
}
/*
* If it is in the current database, assume it is in current working
* directory. NB: this does not work during bootstrap!
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.107 2000/03/01 05:39:24 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.108 2000/04/12 17:14:55 momjian Exp $
*
*
* INTERFACE ROUTINES
......@@ -77,16 +77,20 @@ static void DefaultBuild(Relation heapRelation, Relation indexRelation,
static Oid IndexGetRelation(Oid indexId);
static bool reindexing = false;
extern bool SetReindexProcessing(bool reindexmode)
extern bool
SetReindexProcessing(bool reindexmode)
{
bool old = reindexing;
reindexing = reindexmode;
return old;
}
extern bool IsReindexProcessing(void)
extern bool
IsReindexProcessing(void)
{
return reindexing;
}
/* ----------------------------------------------------------------
* sysatts is a structure containing attribute tuple forms
* for system attributes (numbered -1, -2, ...). This really
......@@ -1075,9 +1079,9 @@ index_create(char *heapRelationName,
* bootstrapping. Otherwise, we call the routine that constructs the
* index.
*
* In normal processing mode, the heap and index relations are closed
* by index_build() --- but we continue to hold the ShareLock on the
* heap that we acquired above, until end of transaction.
* In normal processing mode, the heap and index relations are closed by
* index_build() --- but we continue to hold the ShareLock on the heap
* that we acquired above, until end of transaction.
*/
if (IsBootstrapProcessingMode())
{
......@@ -1139,7 +1143,7 @@ index_drop(Oid indexId)
* they don't exist anyway. So, no warning in that case.
* ----------------
*/
if (IsTransactionBlock() && ! userIndexRelation->rd_myxactonly)
if (IsTransactionBlock() && !userIndexRelation->rd_myxactonly)
elog(NOTICE, "Caution: DROP INDEX cannot be rolled back, so don't abort now");
/* ----------------
......@@ -1267,7 +1271,8 @@ FormIndexDatum(int numberOfAttributes,
* --------------------------------------------
*/
static
bool LockClassinfoForUpdate(Oid relid, HeapTuple rtup, Buffer *buffer, bool confirmCommitted)
bool
LockClassinfoForUpdate(Oid relid, HeapTuple rtup, Buffer *buffer, bool confirmCommitted)
{
HeapTuple classTuple;
Form_pg_class pgcform;
......@@ -1295,6 +1300,7 @@ bool LockClassinfoForUpdate(Oid relid, HeapTuple rtup, Buffer *buffer, bool conf
if (confirmCommitted)
{
HeapTupleHeader th = rtup->t_data;
if (!(th->t_infomask & HEAP_XMIN_COMMITTED))
elog(ERROR, "The tuple isn't committed");
if (th->t_infomask & HEAP_XMAX_COMMITTED)
......@@ -1309,7 +1315,8 @@ bool LockClassinfoForUpdate(Oid relid, HeapTuple rtup, Buffer *buffer, bool conf
* Indexes of the relation active ?
* ---------------------------------------------
*/
bool IndexesAreActive(Oid relid, bool confirmCommitted)
bool
IndexesAreActive(Oid relid, bool confirmCommitted)
{
HeapTupleData tuple;
Relation indexRelation;
......@@ -1406,13 +1413,15 @@ setRelhasindexInplace(Oid relid, bool hasindex, bool immediate)
heap_close(pg_class, RowExclusiveLock);
elog(ERROR, "setRelhasindexInplace: cannot scan RELATION relation");
}
/*
* Confirm that target tuple is locked by this transaction
* in case of immedaite updation.
* Confirm that target tuple is locked by this transaction in case of
* immedaite updation.
*/
if (immediate)
{
HeapTupleHeader th = tuple->t_data;
if (!(th->t_infomask & HEAP_XMIN_COMMITTED))
elog(ERROR, "Immediate hasindex updation can be done only for committed tuples %x", th->t_infomask);
if (th->t_infomask & HEAP_XMAX_INVALID)
......@@ -1697,10 +1706,12 @@ DefaultBuild(Relation heapRelation,
char *nullv;
long reltuples,
indtuples;
#ifndef OMIT_PARTIAL_INDEX
ExprContext *econtext;
TupleTable tupleTable;
TupleTableSlot *slot;
#endif
Node *predicate;
Node *oldPred;
......@@ -1781,6 +1792,7 @@ DefaultBuild(Relation heapRelation,
reltuples++;
#ifndef OMIT_PARTIAL_INDEX
/*
* If oldPred != NULL, this is an EXTEND INDEX command, so skip
* this tuple if it was already in the existing partial index
......@@ -1804,7 +1816,7 @@ DefaultBuild(Relation heapRelation,
{
/* SetSlotContents(slot, heapTuple); */
slot->val = heapTuple;
if (! ExecQual((List *) predicate, econtext, false))
if (!ExecQual((List *) predicate, econtext, false))
continue;
}
#endif /* OMIT_PARTIAL_INDEX */
......@@ -1854,13 +1866,13 @@ DefaultBuild(Relation heapRelation,
/*
* Since we just counted the tuples in the heap, we update its stats
* in pg_class to guarantee that the planner takes advantage of the
* index we just created. But, only update statistics during
* normal index definitions, not for indices on system catalogs
* created during bootstrap processing. We must close the relations
* before updating statistics to guarantee that the relcache entries
* are flushed when we increment the command counter in UpdateStats().
* But we do not release any locks on the relations; those will be
* held until end of transaction.
* index we just created. But, only update statistics during normal
* index definitions, not for indices on system catalogs created
* during bootstrap processing. We must close the relations before
* updating statistics to guarantee that the relcache entries are
* flushed when we increment the command counter in UpdateStats(). But
* we do not release any locks on the relations; those will be held
* until end of transaction.
*/
if (IsNormalProcessingMode())
{
......@@ -2049,17 +2061,25 @@ activate_index(Oid indexId, bool activate)
bool
reindex_index(Oid indexId, bool force)
{
Relation iRel, indexRelation, heapRelation;
Relation iRel,
indexRelation,
heapRelation;
ScanKeyData entry;
HeapScanDesc scan;
HeapTuple indexTuple, procTuple, classTuple;
HeapTuple indexTuple,
procTuple,
classTuple;
Form_pg_index index;
Oid heapId, procId, accessMethodId;
Oid heapId,
procId,
accessMethodId;
Node *oldPred = NULL;
PredInfo *predInfo;
AttrNumber *attributeNumberA;
FuncIndexInfo fInfo, *funcInfo = NULL;
int i, numberOfAttributes;
FuncIndexInfo fInfo,
*funcInfo = NULL;
int i,
numberOfAttributes;
char *predString;
bool old;
......@@ -2152,11 +2172,10 @@ reindex_index(Oid indexId, bool force)
attributeNumberA, 0, NULL, funcInfo, predInfo);
/*
* index_build will close both the heap and index relations
* (but not give up the locks we hold on them). That's fine
* for the index, but we need to open the heap again. We need
* no new lock, since this backend still has the exclusive lock
* grabbed by heap_truncate.
* index_build will close both the heap and index relations (but not
* give up the locks we hold on them). That's fine for the index, but
* we need to open the heap again. We need no new lock, since this
* backend still has the exclusive lock grabbed by heap_truncate.
*/
iRel = index_open(indexId);
Assert(iRel != NULL);
......@@ -2182,21 +2201,18 @@ activate_indexes_of_a_table(Oid relid, bool activate)
if (!activate)
setRelhasindexInplace(relid, false, true);
else
{
return false;
}
}
else
{
if (activate)
reindex_relation(relid, false);
else
{
return false;
}
}
return true;
}
/* --------------------------------
* reindex_relation - This routine is used to recreate indexes
* of a relation.
......@@ -2209,7 +2225,8 @@ reindex_relation(Oid relid, bool force)
ScanKeyData entry;
HeapScanDesc scan;
HeapTuple indexTuple;
bool old, reindexed;
bool old,
reindexed;
old = SetReindexProcessing(true);
if (IndexesAreActive(relid, true))
......@@ -2231,6 +2248,7 @@ reindex_relation(Oid relid, bool force)
while (HeapTupleIsValid(indexTuple = heap_getnext(scan, 0)))
{
Form_pg_index index = (Form_pg_index) GETSTRUCT(indexTuple);
if (activate_index(index->indexrelid, true))
reindexed = true;
else
......@@ -2242,9 +2260,7 @@ reindex_relation(Oid relid, bool force)
heap_endscan(scan);
heap_close(indexRelation, AccessShareLock);
if (reindexed)
{
setRelhasindexInplace(relid, true, false);
}
SetReindexProcessing(old);
return reindexed;
}
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.59 2000/02/18 09:28:41 inoue Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.60 2000/04/12 17:14:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -31,47 +31,47 @@
*/
char *Name_pg_aggregate_indices[Num_pg_aggregate_indices] =
{AggregateNameTypeIndex};
{AggregateNameTypeIndex};
char *Name_pg_am_indices[Num_pg_am_indices] =
{AmNameIndex};
{AmNameIndex};
char *Name_pg_amop_indices[Num_pg_amop_indices] =
{AccessMethodOpidIndex, AccessMethodStrategyIndex};
{AccessMethodOpidIndex, AccessMethodStrategyIndex};
char *Name_pg_attr_indices[Num_pg_attr_indices] =
{AttributeRelidNameIndex, AttributeRelidNumIndex};
{AttributeRelidNameIndex, AttributeRelidNumIndex};
char *Name_pg_attrdef_indices[Num_pg_attrdef_indices] =
{AttrDefaultIndex};
{AttrDefaultIndex};
char *Name_pg_class_indices[Num_pg_class_indices] =
{ClassNameIndex, ClassOidIndex};
{ClassNameIndex, ClassOidIndex};
char *Name_pg_group_indices[Num_pg_group_indices] =
{GroupNameIndex, GroupSysidIndex};
{GroupNameIndex, GroupSysidIndex};
char *Name_pg_index_indices[Num_pg_index_indices] =
{IndexRelidIndex};
{IndexRelidIndex};
char *Name_pg_inherits_indices[Num_pg_inherits_indices] =
{InheritsRelidSeqnoIndex};
{InheritsRelidSeqnoIndex};
char *Name_pg_language_indices[Num_pg_language_indices] =
{LanguageOidIndex, LanguageNameIndex};
{LanguageOidIndex, LanguageNameIndex};
char *Name_pg_listener_indices[Num_pg_listener_indices] =
{ListenerRelnamePidIndex};
{ListenerRelnamePidIndex};
char *Name_pg_opclass_indices[Num_pg_opclass_indices] =
{OpclassNameIndex, OpclassDeftypeIndex};
{OpclassNameIndex, OpclassDeftypeIndex};
char *Name_pg_operator_indices[Num_pg_operator_indices] =
{OperatorOidIndex, OperatorNameIndex};
{OperatorOidIndex, OperatorNameIndex};
char *Name_pg_proc_indices[Num_pg_proc_indices] =
{ProcedureOidIndex, ProcedureNameIndex};
{ProcedureOidIndex, ProcedureNameIndex};
char *Name_pg_relcheck_indices[Num_pg_relcheck_indices] =
{RelCheckIndex};
{RelCheckIndex};
char *Name_pg_rewrite_indices[Num_pg_rewrite_indices] =
{RewriteOidIndex, RewriteRulenameIndex};
{RewriteOidIndex, RewriteRulenameIndex};
char *Name_pg_shadow_indices[Num_pg_shadow_indices] =
{ShadowNameIndex, ShadowSysidIndex};
{ShadowNameIndex, ShadowSysidIndex};
char *Name_pg_statistic_indices[Num_pg_statistic_indices] =
{StatisticRelidAttnumIndex};
{StatisticRelidAttnumIndex};
char *Name_pg_trigger_indices[Num_pg_trigger_indices] =
{TriggerRelidIndex, TriggerConstrNameIndex, TriggerConstrRelidIndex};
{TriggerRelidIndex, TriggerConstrNameIndex, TriggerConstrRelidIndex};
char *Name_pg_type_indices[Num_pg_type_indices] =
{TypeNameIndex, TypeOidIndex};
{TypeNameIndex, TypeOidIndex};
char *Name_pg_description_indices[Num_pg_description_indices] =
{DescriptionObjIndex};
{DescriptionObjIndex};
......@@ -1004,4 +1004,3 @@ TypeOidIndexScan(Relation heapRelation, Oid typeId)
return tuple;
}
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.30 2000/03/26 19:43:58 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.31 2000/04/12 17:14:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -200,8 +200,10 @@ AggregateCreate(char *aggName,
}
else
{
/* If no finalfn, aggregate result type is type of the sole
* state value (we already checked there is only one)
/*
* If no finalfn, aggregate result type is type of the sole state
* value (we already checked there is only one)
*/
if (OidIsValid(xret1))
fret = xret1;
......@@ -284,9 +286,9 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
Assert(xfuncno == 1 || xfuncno == 2);
/*
* since we will have to use fastgetattr (in case one or both init vals
* are NULL), we will need to open the relation. Do that first to
* ensure we don't get a stale tuple from the cache.
* since we will have to use fastgetattr (in case one or both init
* vals are NULL), we will need to open the relation. Do that first
* to ensure we don't get a stale tuple from the cache.
*/
aggRel = heap_openr(AggregateRelationName, AccessShareLock);
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.41 2000/04/04 21:44:37 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.42 2000/04/12 17:14:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.49 2000/01/26 05:56:11 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.50 2000/04/12 17:14:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -374,7 +374,7 @@ TypeCreate(char *typeName,
values[i++] = (Datum) GetUserId(); /* 2 */
values[i++] = (Datum) internalSize; /* 3 */
values[i++] = (Datum) externalSize; /* 4 */
values[i++] = (Datum) passedByValue;/* 5 */
values[i++] = (Datum) passedByValue; /* 5 */
values[i++] = (Datum) typeType; /* 6 */
values[i++] = (Datum) (bool) 1; /* 7 */
values[i++] = (Datum) typDelim; /* 8 */
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/recipe.c,v 1.10 2000/01/26 05:56:17 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/recipe.c,v 1.11 2000/04/12 17:15:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -702,7 +702,7 @@ getParamTypes(TgElement * elem, Oid *typev)
if (parameterCount == FUNC_MAX_ARGS)
{
elog(ERROR,
"getParamTypes: Ingredients cannot take > %d arguments",FUNC_MAX_ARGS);
"getParamTypes: Ingredients cannot take > %d arguments", FUNC_MAX_ARGS);
}
t = elem->inTypes->val[j];
if (strcmp(t, "opaque") == 0)
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.58 2000/01/26 05:56:12 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.59 2000/04/12 17:14:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -155,12 +155,13 @@ Async_Notify(char *relname)
/* no point in making duplicate entries in the list ... */
if (!AsyncExistsPendingNotify(relname))
{
/*
* We allocate list memory from the global malloc pool to ensure
* that it will live until we want to use it. This is probably not
* necessary any longer, since we will use it before the end of the
* transaction. DLList only knows how to use malloc() anyway, but we
* could probably palloc() the strings...
* that it will live until we want to use it. This is probably
* not necessary any longer, since we will use it before the end
* of the transaction. DLList only knows how to use malloc()
* anyway, but we could probably palloc() the strings...
*/
notifyName = strdup(relname);
DLAddHead(pendingNotifies, DLNewElem(notifyName));
......@@ -466,6 +467,7 @@ AtCommit_Notify()
if (listenerPID == MyProcPid)
{
/*
* Self-notify: no need to bother with table update.
* Indeed, we *must not* clear the notification field in
......@@ -491,6 +493,7 @@ AtCommit_Notify()
*/
if (kill(listenerPID, SIGUSR2) < 0)
{
/*
* Get rid of pg_listener entry if it refers to a PID
* that no longer exists. Presumably, that backend
......
......@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.50 2000/01/26 05:56:13 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.51 2000/04/12 17:14:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -104,8 +104,8 @@ cluster(char *oldrelname, char *oldindexname)
* Like vacuum, cluster spans transactions, so I'm going to handle it
* in the same way: commit and restart transactions where needed.
*
* We grab exclusive access to the target rel and index for the
* duration of the initial transaction.
* We grab exclusive access to the target rel and index for the duration
* of the initial transaction.
*/
OldHeap = heap_openr(oldrelname, AccessExclusiveLock);
......@@ -115,7 +115,7 @@ cluster(char *oldrelname, char *oldindexname)
LockRelation(OldIndex, AccessExclusiveLock);
OIDOldIndex = RelationGetRelid(OldIndex);
heap_close(OldHeap, NoLock); /* do NOT give up the locks */
heap_close(OldHeap, NoLock);/* do NOT give up the locks */
index_close(OldIndex);
/*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994-5, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.55 2000/03/14 23:06:12 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.56 2000/04/12 17:14:58 momjian Exp $
*
*/
......@@ -209,7 +209,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
switch (nodeTag(plan))
{
case T_IndexScan:
if (ScanDirectionIsBackward(((IndexScan *)plan)->indxorderdir))
if (ScanDirectionIsBackward(((IndexScan *) plan)->indxorderdir))
appendStringInfo(str, " Backward");
appendStringInfo(str, " using ");
i = 0;
......@@ -246,9 +246,9 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
int firstEntry = true;
appendStringInfo(str, " (");
foreach (c, rte->ref->attrs)
foreach(c, rte->ref->attrs)
{
if (! firstEntry)
if (!firstEntry)
{
appendStringInfo(str, ", ");
firstEntry = false;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment