aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/common/heaptuple.c12
-rw-r--r--src/backend/access/common/indextuple.c8
-rw-r--r--src/backend/access/common/indexvalid.c6
-rw-r--r--src/backend/access/common/tupdesc.c4
-rw-r--r--src/backend/access/gist/gist.c4
-rw-r--r--src/backend/access/gist/gistget.c28
-rw-r--r--src/backend/access/gist/gistscan.c8
-rw-r--r--src/backend/access/hash/hashinsert.c4
-rw-r--r--src/backend/access/hash/hashovfl.c26
-rw-r--r--src/backend/access/hash/hashpage.c12
-rw-r--r--src/backend/access/hash/hashscan.c4
-rw-r--r--src/backend/access/hash/hashsearch.c20
-rw-r--r--src/backend/access/heap/heapam.c52
-rw-r--r--src/backend/access/index/genam.c14
-rw-r--r--src/backend/access/index/istrat.c12
-rw-r--r--src/backend/access/nbtree/nbtinsert.c14
-rw-r--r--src/backend/access/nbtree/nbtree.c8
-rw-r--r--src/backend/access/nbtree/nbtscan.c4
-rw-r--r--src/backend/access/nbtree/nbtsearch.c30
-rw-r--r--src/backend/access/nbtree/nbtsort.c38
-rw-r--r--src/backend/access/nbtree/nbtutils.c8
-rw-r--r--src/backend/access/rtree/rtget.c28
-rw-r--r--src/backend/access/rtree/rtree.c12
-rw-r--r--src/backend/access/rtree/rtscan.c12
-rw-r--r--src/backend/access/transam/xact.c4
-rw-r--r--src/backend/bootstrap/bootstrap.c34
-rw-r--r--src/backend/catalog/aclchk.c14
-rw-r--r--src/backend/catalog/heap.c10
-rw-r--r--src/backend/catalog/index.c16
-rw-r--r--src/backend/catalog/indexing.c4
-rw-r--r--src/backend/catalog/pg_proc.c6
-rw-r--r--src/backend/catalog/pg_type.c12
-rw-r--r--src/backend/commands/_deadcode/version.c4
-rw-r--r--src/backend/commands/async.c12
-rw-r--r--src/backend/commands/command.c4
-rw-r--r--src/backend/commands/copy.c24
-rw-r--r--src/backend/commands/creatinh.c4
-rw-r--r--src/backend/commands/dbcommands.c14
-rw-r--r--src/backend/commands/defind.c14
-rw-r--r--src/backend/commands/define.c62
-rw-r--r--src/backend/commands/proclang.c6
-rw-r--r--src/backend/commands/recipe.c40
-rw-r--r--src/backend/commands/remove.c8
-rw-r--r--src/backend/commands/sequence.c2
-rw-r--r--src/backend/commands/trigger.c6
-rw-r--r--src/backend/commands/vacuum.c12
-rw-r--r--src/backend/commands/variable.c4
-rw-r--r--src/backend/commands/view.c4
-rw-r--r--src/backend/executor/execAmi.c4
-rw-r--r--src/backend/executor/execJunk.c4
-rw-r--r--src/backend/executor/execMain.c10
-rw-r--r--src/backend/executor/execProcnode.c6
-rw-r--r--src/backend/executor/execQual.c12
-rw-r--r--src/backend/executor/execUtils.c8
-rw-r--r--src/backend/executor/functions.c6
-rw-r--r--src/backend/executor/nodeAgg.c10
-rw-r--r--src/backend/executor/nodeAppend.c10
-rw-r--r--src/backend/executor/nodeGroup.c4
-rw-r--r--src/backend/executor/nodeHash.c4
-rw-r--r--src/backend/executor/nodeIndexscan.c8
-rw-r--r--src/backend/executor/nodeMergejoin.c18
-rw-r--r--src/backend/executor/nodeNestloop.c6
-rw-r--r--src/backend/executor/nodeSeqscan.c6
-rw-r--r--src/backend/executor/nodeSort.c4
-rw-r--r--src/backend/executor/nodeTee.c10
-rw-r--r--src/backend/lib/dllist.c6
-rw-r--r--src/backend/lib/fstack.c10
-rw-r--r--src/backend/lib/stringinfo.c6
-rw-r--r--src/backend/libpq/be-fsstubs.c6
-rw-r--r--src/backend/libpq/be-pqexec.c12
-rw-r--r--src/backend/libpq/crypt.c2
-rw-r--r--src/backend/libpq/hba.c8
-rw-r--r--src/backend/libpq/password.c2
-rw-r--r--src/backend/libpq/portal.c6
-rw-r--r--src/backend/libpq/pqcomm.c10
-rw-r--r--src/backend/libpq/pqsignal.c4
-rw-r--r--src/backend/main/main.c4
-rw-r--r--src/backend/nodes/copyfuncs.c10
-rw-r--r--src/backend/nodes/list.c12
-rw-r--r--src/backend/nodes/outfuncs.c10
-rw-r--r--src/backend/nodes/print.c16
-rw-r--r--src/backend/nodes/read.c20
-rw-r--r--src/backend/nodes/readfuncs.c144
-rw-r--r--src/backend/optimizer/geqo/geqo_erx.c4
-rw-r--r--src/backend/optimizer/geqo/geqo_eval.c12
-rw-r--r--src/backend/optimizer/geqo/geqo_misc.c6
-rw-r--r--src/backend/optimizer/geqo/geqo_params.c8
-rw-r--r--src/backend/optimizer/geqo/geqo_paths.c4
-rw-r--r--src/backend/optimizer/geqo/geqo_pool.c4
-rw-r--r--src/backend/optimizer/geqo/geqo_px.c4
-rw-r--r--src/backend/optimizer/geqo/minspantree.c20
-rw-r--r--src/backend/optimizer/path/allpaths.c8
-rw-r--r--src/backend/optimizer/path/clausesel.c10
-rw-r--r--src/backend/optimizer/path/costsize.c8
-rw-r--r--src/backend/optimizer/path/indxpath.c10
-rw-r--r--src/backend/optimizer/path/joinpath.c20
-rw-r--r--src/backend/optimizer/path/joinrels.c4
-rw-r--r--src/backend/optimizer/path/joinutils.c12
-rw-r--r--src/backend/optimizer/path/orindxpath.c12
-rw-r--r--src/backend/optimizer/path/predmig.c4
-rw-r--r--src/backend/optimizer/path/prune.c10
-rw-r--r--src/backend/optimizer/path/xfunc.c16
-rw-r--r--src/backend/optimizer/plan/createplan.c18
-rw-r--r--src/backend/optimizer/plan/initsplan.c4
-rw-r--r--src/backend/optimizer/plan/planmain.c8
-rw-r--r--src/backend/optimizer/plan/setrefs.c40
-rw-r--r--src/backend/optimizer/plan/subselect.c2
-rw-r--r--src/backend/optimizer/prep/prepqual.c30
-rw-r--r--src/backend/optimizer/prep/preptlist.c8
-rw-r--r--src/backend/optimizer/prep/prepunion.c4
-rw-r--r--src/backend/optimizer/util/clauses.c24
-rw-r--r--src/backend/optimizer/util/indexnode.c6
-rw-r--r--src/backend/optimizer/util/joininfo.c6
-rw-r--r--src/backend/optimizer/util/pathnode.c16
-rw-r--r--src/backend/optimizer/util/plancat.c10
-rw-r--r--src/backend/optimizer/util/tlist.c4
-rw-r--r--src/backend/optimizer/util/var.c6
-rw-r--r--src/backend/parser/gram.c2
-rw-r--r--src/backend/parser/parse_agg.c4
-rw-r--r--src/backend/parser/parse_expr.c6
-rw-r--r--src/backend/parser/parse_func.c14
-rw-r--r--src/backend/parser/parse_oper.c26
-rw-r--r--src/backend/parser/parse_target.c18
-rw-r--r--src/backend/parser/parse_type.c8
-rw-r--r--src/backend/parser/parser.c18
-rw-r--r--src/backend/parser/scan.c4
-rw-r--r--src/backend/port/dynloader/bsd.c4
-rw-r--r--src/backend/port/dynloader/bsdi.c4
-rw-r--r--src/backend/port/dynloader/hpux.c4
-rw-r--r--src/backend/port/dynloader/linux.c6
-rw-r--r--src/backend/port/dynloader/ultrix4.c4
-rw-r--r--src/backend/port/strcasecmp.c6
-rw-r--r--src/backend/postmaster/postmaster.c4
-rw-r--r--src/backend/regex/engine.c8
-rw-r--r--src/backend/regex/regcomp.c4
-rw-r--r--src/backend/rewrite/locks.c6
-rw-r--r--src/backend/rewrite/rewriteDefine.c8
-rw-r--r--src/backend/rewrite/rewriteHandler.c12
-rw-r--r--src/backend/rewrite/rewriteManip.c10
-rw-r--r--src/backend/rewrite/rewriteSupport.c4
-rw-r--r--src/backend/storage/buffer/buf_table.c6
-rw-r--r--src/backend/storage/buffer/bufmgr.c22
-rw-r--r--src/backend/storage/buffer/freelist.c4
-rw-r--r--src/backend/storage/file/fd.c10
-rw-r--r--src/backend/storage/ipc/ipc.c12
-rw-r--r--src/backend/storage/ipc/shmem.c18
-rw-r--r--src/backend/storage/ipc/sinval.c10
-rw-r--r--src/backend/storage/ipc/sinvaladt.c12
-rw-r--r--src/backend/storage/ipc/spin.c4
-rw-r--r--src/backend/storage/large_object/inv_api.c6
-rw-r--r--src/backend/storage/lmgr/lmgr.c8
-rw-r--r--src/backend/storage/lmgr/lock.c24
-rw-r--r--src/backend/storage/lmgr/multi.c6
-rw-r--r--src/backend/storage/lmgr/proc.c21
-rw-r--r--src/backend/storage/page/bufpage.c8
-rw-r--r--src/backend/storage/smgr/md.c18
-rw-r--r--src/backend/tcop/fastpath.c10
-rw-r--r--src/backend/tcop/postgres.c10
-rw-r--r--src/backend/tcop/utility.c8
-rw-r--r--src/backend/tioga/Varray.c2
-rw-r--r--src/backend/tioga/tgRecipe.c4
-rw-r--r--src/backend/utils/adt/acl.c6
-rw-r--r--src/backend/utils/adt/arrayfuncs.c30
-rw-r--r--src/backend/utils/adt/cash.c6
-rw-r--r--src/backend/utils/adt/datetime.c6
-rw-r--r--src/backend/utils/adt/datum.c8
-rw-r--r--src/backend/utils/adt/dt.c66
-rw-r--r--src/backend/utils/adt/filename.c6
-rw-r--r--src/backend/utils/adt/geo_ops.c32
-rw-r--r--src/backend/utils/adt/nabstime.c4
-rw-r--r--src/backend/utils/adt/name.c4
-rw-r--r--src/backend/utils/adt/not_in.c6
-rw-r--r--src/backend/utils/adt/numutils.c4
-rw-r--r--src/backend/utils/adt/oidint2.c6
-rw-r--r--src/backend/utils/adt/oidint4.c6
-rw-r--r--src/backend/utils/adt/oracle_compat.c34
-rw-r--r--src/backend/utils/adt/regexp.c8
-rw-r--r--src/backend/utils/adt/regproc.c4
-rw-r--r--src/backend/utils/adt/selfuncs.c10
-rw-r--r--src/backend/utils/adt/varchar.c6
-rw-r--r--src/backend/utils/adt/varlena.c12
-rw-r--r--src/backend/utils/cache/catcache.c16
-rw-r--r--src/backend/utils/cache/fcache.c6
-rw-r--r--src/backend/utils/cache/inval.c10
-rw-r--r--src/backend/utils/cache/lsyscache.c4
-rw-r--r--src/backend/utils/cache/relcache.c18
-rw-r--r--src/backend/utils/cache/syscache.c42
-rw-r--r--src/backend/utils/error/elog.c4
-rw-r--r--src/backend/utils/fmgr/dfmgr.c20
-rw-r--r--src/backend/utils/fmgr/fmgr.c6
-rw-r--r--src/backend/utils/hash/dynahash.c28
-rw-r--r--src/backend/utils/init/findbe.c4
-rw-r--r--src/backend/utils/init/postinit.c8
-rw-r--r--src/backend/utils/misc/database.c4
-rw-r--r--src/backend/utils/mmgr/aset.c16
-rw-r--r--src/backend/utils/mmgr/mcxt.c10
-rw-r--r--src/backend/utils/mmgr/oset.c10
-rw-r--r--src/backend/utils/mmgr/portalmem.c4
-rw-r--r--src/backend/utils/sort/psort.c4
-rw-r--r--src/backend/utils/time/tqual.c4
-rw-r--r--src/bin/pg_dump/common.c8
-rw-r--r--src/bin/pg_dump/pg_dump.c16
-rw-r--r--src/bin/pg_id/pg_id.c4
-rw-r--r--src/bin/pgtclsh/pgtclAppInit.c4
-rw-r--r--src/bin/pgtclsh/pgtkAppInit.c6
-rw-r--r--src/bin/psql/psql.c30
-rw-r--r--src/interfaces/ecpg/lib/ecpglib.c2
-rw-r--r--src/interfaces/ecpg/preproc/type.c4
-rw-r--r--src/interfaces/libpgtcl/pgtclCmds.c20
-rw-r--r--src/interfaces/libpq/fe-auth.c4
-rw-r--r--src/interfaces/libpq/fe-connect.c44
-rw-r--r--src/interfaces/libpq/fe-exec.c16
-rw-r--r--src/interfaces/libpq/fe-lobj.c34
-rw-r--r--src/interfaces/libpq/fe-misc.c4
-rw-r--r--src/interfaces/libpq/fe-print.c6
-rw-r--r--src/interfaces/libpq/pqsignal.c4
-rw-r--r--src/pl/tcl/pltcl.c98
-rw-r--r--src/test/examples/testlibpq.c4
-rw-r--r--src/test/examples/testlibpq4.c4
-rw-r--r--src/test/examples/testlo.c10
-rw-r--r--src/test/examples/testlo2.c6
221 files changed, 220 insertions, 2465 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index ded94d0d8a3..ec5b756e748 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.37 1998/02/26 04:29:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.38 1998/06/15 19:27:44 momjian Exp $
*
* NOTES
* The old interface functions have been converted to macros
@@ -143,9 +143,7 @@ DataFill(char *data,
if (bit != NULL)
{
if (bitmask != CSIGNBIT)
- {
bitmask <<= 1;
- }
else
{
bitP += 1;
@@ -167,13 +165,9 @@ DataFill(char *data,
case -1:
*infomask |= HEAP_HASVARLENA;
if (att[i]->attalign == 'd')
- {
data = (char *) DOUBLEALIGN(data);
- }
else
- {
data = (char *) INTALIGN(data);
- }
data_length = VARSIZE(DatumGetPointer(value[i]));
memmove(data, DatumGetPointer(value[i]), data_length);
data += data_length;
@@ -239,9 +233,7 @@ heap_attisnull(HeapTuple tup, int attnum)
return (0);
if (attnum > 0)
- {
return (att_isnull(attnum - 1, tup->t_bits));
- }
else
switch (attnum)
{
@@ -513,9 +505,7 @@ nocachegetattr(HeapTuple tup,
tp + att[attnum]->attcacheoff);
}
else if (attnum == 0)
- {
return ((Datum) fetchatt(&(att[0]), (char *) tp));
- }
else if (!HeapTupleAllFixed(tup))
{
int j = 0;
diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c
index 521dda8d81b..181f362d94f 100644
--- a/src/backend/access/common/indextuple.c
+++ b/src/backend/access/common/indextuple.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.28 1998/02/26 04:29:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.29 1998/06/15 19:27:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -178,9 +178,7 @@ nocache_index_getattr(IndexTuple tup,
/* first attribute is always at position zero */
if (attnum == 1)
- {
return (Datum) fetchatt(&(att[0]), (char *) tup + data_off);
- }
if (att[attnum]->attcacheoff != -1)
{
return (Datum) fetchatt(&(att[attnum]),
@@ -260,9 +258,7 @@ nocache_index_getattr(IndexTuple tup,
tp + att[attnum]->attcacheoff);
}
else if (attnum == 0)
- {
return ((Datum) fetchatt(&(att[0]), (char *) tp));
- }
else if (!IndexTupleAllFixed(tup))
{
int j = 0;
@@ -482,9 +478,7 @@ CopyIndexTuple(IndexTuple source, IndexTuple *target)
size = IndexTupleSize(source);
if (*target == NULL)
- {
*target = (IndexTuple) palloc(size);
- }
ret = *target;
memmove((char *) ret, (char *) source, size);
diff --git a/src/backend/access/common/indexvalid.c b/src/backend/access/common/indexvalid.c
index c39cce4751a..b19b35c923d 100644
--- a/src/backend/access/common/indexvalid.c
+++ b/src/backend/access/common/indexvalid.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.18 1998/01/31 05:54:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.19 1998/06/15 19:27:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -61,9 +61,7 @@ index_keytest(IndexTuple tuple,
}
if (key[0].sk_flags & SK_ISNULL)
- {
return (false);
- }
if (key[0].sk_flags & SK_COMMUTE)
{
@@ -79,9 +77,7 @@ index_keytest(IndexTuple tuple,
}
if (!test == !(key[0].sk_flags & SK_NEGATE))
- {
return (false);
- }
scanKeySize -= 1;
key++;
diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c
index 5711d18dff3..39b6ebeb72a 100644
--- a/src/backend/access/common/tupdesc.c
+++ b/src/backend/access/common/tupdesc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.39 1998/04/26 04:05:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.40 1998/06/15 19:27:45 momjian Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -508,9 +508,7 @@ BuildDescForRelation(List *schema, char *relname)
* ----------------
*/
if (!strcmp(typename, relname))
- {
TupleDescMakeSelfReference(desc, attnum, relname);
- }
else
elog(ERROR, "DefineRelation: no such type %s",
typename);
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index a510dc8b203..dc2b57d4df2 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -632,9 +632,7 @@ gistAdjustKeys(Relation r,
pfree(datum);
}
else
- {
ReleaseBuffer(b);
- }
pfree(evec);
}
@@ -834,9 +832,7 @@ gistSplit(Relation r,
}
if ((bufblock = BufferGetBlockNumber(buffer)) != GISTP_ROOT)
- {
PageRestoreTempPage(left, p);
- }
WriteBuffer(leftbuf);
WriteBuffer(rightbuf);
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c
index de250987755..3832254af0b 100644
--- a/src/backend/access/gist/gistget.c
+++ b/src/backend/access/gist/gistget.c
@@ -52,13 +52,9 @@ gistgettuple(IndexScanDesc s, ScanDirection dir)
/* not cached, so we'll have to do some work */
if (ItemPointerIsValid(&(s->currentItemData)))
- {
res = gistnext(s, dir);
- }
else
- {
res = gistfirst(s, dir);
- }
return (res);
}
@@ -103,13 +99,9 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
maxoff = PageGetMaxOffsetNumber(p);
if (ScanDirectionIsBackward(dir))
- {
n = OffsetNumberPrev(stk->gs_child);
- }
else
- {
n = OffsetNumberNext(stk->gs_child);
- }
so->s_stack = stk->gs_parent;
pfree(stk);
@@ -163,13 +155,9 @@ gistnext(IndexScanDesc s, ScanDirection dir)
n = ItemPointerGetOffsetNumber(&(s->currentItemData));
if (ScanDirectionIsForward(dir))
- {
n = OffsetNumberNext(n);
- }
else
- {
n = OffsetNumberPrev(n);
- }
b = ReadBuffer(s->relation, blk);
p = BufferGetPage(b);
@@ -195,13 +183,9 @@ gistnext(IndexScanDesc s, ScanDirection dir)
po = (GISTPageOpaque) PageGetSpecialPointer(p);
if (ScanDirectionIsBackward(dir))
- {
n = OffsetNumberPrev(stk->gs_child);
- }
else
- {
n = OffsetNumberNext(stk->gs_child);
- }
so->s_stack = stk->gs_parent;
pfree(stk);
@@ -235,13 +219,9 @@ gistnext(IndexScanDesc s, ScanDirection dir)
po = (GISTPageOpaque) PageGetSpecialPointer(p);
if (ScanDirectionIsBackward(dir))
- {
n = PageGetMaxOffsetNumber(p);
- }
else
- {
n = FirstOffsetNumber;
- }
}
}
}
@@ -296,9 +276,7 @@ gistindex_keytest(IndexTuple tuple,
}
if (!test == !(key[0].sk_flags & SK_NEGATE))
- {
return (false);
- }
scanKeySize -= 1;
key++;
@@ -343,13 +321,9 @@ gistfindnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
break;
if (ScanDirectionIsBackward(dir))
- {
n = OffsetNumberPrev(n);
- }
else
- {
n = OffsetNumberNext(n);
- }
}
return (n);
@@ -405,9 +379,7 @@ gistheapptr(Relation r, ItemPointer itemp)
ReleaseBuffer(b);
}
else
- {
ItemPointerSetInvalid(ip);
- }
return (ip);
}
diff --git a/src/backend/access/gist/gistscan.c b/src/backend/access/gist/gistscan.c
index e5fa6b44a2d..7b9d49726ba 100644
--- a/src/backend/access/gist/gistscan.c
+++ b/src/backend/access/gist/gistscan.c
@@ -102,17 +102,11 @@ gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
* Set flags.
*/
if (RelationGetNumberOfBlocks(s->relation) == 0)
- {
s->flags = ScanUnmarked;
- }
else if (fromEnd)
- {
s->flags = ScanUnmarked | ScanUncheckedPrevious;
- }
else
- {
s->flags = ScanUnmarked | ScanUncheckedNext;
- }
s->scanFromEnd = fromEnd;
@@ -276,9 +270,7 @@ gistdropscan(IndexScanDesc s)
for (l = GISTScans;
l != (GISTScanList) NULL && l->gsl_scan != s;
l = l->gsl_next)
- {
prev = l;
- }
if (l == (GISTScanList) NULL)
elog(ERROR, "GiST scan list corrupted -- cannot find 0x%lx", s);
diff --git a/src/backend/access/hash/hashinsert.c b/src/backend/access/hash/hashinsert.c
index c72a5e6c1f8..8e70e456637 100644
--- a/src/backend/access/hash/hashinsert.c
+++ b/src/backend/access/hash/hashinsert.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.12 1998/01/07 21:00:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.13 1998/06/15 19:27:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -204,9 +204,7 @@ _hash_insertonpg(Relation rel,
if (do_expand ||
(metap->hashm_nkeys / (metap->hashm_maxbucket + 1))
> metap->hashm_ffactor)
- {
_hash_expandtable(rel, metabuf);
- }
_hash_relbuf(rel, metabuf, HASH_READ);
return (res);
}
diff --git a/src/backend/access/hash/hashovfl.c b/src/backend/access/hash/hashovfl.c
index 363d79a7462..54178179162 100644
--- a/src/backend/access/hash/hashovfl.c
+++ b/src/backend/access/hash/hashovfl.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.15 1998/01/07 21:01:00 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.16 1998/06/15 19:27:49 momjian Exp $
*
* NOTES
* Overflow pages look like ordinary relation pages.
@@ -64,9 +64,7 @@ _hash_addovflpage(Relation rel, Buffer *metabufp, Buffer buf)
/* allocate an empty overflow page */
oaddr = _hash_getovfladdr(rel, metabufp);
if (oaddr == InvalidOvflAddress)
- {
elog(ERROR, "_hash_addovflpage: problem with _hash_getovfladdr.");
- }
ovflblkno = OADDR_TO_BLKNO(OADDR_OF(SPLITNUM(oaddr), OPAGENUM(oaddr)));
Assert(BlockNumberIsValid(ovflblkno));
ovflbuf = _hash_getbuf(rel, ovflblkno, HASH_WRITE);
@@ -171,9 +169,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
if (offset > SPLITMASK)
{
if (++splitnum >= NCACHED)
- {
elog(ERROR, OVMSG);
- }
metap->OVFL_POINT = splitnum;
metap->SPARES[splitnum] = metap->SPARES[splitnum - 1];
metap->SPARES[splitnum - 1]--;
@@ -189,9 +185,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
free_page++;
if (free_page >= NCACHED)
- {
elog(ERROR, OVMSG);
- }
/*
* This is tricky. The 1 indicates that you want the new page
@@ -205,17 +199,13 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
*/
if (_hash_initbitmap(rel, metap, OADDR_OF(splitnum, offset),
1, free_page))
- {
elog(ERROR, "overflow_page: problem with _hash_initbitmap.");
- }
metap->SPARES[splitnum]++;
offset++;
if (offset > SPLITMASK)
{
if (++splitnum >= NCACHED)
- {
elog(ERROR, OVMSG);
- }
metap->OVFL_POINT = splitnum;
metap->SPARES[splitnum] = metap->SPARES[splitnum - 1];
metap->SPARES[splitnum - 1]--;
@@ -252,18 +242,14 @@ found:
bit = 1 + bit + (i * BMPGSZ_BIT(metap));
if (bit >= metap->LAST_FREED)
- {
metap->LAST_FREED = bit - 1;
- }
/* Calculate the split number for this page */
for (i = 0; (i < splitnum) && (bit > metap->SPARES[i]); i++)
;
offset = (i ? bit - metap->SPARES[i - 1] : bit);
if (offset >= SPLITMASK)
- {
elog(ERROR, OVMSG);
- }
/* initialize this page */
oaddr = OADDR_OF(i, offset);
@@ -381,9 +367,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
(splitnum ? metap->SPARES[splitnum - 1] : 0) + (addr & SPLITMASK) - 1;
if (ovflpgno < metap->LAST_FREED)
- {
metap->LAST_FREED = ovflpgno;
- }
bitmappage = (ovflpgno >> (metap->BSHIFT + BYTE_TO_BIT));
bitmapbit = ovflpgno & (BMPGSZ_BIT(metap) - 1);
@@ -403,13 +387,9 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
* return that buffer with a write lock.
*/
if (BlockNumberIsValid(nextblkno))
- {
return (_hash_getbuf(rel, nextblkno, HASH_WRITE));
- }
else
- {
return (InvalidBuffer);
- }
}
@@ -543,9 +523,7 @@ _hash_squeezebucket(Relation rel,
{
rblkno = ropaque->hasho_nextblkno;
if (ropaque != wopaque)
- {
_hash_relbuf(rel, rbuf, HASH_WRITE);
- }
rbuf = _hash_getbuf(rel, rblkno, HASH_WRITE);
rpage = BufferGetPage(rbuf);
_hash_checkpage(rpage, LH_OVERFLOW_PAGE);
@@ -621,9 +599,7 @@ _hash_squeezebucket(Relation rel,
*/
rbuf = _hash_freeovflpage(rel, rbuf);
if (BufferIsValid(rbuf))
- {
_hash_relbuf(rel, rbuf, HASH_WRITE);
- }
if (rblkno == wblkno)
{
diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c
index 8773e46c4bf..ebac11ed12e 100644
--- a/src/backend/access/hash/hashpage.c
+++ b/src/backend/access/hash/hashpage.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.15 1998/01/07 21:01:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.16 1998/06/15 19:27:49 momjian Exp $
*
* NOTES
* Postgres hash pages look like ordinary relation pages. The opaque
@@ -106,9 +106,7 @@ _hash_metapinit(Relation rel)
if ((1 << i) < (metap->hashm_bsize -
(DOUBLEALIGN(sizeof(PageHeaderData)) +
DOUBLEALIGN(sizeof(HashPageOpaqueData)))))
- {
break;
- }
}
Assert(i);
metap->hashm_bmsize = 1 << i;
@@ -191,9 +189,7 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
Buffer buf;
if (blkno == P_NEW)
- {
elog(ERROR, "_hash_getbuf: internal error: hash AM does not use P_NEW");
- }
switch (access)
{
case HASH_WRITE:
@@ -395,14 +391,10 @@ _hash_pagedel(Relation rel, ItemPointer tid)
{
buf = _hash_freeovflpage(rel, buf);
if (BufferIsValid(buf))
- {
_hash_relbuf(rel, buf, HASH_WRITE);
- }
}
else
- {
_hash_relbuf(rel, buf, HASH_WRITE);
- }
metabuf = _hash_getbuf(rel, HASH_METAPAGE, HASH_WRITE);
metap = (HashMetaPage) BufferGetPage(metabuf);
@@ -545,9 +537,7 @@ _hash_splitpage(Relation rel,
opage = BufferGetPage(obuf);
_hash_checkpage(opage, LH_OVERFLOW_PAGE);
if (PageIsEmpty(opage))
- {
elog(ERROR, "_hash_splitpage: empty overflow page %d", oblkno);
- }
oopaque = (HashPageOpaque) PageGetSpecialPointer(opage);
}
diff --git a/src/backend/access/hash/hashscan.c b/src/backend/access/hash/hashscan.c
index 848f8d9e1b4..708dc18943e 100644
--- a/src/backend/access/hash/hashscan.c
+++ b/src/backend/access/hash/hashscan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.13 1998/01/07 21:01:13 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.14 1998/06/15 19:27:50 momjian Exp $
*
* NOTES
* Because we can be doing an index scan on a relation while we
@@ -71,9 +71,7 @@ _hash_dropscan(IndexScanDesc scan)
for (chk = HashScans;
chk != (HashScanList) NULL && chk->hashsl_scan != scan;
chk = chk->hashsl_next)
- {
last = chk;
- }
if (chk == (HashScanList) NULL)
elog(ERROR, "hash scan list trashed; can't find 0x%lx", scan);
diff --git a/src/backend/access/hash/hashsearch.c b/src/backend/access/hash/hashsearch.c
index 0ebb301c877..a3d56190605 100644
--- a/src/backend/access/hash/hashsearch.c
+++ b/src/backend/access/hash/hashsearch.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.14 1997/09/08 21:40:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.15 1998/06/15 19:27:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -49,9 +49,7 @@ _hash_search(Relation rel,
bucket = 0;
}
else
- {
bucket = _hash_call(rel, metap, keyDatum);
- }
blkno = BUCKET_TO_BLKNO(bucket);
@@ -109,9 +107,7 @@ _hash_next(IndexScanDesc scan, ScanDirection dir)
* next tuple, we come back with a lock on that buffer.
*/
if (!_hash_step(scan, &buf, dir, metabuf))
- {
return ((RetrieveIndexResult) NULL);
- }
/* if we're here, _hash_step found a valid tuple */
current = &(scan->currentItemData);
@@ -225,9 +221,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
if (PageIsEmpty(page))
{
if (BlockNumberIsValid(opaque->hasho_nextblkno))
- {
_hash_readnext(rel, &buf, &page, &opaque);
- }
else
{
ItemPointerSetInvalid(current);
@@ -249,15 +243,11 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
if (ScanDirectionIsBackward(dir))
{
while (BlockNumberIsValid(opaque->hasho_nextblkno))
- {
_hash_readnext(rel, &buf, &page, &opaque);
- }
}
if (!_hash_step(scan, &buf, dir, metabuf))
- {
return ((RetrieveIndexResult) NULL);
- }
/* if we're here, _hash_step found a valid tuple */
current = &(scan->currentItemData);
@@ -321,13 +311,9 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf)
*/
maxoff = PageGetMaxOffsetNumber(page);
if (ItemPointerIsValid(current))
- {
offnum = ItemPointerGetOffsetNumber(current);
- }
else
- {
offnum = InvalidOffsetNumber;
- }
/*
* 'offnum' now points to the last tuple we have seen (if any).
@@ -371,9 +357,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf)
Assert(opaque->hasho_bucket == bucket);
while (PageIsEmpty(page) &&
BlockNumberIsValid(opaque->hasho_nextblkno))
- {
_hash_readnext(rel, &buf, &page, &opaque);
- }
maxoff = PageGetMaxOffsetNumber(page);
offnum = FirstOffsetNumber;
}
@@ -420,9 +404,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf)
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
Assert(opaque->hasho_bucket == bucket);
while (BlockNumberIsValid(opaque->hasho_nextblkno))
- {
_hash_readnext(rel, &buf, &page, &opaque);
- }
maxoff = offnum = PageGetMaxOffsetNumber(page);
}
else
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 6bb6f387181..d246f79151b 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.27 1998/02/26 04:29:31 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.28 1998/06/15 19:27:51 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -168,9 +168,7 @@ static void
unpinsdesc(HeapScanDesc sdesc)
{
if (BufferIsValid(sdesc->rs_pbuf))
- {
ReleaseBuffer(sdesc->rs_pbuf);
- }
/* ------------------------------------
* Scan will pin buffer one for each non-NULL tuple pointer
@@ -179,14 +177,10 @@ unpinsdesc(HeapScanDesc sdesc)
* ------------------------------------
*/
if (BufferIsValid(sdesc->rs_cbuf))
- {
ReleaseBuffer(sdesc->rs_cbuf);
- }
if (BufferIsValid(sdesc->rs_nbuf))
- {
ReleaseBuffer(sdesc->rs_nbuf);
- }
}
/* ------------------------------------------
@@ -262,9 +256,7 @@ heapgettup(Relation relation,
#endif /* !defined(HEAPDEBUGALL) */
if (!ItemPointerIsValid(tid))
- {
Assert(!PointerIsValid(tid));
- }
/* ----------------
* return null immediately if relation is empty
@@ -313,9 +305,7 @@ heapgettup(Relation relation,
* ----------------
*/
if (ItemPointerIsValid(tid) == false)
- {
tid = NULL;
- }
if (tid == NULL)
{
page = pages - 1; /* final page */
@@ -333,9 +323,7 @@ heapgettup(Relation relation,
*b = RelationGetBufferWithBuffer(relation, page, *b);
#ifndef NO_BUFFERISVALID
if (!BufferIsValid(*b))
- {
elog(ERROR, "heapgettup: failed ReadBuffer");
- }
#endif
dp = (Page) BufferGetPage(*b);
@@ -380,9 +368,7 @@ heapgettup(Relation relation,
*b = RelationGetBufferWithBuffer(relation, page, *b);
#ifndef NO_BUFFERISVALID
if (!BufferIsValid(*b))
- {
elog(ERROR, "heapgettup: failed ReadBuffer");
- }
#endif
dp = (Page) BufferGetPage(*b);
@@ -398,13 +384,9 @@ heapgettup(Relation relation,
*/
lpp = PageGetItemId(dp, lineoff);
if (dir < 0)
- {
linesleft = lineoff - 1;
- }
else
- {
linesleft = lines - lineoff;
- }
/* ----------------
* advance the scan until we find a qualifying tuple or
@@ -476,21 +458,15 @@ heapgettup(Relation relation,
#ifndef NO_BUFFERISVALID
if (!BufferIsValid(*b))
- {
elog(ERROR, "heapgettup: failed ReadBuffer");
- }
#endif
dp = (Page) BufferGetPage(*b);
lines = lineoff = PageGetMaxOffsetNumber((Page) dp);
linesleft = lines - 1;
if (dir < 0)
- {
lpp = PageGetItemId(dp, lineoff);
- }
else
- {
lpp = PageGetItemId(dp, FirstOffsetNumber);
- }
}
}
@@ -544,9 +520,7 @@ heap_open(Oid relationId)
r = (Relation) RelationIdGetRelation(relationId);
if (RelationIsValid(r) && r->rd_rel->relkind == RELKIND_INDEX)
- {
elog(ERROR, "%s is an index relation", r->rd_rel->relname.data);
- }
return (r);
}
@@ -573,9 +547,7 @@ heap_openr(char *relationName)
r = RelationNameGetRelation(relationName);
if (RelationIsValid(r) && r->rd_rel->relkind == RELKIND_INDEX)
- {
elog(ERROR, "%s is an index relation", r->rd_rel->relname.data);
- }
return (r);
}
@@ -1094,9 +1066,7 @@ heap_fetch(Relation relation,
*/
if (PointerIsValid(b))
- {
*b = buffer;
- }
else
{
tuple = heap_copytuple(tuple);
@@ -1402,9 +1372,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
* ----------------
*/
if ((unsigned) DOUBLEALIGN(tup->t_len) <= PageGetFreeSpace((Page) dp))
- {
RelationPutHeapTuple(relation, BufferGetBlockNumber(buffer), tup);
- }
else
{
/* ----------------
@@ -1500,29 +1468,17 @@ heap_markpos(HeapScanDesc sdesc)
* ----------------
*/
if (sdesc->rs_ptup != NULL)
- {
sdesc->rs_mptid = sdesc->rs_ptup->t_ctid;
- }
else
- {
ItemPointerSetInvalid(&sdesc->rs_mptid);
- }
if (sdesc->rs_ctup != NULL)
- {
sdesc->rs_mctid = sdesc->rs_ctup->t_ctid;
- }
else
- {
ItemPointerSetInvalid(&sdesc->rs_mctid);
- }
if (sdesc->rs_ntup != NULL)
- {
sdesc->rs_mntid = sdesc->rs_ntup->t_ctid;
- }
else
- {
ItemPointerSetInvalid(&sdesc->rs_mntid);
- }
}
/* ----------------
@@ -1568,9 +1524,7 @@ heap_restrpos(HeapScanDesc sdesc)
sdesc->rs_nbuf = InvalidBuffer;
if (!ItemPointerIsValid(&sdesc->rs_mptid))
- {
sdesc->rs_ptup = NULL;
- }
else
{
sdesc->rs_ptup = (HeapTuple)
@@ -1584,9 +1538,7 @@ heap_restrpos(HeapScanDesc sdesc)
}
if (!ItemPointerIsValid(&sdesc->rs_mctid))
- {
sdesc->rs_ctup = NULL;
- }
else
{
sdesc->rs_ctup = (HeapTuple)
@@ -1600,9 +1552,7 @@ heap_restrpos(HeapScanDesc sdesc)
}
if (!ItemPointerIsValid(&sdesc->rs_mntid))
- {
sdesc->rs_ntup = NULL;
- }
else
{
sdesc->rs_ntup = (HeapTuple)
diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c
index 7fc9607b441..229ca5d1a27 100644
--- a/src/backend/access/index/genam.c
+++ b/src/backend/access/index/genam.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.11 1998/01/07 21:01:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.12 1998/06/15 19:27:53 momjian Exp $
*
* NOTES
* many of the old access method routines have been turned into
@@ -117,13 +117,9 @@ RelationGetIndexScan(Relation relation,
ItemPointerSetInvalid(&scan->nextMarkData);
if (numberOfKeys > 0)
- {
scan->keyData = (ScanKey) palloc(sizeof(ScanKeyData) * numberOfKeys);
- }
else
- {
scan->keyData = NULL;
- }
index_rescan(scan, scanFromEnd, key);
@@ -224,13 +220,9 @@ IndexScanMarkPosition(IndexScanDesc scan)
index_getnext(scan, BackwardScanDirection);
if (result != NULL)
- {
scan->previousItemData = result->index_iptr;
- }
else
- {
ItemPointerSetInvalid(&scan->previousItemData);
- }
}
else if (scan->flags & ScanUncheckedNext)
@@ -239,13 +231,9 @@ IndexScanMarkPosition(IndexScanDesc scan)
index_getnext(scan, ForwardScanDirection);
if (result != NULL)
- {
scan->nextItemData = result->index_iptr;
- }
else
- {
ItemPointerSetInvalid(&scan->nextItemData);
- }
}
scan->previousMarkData = scan->previousItemData;
diff --git a/src/backend/access/index/istrat.c b/src/backend/access/index/istrat.c
index d7953a1cd8e..b0b0cdc452d 100644
--- a/src/backend/access/index/istrat.c
+++ b/src/backend/access/index/istrat.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.19 1998/04/27 04:04:09 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.20 1998/06/15 19:27:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -309,9 +309,7 @@ RelationGetStrategy(Relation relation,
for (index = 0; index < evaluation->maxStrategy; index += 1)
{
if (strategyMap->entry[index].sk_procedure == procedure)
- {
break;
- }
}
if (index == evaluation->maxStrategy)
@@ -347,9 +345,7 @@ RelationGetStrategy(Relation relation,
if (!StrategyNumberIsInBounds(strategy, evaluation->maxStrategy))
{
if (!StrategyNumberIsValid(strategy))
- {
elog(ERROR, "RelationGetStrategy: corrupted evaluation");
- }
}
return strategy;
@@ -465,9 +461,7 @@ RelationInvokeStrategy(Relation relation,
(*termP)->operatorData[index].strategy);
if (!RegProcedureIsValid(entry->sk_procedure))
- {
break;
- }
}
if (index == (*termP)->degree)
@@ -582,9 +576,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
if (!OidIsValid(iform->indkey[attributeIndex]))
{
if (attributeIndex == 0)
- {
elog(ERROR, "IndexSupportInitialize: no pg_index tuple");
- }
break;
}
@@ -621,9 +613,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
loc = &indexSupport[((attributeNumber - 1) * maxSupportNumber)];
for (support = maxSupportNumber; --support >= 0;)
- {
loc[support] = InvalidOid;
- }
entry[1].sk_argument =
ObjectIdGetDatum(operatorClassObjectId[attributeNumber - 1]);
diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c
index b00dae99a0c..350e198514b 100644
--- a/src/backend/access/nbtree/nbtinsert.c
+++ b/src/backend/access/nbtree/nbtinsert.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.25 1998/01/15 19:42:10 pgsql Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.26 1998/06/15 19:27:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -127,9 +127,7 @@ _bt_doinsert(Relation rel, BTItem btitem, bool index_is_unique, Relation heapRel
}
/* get next offnum */
if (offset < maxoff)
- {
offset = OffsetNumberNext(offset);
- }
else
{ /* move right ? */
if (P_RIGHTMOST(opaque))
@@ -906,13 +904,9 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright)
*/
if (P_RIGHTMOST(ropaque))
- {
itemid = PageGetItemId(rightpage, P_HIKEY);
- }
else
- {
itemid = PageGetItemId(rightpage, P_FIRSTKEY);
- }
itemsz = ItemIdGetLength(itemid);
item = (BTItem) PageGetItem(rightpage, itemid);
@@ -1178,9 +1172,7 @@ _bt_pgaddtup(Relation rel,
first = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
if (afteritem == (BTItem) NULL)
- {
itup_off = _bt_binsrch(rel, buf, keysz, itup_scankey, BT_INSERTION);
- }
else
{
itup_off = first;
@@ -1358,9 +1350,7 @@ _bt_itemcmp(Relation rel,
compare = (strat == BTLessStrategyNumber) ? true : false;
}
else
- {
compare = _bt_invokestrat(rel, i, strat, attrDatum1, attrDatum2);
- }
if (compare) /* true for one of ">, <, =" */
{
@@ -1430,9 +1420,7 @@ _bt_updateitem(Relation rel,
/* this should never happen (in theory) */
if (!BTItemSame(item, oldItem))
- {
elog(FATAL, "_bt_getstackbuf was lying!!");
- }
/*
* It's defined by caller (_bt_insertonpg)
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 72e0731edd3..b4d1185a601 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.25 1998/02/26 04:29:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.26 1998/06/15 19:27:56 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
@@ -267,20 +267,14 @@ btbuild(Relation heap,
* into the btree.
*/
if (usefast)
- {
_bt_spool(index, btitem, spool);
- }
else
- {
res = _bt_doinsert(index, btitem, isunique, heap);
- }
pfree(btitem);
pfree(itup);
if (res)
- {
pfree(res);
- }
}
/* okay, all heap tuples are indexed */
diff --git a/src/backend/access/nbtree/nbtscan.c b/src/backend/access/nbtree/nbtscan.c
index a7ae57f91a8..8fc6e736c69 100644
--- a/src/backend/access/nbtree/nbtscan.c
+++ b/src/backend/access/nbtree/nbtscan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.13 1998/02/28 13:53:18 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.14 1998/06/15 19:27:57 momjian Exp $
*
*
* NOTES
@@ -72,9 +72,7 @@ _bt_dropscan(IndexScanDesc scan)
for (chk = BTScans;
chk != (BTScanList) NULL && chk->btsl_scan != scan;
chk = chk->btsl_next)
- {
last = chk;
- }
if (chk == (BTScanList) NULL)
elog(ERROR, "btree scan list trashed; can't find 0x%lx", scan);
diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c
index d11874d56d2..633a310ea1a 100644
--- a/src/backend/access/nbtree/nbtsearch.c
+++ b/src/backend/access/nbtree/nbtsearch.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.35 1998/05/13 03:44:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.36 1998/06/15 19:27:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -541,9 +541,7 @@ _bt_firsteq(Relation rel,
while (offnum > limit
&& _bt_compare(rel, itupdesc, page,
keysz, scankey, OffsetNumberPrev(offnum)) == 0)
- {
offnum = OffsetNumberPrev(offnum);
- }
return (offnum);
}
@@ -616,9 +614,7 @@ _bt_compare(Relation rel,
* - see new comments above...
*/
if (!P_RIGHTMOST(opaque))
- {
elog(ERROR, "_bt_compare: invalid comparison to high key");
- }
#if 0
@@ -634,9 +630,7 @@ _bt_compare(Relation rel,
if (_bt_skeycmp(rel, keysz, scankey, page, itemid,
BTEqualStrategyNumber))
- {
return (0);
- }
return (1);
#endif
}
@@ -676,9 +670,7 @@ _bt_compare(Relation rel,
tmpres = (long) -1; /* NOT_NULL "<" NULL */
}
else
- {
tmpres = (long) FMGR_PTR2(&entry->sk_func, entry->sk_argument, datum);
- }
result = tmpres;
/* if the keys are unequal, return the difference */
@@ -1090,9 +1082,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
if (ScanDirectionIsForward(dir))
{
if (!PageIsEmpty(page) && offnum < maxoff)
- {
offnum = OffsetNumberNext(offnum);
- }
else
{
@@ -1119,9 +1109,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
start = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
if (!PageIsEmpty(page) && start <= maxoff)
- {
break;
- }
else
{
blkno = opaque->btpo_next;
@@ -1145,9 +1133,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
start = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
if (offnum > start)
- {
offnum = OffsetNumberPrev(offnum);
- }
else
{
@@ -1196,9 +1182,7 @@ _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
/* anything to look at here? */
if (!PageIsEmpty(page) && maxoff >= start)
- {
break;
- }
else
{
blkno = opaque->btpo_prev;
@@ -1278,13 +1262,9 @@ _bt_twostep(IndexScanDesc scan, Buffer *bufP, ScanDirection dir)
/* if we've hit end of scan we don't have to do any work */
if (ScanDirectionIsForward(dir) && P_RIGHTMOST(opaque))
- {
return (false);
- }
else if (ScanDirectionIsBackward(dir) && P_LEFTMOST(opaque))
- {
return (false);
- }
/*
* Okay, it's off the page; let _bt_step() do the hard work, and we'll
@@ -1371,13 +1351,9 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
break;
if (ScanDirectionIsForward(dir))
- {
offnum = P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY;
- }
else
- {
offnum = PageGetMaxOffsetNumber(page);
- }
btitem = (BTItem) PageGetItem(page, PageGetItemId(page, offnum));
itup = &(btitem->bti_itup);
@@ -1461,9 +1437,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
}
/* new stuff ends here */
else
- {
ItemPointerSet(current, blkno, start);
- }
}
else if (ScanDirectionIsBackward(dir))
{
@@ -1510,9 +1484,7 @@ _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
}
}
else
- {
elog(ERROR, "Illegal scan direction %d", dir);
- }
btitem = (BTItem) PageGetItem(page, PageGetItemId(page, start));
itup = &(btitem->bti_itup);
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index b6f7b337a95..12effb71eb4 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -5,7 +5,7 @@
*
*
* IDENTIFICATION
- * $Id: nbtsort.c,v 1.29 1998/02/26 04:29:54 momjian Exp $
+ * $Id: nbtsort.c,v 1.30 1998/06/15 19:27:59 momjian Exp $
*
* NOTES
*
@@ -288,9 +288,7 @@ _bt_pqsift(BTPriQueue *q, int parent)
if (child < q->btpq_nelem - 1)
{
if (GREATER(&(q->btpq_queue[child]), &(q->btpq_queue[child + 1])))
- {
++child;
- }
}
if (GREATER(&(q->btpq_queue[parent]), &(q->btpq_queue[child])))
{
@@ -300,9 +298,7 @@ _bt_pqsift(BTPriQueue *q, int parent)
parent = child;
}
else
- {
parent = child + 1;
- }
}
}
@@ -331,18 +327,14 @@ _bt_pqadd(BTPriQueue *q, BTPriQueueElem *e)
parent;
if (q->btpq_nelem >= MAXELEM)
- {
elog(ERROR, "_bt_pqadd: queue overflow");
- }
child = q->btpq_nelem++;
while (child > 0)
{
parent = child / 2;
if (GREATER(e, &(q->btpq_queue[parent])))
- {
break;
- }
else
{
q->btpq_queue[child] = q->btpq_queue[parent]; /* struct = */
@@ -424,9 +416,7 @@ _bt_tapecreate(char *fname)
BTTapeBlock *tape = (BTTapeBlock *) palloc(sizeof(BTTapeBlock));
if (tape == (BTTapeBlock *) NULL)
- {
elog(ERROR, "_bt_tapecreate: out of memory");
- }
tape->bttb_magic = BTTAPEMAGIC;
@@ -516,9 +506,7 @@ _bt_tapenext(BTTapeBlock *tape, char **pos)
BTItem bti;
if (*pos >= tape->bttb_data + tape->bttb_top)
- {
return ((BTItem) NULL);
- }
bti = (BTItem) *pos;
itemsz = BTITEMSZ(bti);
*pos += DOUBLEALIGN(itemsz);
@@ -561,9 +549,7 @@ _bt_spoolinit(Relation index, int ntapes, bool isunique)
char *fname = (char *) palloc(sizeof(TAPETEMP) + 1);
if (btspool == (BTSpool *) NULL || fname == (char *) NULL)
- {
elog(ERROR, "_bt_spoolinit: out of memory");
- }
MemSet((char *) btspool, 0, sizeof(BTSpool));
btspool->bts_ntapes = ntapes;
btspool->bts_tape = 0;
@@ -575,9 +561,7 @@ _bt_spoolinit(Relation index, int ntapes, bool isunique)
(BTTapeBlock **) palloc(sizeof(BTTapeBlock *) * ntapes);
if (btspool->bts_itape == (BTTapeBlock **) NULL ||
btspool->bts_otape == (BTTapeBlock **) NULL)
- {
elog(ERROR, "_bt_spoolinit: out of memory");
- }
for (i = 0; i < ntapes; ++i)
{
@@ -621,9 +605,7 @@ _bt_spoolflush(BTSpool *btspool)
for (i = 0; i < btspool->bts_ntapes; ++i)
{
if (!EMPTYTAPE(btspool->bts_otape[i]))
- {
_bt_tapewrite(btspool->bts_otape[i], 1);
- }
}
}
@@ -716,9 +698,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
(BTSortKey *) palloc(it_ntup * sizeof(BTSortKey));
pos = itape->bttb_data;
for (i = 0; i < it_ntup; ++i)
- {
_bt_setsortkey(index, _bt_tapenext(itape, &pos), &(parray[i]));
- }
/*
* qsort the pointer array.
@@ -790,9 +770,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
/* insert this item into the current buffer */
if (btitem != (BTItem) NULL)
- {
_bt_tapeadd(itape, btitem, itemsz);
- }
}
/*
@@ -1008,9 +986,7 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags)
* shuffling).
*/
for (o = last_off; o > first_off; o = OffsetNumberPrev(o))
- {
PageIndexTupleDelete(opage, o);
- }
hii = PageGetItemId(opage, P_HIKEY);
ii = PageGetItemId(opage, first_off);
*hii = *ii;
@@ -1085,14 +1061,10 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags)
#endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */
#endif
if (last_bti == (BTItem) NULL)
- {
first_off = P_FIRSTKEY;
- }
else if (!_bt_itemcmp(index, _bt_nattr,
bti, last_bti, BTEqualStrategyNumber))
- {
first_off = off;
- }
last_off = off;
last_bti = (BTItem) PageGetItem(npage, PageGetItemId(npage, off));
@@ -1226,9 +1198,7 @@ _bt_merge(Relation index, BTSpool *btspool)
do
{
if (_bt_taperead(itape) == 0)
- {
tapedone[t] = 1;
- }
} while (!tapedone[t] && EMPTYTAPE(itape));
if (!tapedone[t])
{
@@ -1237,9 +1207,7 @@ _bt_merge(Relation index, BTSpool *btspool)
_bt_setsortkey(index, _bt_tapenext(itape, &tapepos[t]),
&(e.btpqe_item));
if (e.btpqe_item.btsk_item != (BTItem) NULL)
- {
_bt_pqadd(&q, &e);
- }
}
}
@@ -1334,9 +1302,7 @@ _bt_merge(Relation index, BTSpool *btspool)
do
{
if (_bt_taperead(itape) == 0)
- {
tapedone[t] = 1;
- }
} while (!tapedone[t] && EMPTYTAPE(itape));
if (!tapedone[t])
{
@@ -1372,9 +1338,7 @@ _bt_merge(Relation index, BTSpool *btspool)
* pages instead of merging into a tape file.
*/
if (nruns <= btspool->bts_ntapes)
- {
doleaf = true;
- }
} while (nruns > 0); /* pass */
_bt_uppershutdown(index, state);
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c
index 652f1c69782..f4fd602898c 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.19 1998/04/27 04:04:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.20 1998/06/15 19:27:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -157,9 +157,7 @@ _bt_orderkeys(Relation relation, BTScanOpaque so)
if (i == numberOfKeys || cur->sk_attno != attno)
{
if (cur->sk_attno != attno + 1 && i < numberOfKeys)
- {
elog(ERROR, "_bt_orderkeys: key(s) for attribute %d missed", attno + 1);
- }
/*
* If = has been specified, no other key will be used. In case
@@ -373,9 +371,7 @@ _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok)
/* btree doesn't support 'A is null' clauses, yet */
if (isNull || key[0].sk_flags & SK_ISNULL)
- {
return (false);
- }
if (key[0].sk_flags & SK_COMMUTE)
{
@@ -391,9 +387,7 @@ _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok)
}
if (!test == !(key[0].sk_flags & SK_NEGATE))
- {
return (false);
- }
keysz -= 1;
key++;
diff --git a/src/backend/access/rtree/rtget.c b/src/backend/access/rtree/rtget.c
index 6a13b81a1f9..eb9d43943ed 100644
--- a/src/backend/access/rtree/rtget.c
+++ b/src/backend/access/rtree/rtget.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.9 1997/09/08 02:21:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtget.c,v 1.10 1998/06/15 19:28:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,13 +47,9 @@ rtgettuple(IndexScanDesc s, ScanDirection dir)
/* not cached, so we'll have to do some work */
if (ItemPointerIsValid(&(s->currentItemData)))
- {
res = rtnext(s, dir);
- }
else
- {
res = rtfirst(s, dir);
- }
return (res);
}
@@ -98,13 +94,9 @@ rtfirst(IndexScanDesc s, ScanDirection dir)
maxoff = PageGetMaxOffsetNumber(p);
if (ScanDirectionIsBackward(dir))
- {
n = OffsetNumberPrev(stk->rts_child);
- }
else
- {
n = OffsetNumberNext(stk->rts_child);
- }
so->s_stack = stk->rts_parent;
pfree(stk);
@@ -158,13 +150,9 @@ rtnext(IndexScanDesc s, ScanDirection dir)
n = ItemPointerGetOffsetNumber(&(s->currentItemData));
if (ScanDirectionIsForward(dir))
- {
n = OffsetNumberNext(n);
- }
else
- {
n = OffsetNumberPrev(n);
- }
b = ReadBuffer(s->relation, blk);
p = BufferGetPage(b);
@@ -190,13 +178,9 @@ rtnext(IndexScanDesc s, ScanDirection dir)
po = (RTreePageOpaque) PageGetSpecialPointer(p);
if (ScanDirectionIsBackward(dir))
- {
n = OffsetNumberPrev(stk->rts_child);
- }
else
- {
n = OffsetNumberNext(stk->rts_child);
- }
so->s_stack = stk->rts_parent;
pfree(stk);
@@ -230,13 +214,9 @@ rtnext(IndexScanDesc s, ScanDirection dir)
po = (RTreePageOpaque) PageGetSpecialPointer(p);
if (ScanDirectionIsBackward(dir))
- {
n = PageGetMaxOffsetNumber(p);
- }
else
- {
n = FirstOffsetNumber;
- }
}
}
}
@@ -283,13 +263,9 @@ findnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
}
if (ScanDirectionIsBackward(dir))
- {
n = OffsetNumberPrev(n);
- }
else
- {
n = OffsetNumberNext(n);
- }
}
return (n);
@@ -345,9 +321,7 @@ rtheapptr(Relation r, ItemPointer itemp)
ReleaseBuffer(b);
}
else
- {
ItemPointerSetInvalid(ip);
- }
return (ip);
}
diff --git a/src/backend/access/rtree/rtree.c b/src/backend/access/rtree/rtree.c
index 4968162f761..57217b050b3 100644
--- a/src/backend/access/rtree/rtree.c
+++ b/src/backend/access/rtree/rtree.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.23 1998/02/26 04:30:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.24 1998/06/15 19:28:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -450,9 +450,7 @@ rttighten(Relation r,
memmove(oldud, datum, VARSIZE(datum));
}
else
- {
memmove(oldud, datum, att_size);
- }
WriteBuffer(b);
/*
@@ -467,9 +465,7 @@ rttighten(Relation r,
pfree(tdatum);
}
else
- {
ReleaseBuffer(b);
- }
pfree(datum);
}
@@ -587,9 +583,7 @@ dosplit(Relation r,
}
if ((bufblock = BufferGetBlockNumber(buffer)) != P_ROOT)
- {
PageRestoreTempPage(left, p);
- }
WriteBuffer(leftbuf);
WriteBuffer(rightbuf);
@@ -842,13 +836,9 @@ picksplit(Relation r,
/* okay, which page needs least enlargement? */
if (i == maxoff)
- {
item_1 = itup;
- }
else
- {
item_1 = (IndexTuple) PageGetItem(page, PageGetItemId(page, i));
- }
datum_alpha = ((char *) item_1) + sizeof(IndexTupleData);
union_dl = (char *) (*fmgr_faddr(&rtstate->unionFn)) (datum_l, datum_alpha);
diff --git a/src/backend/access/rtree/rtscan.c b/src/backend/access/rtree/rtscan.c
index 2d47500e982..672d0e2005f 100644
--- a/src/backend/access/rtree/rtscan.c
+++ b/src/backend/access/rtree/rtscan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.15 1998/01/07 21:02:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.16 1998/06/15 19:28:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -104,17 +104,11 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
* Set flags.
*/
if (RelationGetNumberOfBlocks(s->relation) == 0)
- {
s->flags = ScanUnmarked;
- }
else if (fromEnd)
- {
s->flags = ScanUnmarked | ScanUncheckedPrevious;
- }
else
- {
s->flags = ScanUnmarked | ScanUncheckedNext;
- }
s->scanFromEnd = fromEnd;
@@ -133,9 +127,7 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
p->s_stack = p->s_markstk = (RTSTACK *) NULL;
p->s_flags = 0x0;
for (i = 0; i < s->numberOfKeys; i++)
- {
p->s_internalKey[i].sk_argument = s->keyData[i].sk_argument;
- }
}
else
{
@@ -279,9 +271,7 @@ rtdropscan(IndexScanDesc s)
for (l = RTScans;
l != (RTScanList) NULL && l->rtsl_scan != s;
l = l->rtsl_next)
- {
prev = l;
- }
if (l == (RTScanList) NULL)
elog(ERROR, "rtree scan list corrupted -- cannot find 0x%lx", s);
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index a88bd514b9f..fb888640a99 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.19 1998/01/07 21:02:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.20 1998/06/15 19:28:02 momjian Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
@@ -1450,9 +1450,7 @@ IsTransactionBlock()
if (s->blockState == TBLOCK_INPROGRESS
|| s->blockState == TBLOCK_ENDABORT)
- {
return (true);
- }
return (false);
}
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index d2e6fff5bbd..85afd787468 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.42 1998/05/29 17:00:05 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.43 1998/06/15 19:28:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -349,13 +349,9 @@ BootstrapMain(int argc, char *argv[])
} /* while */
if (argc - optind > 1)
- {
usage();
- }
else if (argc - optind == 1)
- {
dbName = argv[optind];
- }
if (!DataDir)
{
@@ -485,9 +481,7 @@ boot_openrel(char *relname)
}
if (reldesc != NULL)
- {
closerel(NULL);
- }
if (!Quiet)
printf("Amopen: relation %s. attrsize %d\n", relname ? relname : "(null)",
@@ -499,9 +493,7 @@ boot_openrel(char *relname)
for (i = 0; i < numattr; i++)
{
if (attrtypes[i] == NULL)
- {
attrtypes[i] = AllocateAttribute();
- }
memmove((char *) attrtypes[i],
(char *) reldesc->rd_att->attrs[i],
ATTRIBUTE_TUPLE_SIZE);
@@ -553,9 +545,7 @@ closerel(char *name)
}
if (reldesc == NULL)
- {
elog(ERROR, "Warning: no opened relation to close.\n");
- }
else
{
if (!Quiet)
@@ -639,9 +629,7 @@ InsertOneTuple(Oid objectid)
pfree(tupDesc); /* just free's tupDesc, not the attrtypes */
if (objectid != (Oid) 0)
- {
tuple->t_oid = objectid;
- }
heap_insert(reldesc, tuple);
pfree(tuple);
if (DebugMode)
@@ -735,9 +723,7 @@ InsertOneNull(int i)
if (DebugMode)
printf("Inserting null\n");
if (i < 0 || i >= MAXATTR)
- {
elog(FATAL, "i out of range (too many attrs): %d\n", i);
- }
values[i] = (char *) NULL;
Blanks[i] = 'n';
}
@@ -787,9 +773,7 @@ cleanup()
exitpg(1);
}
if (reldesc != (Relation) NULL)
- {
heap_close(reldesc);
- }
CommitTransactionCommand();
exitpg(Warnings);
}
@@ -823,9 +807,7 @@ gettype(char *type)
for (i = 0; i <= n_types; i++)
{
if (strncmp(type, Procid[i].name, NAMEDATALEN) == 0)
- {
return (i);
- }
}
if (DebugMode)
printf("bootstrap.c: External Type: %s\n", type);
@@ -869,9 +851,7 @@ AllocateAttribute()
(AttributeTupleForm) malloc(ATTRIBUTE_TUPLE_SIZE);
if (!PointerIsValid(attribute))
- {
elog(FATAL, "AllocateAttribute: malloc failed");
- }
MemSet(attribute, 0, ATTRIBUTE_TUPLE_SIZE);
return (attribute);
@@ -928,9 +908,7 @@ EnterString(char *str)
node = FindStr(str, len, 0);
if (node)
- {
return (node->strnum);
- }
else
{
node = AddStr(str, len, 0);
@@ -997,9 +975,7 @@ FindStr(char *str, int length, hashnode *mderef)
return (node); /* no need to check */
}
else
- {
node = node->next;
- }
}
/* Couldn't find it in the list */
return (NULL);
@@ -1056,9 +1032,7 @@ AddStr(char *str, int strlength, int mderef)
hashresult = CompHash(str, strlength);
if (hashtable[hashresult] == NULL)
- {
hashtable[hashresult] = newnode;
- }
else
{ /* There is something in the list */
trail = hashtable[hashresult];
@@ -1135,9 +1109,7 @@ index_register(char *heap,
}
}
else
- {
newind->il_params = (Datum *) NULL;
- }
if (finfo != (FuncIndexInfo *) NULL)
{
@@ -1145,9 +1117,7 @@ index_register(char *heap,
memmove(newind->il_finfo, finfo, sizeof(FuncIndexInfo));
}
else
- {
newind->il_finfo = (FuncIndexInfo *) NULL;
- }
if (predInfo != NULL)
{
@@ -1156,9 +1126,7 @@ index_register(char *heap,
newind->il_predInfo->oldPred = predInfo->oldPred;
}
else
- {
newind->il_predInfo = NULL;
- }
newind->il_next = ILHead;
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index 14fb51fdd30..c14065d7a5b 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.10 1998/05/09 23:42:58 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.11 1998/06/15 19:28:06 momjian Exp $
*
* NOTES
* See acl.h.
@@ -200,13 +200,9 @@ get_grosysid(char *groname)
htp = SearchSysCacheTuple(GRONAME, PointerGetDatum(groname),
0, 0, 0);
if (HeapTupleIsValid(htp))
- {
id = ((Form_pg_group) GETSTRUCT(htp))->grosysid;
- }
else
- {
elog(ERROR, "non-existent group \"%s\"", groname);
- }
return (id);
}
@@ -219,13 +215,9 @@ get_groname(AclId grosysid)
htp = SearchSysCacheTuple(GROSYSID, PointerGetDatum(grosysid),
0, 0, 0);
if (HeapTupleIsValid(htp))
- {
name = (((Form_pg_group) GETSTRUCT(htp))->groname).data;
- }
else
- {
elog(NOTICE, "get_groname: group %d not found", grosysid);
- }
return (name);
}
@@ -267,9 +259,7 @@ in_group(AclId uid, AclId gid)
}
}
else
- {
elog(NOTICE, "in_group: group %d not found", gid);
- }
heap_close(relation);
return (found);
}
@@ -290,9 +280,7 @@ aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode)
/* if no acl is found, use world default */
if (!acl)
- {
acl = acldefault(relname);
- }
num = ACL_NUM(acl);
aidat = ACL_DAT(acl);
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 62fc9d076bd..33a22f25aad 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.50 1998/06/14 13:31:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.51 1998/06/15 19:28:07 momjian Exp $
*
* INTERFACE ROUTINES
* heap_create() - Create an uncataloged heap relation
@@ -291,9 +291,7 @@ heap_create(char *name,
rdesc->rd_rel->relchecks = tupDesc->constr->num_check;
for (i = 0; i < natts; i++)
- {
rdesc->rd_att->attrs[i]->attrelid = relid;
- }
rdesc->rd_id = relid;
@@ -933,9 +931,7 @@ RelationRemoveInheritance(Relation relation)
{
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
if (!HeapTupleIsValid(tuple))
- {
break;
- }
heap_delete(catalogRelation, &tuple->t_ctid);
}
@@ -961,9 +957,7 @@ RelationRemoveInheritance(Relation relation)
{
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
if (!HeapTupleIsValid(tuple))
- {
break;
- }
heap_delete(catalogRelation, &tuple->t_ctid);
}
@@ -1000,9 +994,7 @@ RelationRemoveIndexes(Relation relation)
{
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
if (!HeapTupleIsValid(tuple))
- {
break;
- }
index_destroy(((IndexTupleForm) GETSTRUCT(tuple))->indexrelid);
}
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 69a71858c16..463cbf17542 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.42 1998/06/13 20:22:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.43 1998/06/15 19:28:09 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -190,9 +190,7 @@ RelationNameGetObjectId(char *relationName,
pg_class_tuple = heap_getnext(pg_class_scan, 0, &buffer);
if (!HeapTupleIsValid(pg_class_tuple))
- {
relationObjectId = InvalidOid;
- }
else
{
relationObjectId = pg_class_tuple->t_oid;
@@ -385,9 +383,7 @@ ConstructTupleDescriptor(Oid heapoid,
IndexKeyType = IndexKey->tname;
}
else
- {
IndexKeyType = NULL;
- }
indexTupDesc->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
@@ -805,9 +801,7 @@ UpdateIndexRelation(Oid indexoid,
pfree(predString);
}
else
- {
predText = (text *) fmgr(F_TEXTIN, "");
- }
predLen = VARSIZE(predText);
itupLen = predLen + sizeof(FormData_pg_index);
indexForm = (IndexTupleForm) palloc(itupLen);
@@ -942,9 +936,7 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
pfree(predString);
}
else
- {
predText = (text *) fmgr(F_TEXTIN, "");
- }
/* open the index system catalog relation */
pg_index = heap_openr(IndexRelationName);
@@ -1027,9 +1019,7 @@ InitIndexStrategy(int numatts,
strsize);
}
else
- {
support = (RegProcedure *) NULL;
- }
/* ----------------
* fill in the index strategy structure with information
@@ -1269,9 +1259,7 @@ index_destroy(Oid indexId)
while (tuple = heap_getnext(scan, 0, (Buffer *) NULL),
HeapTupleIsValid(tuple))
- {
heap_delete(catalogRelation, &tuple->t_ctid);
- }
heap_endscan(scan);
heap_close(catalogRelation);
@@ -1410,9 +1398,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
*/
pg_class = heap_openr(RelationRelationName);
if (!RelationIsValid(pg_class))
- {
elog(ERROR, "UpdateStats: could not open RELATION relation");
- }
key[0].sk_argument = ObjectIdGetDatum(relid);
pg_class_scan =
diff --git a/src/backend/catalog/indexing.c b/src/backend/catalog/indexing.c
index 51ba1ae9bf1..7fc091b118d 100644
--- a/src/backend/catalog/indexing.c
+++ b/src/backend/catalog/indexing.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.17 1998/04/27 04:04:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.18 1998/06/15 19:28:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -80,9 +80,7 @@ CatalogOpenIndices(int nIndices, char *names[], Relation idescs[])
int i;
for (i = 0; i < nIndices; i++)
- {
idescs[i] = index_openr(names[i]);
- }
}
/*
diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c
index f8fe2431d23..44506a35c44 100644
--- a/src/backend/catalog/pg_proc.c
+++ b/src/backend/catalog/pg_proc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.17 1998/04/27 04:05:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.18 1998/06/15 19:28:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -94,9 +94,7 @@ ProcedureCreate(char *procedureName,
if (strcmp(strVal(t), "opaque") == 0)
{
if (strcmp(languageName, "sql") == 0)
- {
elog(ERROR, "ProcedureDefine: sql functions cannot take type \"opaque\"");
- }
toid = 0;
}
else
@@ -162,9 +160,7 @@ ProcedureCreate(char *procedureName,
if (strcmp(returnTypeName, "opaque") == 0)
{
if (strcmp(languageName, "sql") == 0)
- {
elog(ERROR, "ProcedureCreate: sql functions cannot return type \"opaque\"");
- }
typeObjectId = 0;
}
diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c
index c67cbe15469..dac435f17f4 100644
--- a/src/backend/catalog/pg_type.c
+++ b/src/backend/catalog/pg_type.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.24 1998/05/09 23:43:00 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.25 1998/06/15 19:28:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -334,9 +334,7 @@ TypeCreate(char *typeName,
*/
typeObjectId = TypeGet(typeName, &defined);
if (OidIsValid(typeObjectId) && defined)
- {
elog(ERROR, "TypeCreate: type %s already defined", typeName);
- }
/* ----------------
* if this type has an associated elementType, then we check that
@@ -347,9 +345,7 @@ TypeCreate(char *typeName,
{
elementObjectId = TypeGet(elementTypeName, &defined);
if (!defined)
- {
elog(ERROR, "TypeCreate: type %s is not defined", elementTypeName);
- }
}
/* ----------------
@@ -437,9 +433,7 @@ TypeCreate(char *typeName,
0);
}
if (!HeapTupleIsValid(tup))
- {
func_error("TypeCreate", procname, 1, argList, NULL);
- }
}
values[i++] = (Datum) tup->t_oid; /* 11 - 14 */
@@ -559,9 +553,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
/* check that that the new type is not already defined */
type_oid = TypeGet(newTypeName, &defined);
if (OidIsValid(type_oid) && defined)
- {
elog(ERROR, "TypeRename: type %s already defined", newTypeName);
- }
/* get the type tuple from the catalog index scan manager */
pg_type_desc = heap_openr(TypeRelationName);
@@ -592,9 +584,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
}
else
- {
elog(ERROR, "TypeRename: type %s not defined", oldTypeName);
- }
/* finish up */
heap_close(pg_type_desc);
diff --git a/src/backend/commands/_deadcode/version.c b/src/backend/commands/_deadcode/version.c
index 7ae5a716013..8f07001440a 100644
--- a/src/backend/commands/_deadcode/version.c
+++ b/src/backend/commands/_deadcode/version.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.12 1998/06/04 17:26:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.13 1998/06/15 19:28:17 momjian Exp $
*
* NOTES
* At the point the version is defined, 2 physical relations are created
@@ -207,9 +207,7 @@ setAttrList(char *bname)
attrname = (rdesc->rd_att->attrs[i]->attname).data;
if (notfirst == 1)
- {
sprintf(temp_buf, ", %s = new.%s", attrname, attrname);
- }
else
{
sprintf(temp_buf, "%s = new.%s", attrname, attrname);
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index fcf02b2e4bf..fcdda333057 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.32 1998/05/06 23:49:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.33 1998/06/15 19:28:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -312,9 +312,7 @@ Async_NotifyAtCommit()
if (kill(DatumGetInt32(d), SIGUSR2) < 0)
{
if (errno == ESRCH)
- {
heap_delete(lRel, &lTuple->t_ctid);
- }
}
#endif
}
@@ -360,9 +358,7 @@ Async_NotifyAtAbort()
extern TransactionState CurrentTransactionState;
if (notifyIssued)
- {
ClearPendingNotify();
- }
notifyIssued = 0;
if (pendingNotifies)
DLFreeList(pendingNotifies);
@@ -446,9 +442,7 @@ Async_Listen(char *relname, int pid)
d = heap_getattr(htup, Anum_pg_listener_pid, tdesc, &isnull);
pid = DatumGetInt32(d);
if (pid == MyProcPid)
- {
alreadyListener = 1;
- }
}
ReleaseBuffer(b);
}
@@ -517,9 +511,7 @@ Async_Unlisten(char *relname, int pid)
RelationSetLockForWrite(lDesc);
if (lTuple != NULL)
- {
heap_delete(lDesc, &lTuple->t_ctid);
- }
RelationUnsetLockForWrite(lDesc);
heap_close(lDesc);
@@ -610,9 +602,7 @@ Async_NotifyFrontEnd()
pq_flush();
}
else
- {
elog(NOTICE, "Async_NotifyFrontEnd: no asynchronous notification to frontend on interactive sessions");
- }
ReleaseBuffer(b);
}
CommitTransactionCommand();
diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c
index f41b612369c..13d5e2adc9c 100644
--- a/src/backend/commands/command.c
+++ b/src/backend/commands/command.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.27 1998/04/27 04:05:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.28 1998/06/15 19:28:12 momjian Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -475,9 +475,7 @@ PerformAddAttribute(char *relationName,
form = (TypeTupleForm) GETSTRUCT(typeTuple);
if (!HeapTupleIsValid(typeTuple))
- {
elog(ERROR, "Add: type \"%s\" nonexistent", p);
- }
namestrcpy(&(attribute->attname), (char *) key[1].sk_argument);
attribute->atttypid = typeTuple->t_oid;
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index b2ca946b80b..dc6de2bb776 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.45 1998/03/30 16:45:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.46 1998/06/15 19:28:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -284,9 +284,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
fputs("\\N", fp); /* null indicator */
if (i == attr_count - 1)
- {
fputc('\n', fp);
- }
else
{
@@ -343,9 +341,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
heap_endscan(scandesc);
if (binary)
- {
pfree(nulls);
- }
else
{
pfree(out_functions);
@@ -494,9 +490,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
}
}
else
- {
indexPred[i] = NULL;
- }
}
}
}
@@ -576,9 +570,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
nulls[i] = 'n';
}
else if (string == NULL)
- {
done = 1;
- }
else
{
values[i] =
@@ -592,25 +584,19 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
*/
if (!PointerIsValid(values[i]) &&
!(rel->rd_att->attrs[i]->attbyval))
- {
elog(ERROR, "copy from line %d: Bad file format", lineno);
- }
}
}
#ifdef COPY_PATCH
if (!done)
- {
CopyReadNewline(fp, &newline);
- }
#endif
}
else
{ /* binary */
fread(&len, sizeof(int32), 1, fp);
if (feof(fp))
- {
done = 1;
- }
else
{
if (oids)
@@ -799,9 +785,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
pfree((void *) values[i]);
}
else if (nulls[i] == 'n')
- {
nulls[i] = ' ';
- }
}
pfree(tuple);
@@ -959,9 +943,7 @@ GetIndexRelations(Oid main_relation_oid,
*index_rels = (Relation *) palloc(*n_indices * sizeof(Relation));
for (i = 0, scan = head; i < *n_indices; i++, scan = scan->next)
- {
(*index_rels)[i] = index_open(scan->index_rel_oid);
- }
for (i = 0, scan = head; i < *n_indices + 1; i++)
{
@@ -1075,9 +1057,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
val = (val << 3) + VALUE(c);
c = getc(fp);
if (ISOCTAL(c))
- {
val = (val << 3) + VALUE(c);
- }
else
{
if (feof(fp))
@@ -1128,9 +1108,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
{
#ifdef COPY_PATCH
if (c == '\n')
- {
*newline = 1;
- }
#endif
done = 1;
}
diff --git a/src/backend/commands/creatinh.c b/src/backend/commands/creatinh.c
index 8eb14ace7a6..7c216149dca 100644
--- a/src/backend/commands/creatinh.c
+++ b/src/backend/commands/creatinh.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.29 1998/04/26 04:06:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.30 1998/06/15 19:28:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -256,9 +256,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
"MergeAttr: Can't inherit from non-existent superclass '%s'", name);
}
if (relation->rd_rel->relkind == 'S')
- {
elog(ERROR, "MergeAttr: Can't inherit from sequence superclass '%s'", name);
- }
tupleDesc = RelationGetTupleDescriptor(relation);
constr = tupleDesc->constr;
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 40cdd4d94e1..2d4bdcb39b9 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.14 1998/06/04 17:26:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.15 1998/06/15 19:28:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -68,9 +68,7 @@ createdb(char *dbname, char *dbpath)
sprintf(loc, "%s%c%s", dbpath, SEP_CHAR, dbname);
}
else
- {
strcpy(loc, dbname);
- }
lp = ExpandDatabasePath(loc);
@@ -114,9 +112,7 @@ destroydb(char *dbname)
check_permissions("destroydb", dbpath, dbname, &db_id, &user_id);
if (!OidIsValid(db_id))
- {
elog(FATAL, "impossible: pg_database instance with invalid OID.");
- }
/* stop the vacuum daemon */
stop_vacuum(dbpath, dbname);
@@ -224,15 +220,11 @@ check_permissions(char *command,
/* Make sure we are not mucking with the template database */
if (!strcmp(dbname, "template1"))
- {
elog(ERROR, "%s cannot be executed on the template database.", command);
- }
/* Check to make sure database is not the currently open database */
if (!strcmp(dbname, DatabaseName))
- {
elog(ERROR, "%s cannot be executed on an open database", command);
- }
/* Check to make sure database is owned by this user */
@@ -272,9 +264,7 @@ check_permissions(char *command,
*(path + VARSIZE(dbtext) - VARHDRSZ) = '\0';
}
else
- {
*dbIdP = InvalidOid;
- }
heap_close(dbrel);
@@ -322,9 +312,7 @@ stop_vacuum(char *dbpath, char *dbname)
dbname, SEP_CHAR, dbname);
}
else
- {
sprintf(filename, "%s%c%s.vacuum", dbpath, SEP_CHAR, dbname);
- }
if ((fp = AllocateFile(filename, "r")) != NULL)
{
diff --git a/src/backend/commands/defind.c b/src/backend/commands/defind.c
index 666d9570671..5afe352b0fb 100644
--- a/src/backend/commands/defind.c
+++ b/src/backend/commands/defind.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.20 1998/01/05 16:38:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.21 1998/06/15 19:28:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -94,9 +94,7 @@ DefineIndex(char *heapRelationName,
*/
numberOfAttributes = length(attributeList);
if (numberOfAttributes <= 0)
- {
elog(ERROR, "DefineIndex: must specify at least one attribute");
- }
/*
* compute heap relation id
@@ -369,9 +367,7 @@ CheckPredicate(List *predList, List *rangeTable, Oid baseRelOid)
List *item;
foreach(item, predList)
- {
CheckPredExpr(lfirst(item), rangeTable, baseRelOid);
- }
}
static void
@@ -391,9 +387,7 @@ CheckPredExpr(Node *predicate, List *rangeTable, Oid baseRelOid)
elog(ERROR, "Unsupported partial-index predicate expression type");
foreach(clause, clauses)
- {
CheckPredExpr(lfirst(clause), rangeTable, baseRelOid);
- }
}
static void
@@ -408,9 +402,7 @@ CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid)
if (!IsA(predicate->oper, Oper) ||
!IsA(pred_var, Var) ||
!IsA(pred_const, Const))
- {
elog(ERROR, "Unsupported partial-index predicate clause type");
- }
if (getrelid(pred_var->varno, rangeTable) != baseRelOid)
elog(ERROR,
@@ -538,9 +530,7 @@ GetDefaultOpClass(Oid atttypid)
ObjectIdGetDatum(atttypid),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
- {
return 0;
- }
return nameout(&(((Form_pg_opclass) GETSTRUCT(tuple))->opcname));
}
@@ -564,9 +554,7 @@ RemoveIndex(char *name)
0, 0, 0);
if (!HeapTupleIsValid(tuple))
- {
elog(ERROR, "index \"%s\" nonexistent", name);
- }
if (((Form_pg_class) GETSTRUCT(tuple))->relkind != RELKIND_INDEX)
{
diff --git a/src/backend/commands/define.c b/src/backend/commands/define.c
index 15ad37d76ee..39340d17260 100644
--- a/src/backend/commands/define.c
+++ b/src/backend/commands/define.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.24 1998/02/26 04:30:57 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.25 1998/06/15 19:28:15 momjian Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@@ -130,9 +130,7 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
ParamString *param = (ParamString *) lfirst(pl);
if (strcasecmp(param->name, "iscachable") == 0)
- {
*canCache_p = true;
- }
else if (strcasecmp(param->name, "trusted") == 0)
{
@@ -177,9 +175,7 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
}
}
else if (strcasecmp(param->name, "outin_ratio") == 0)
- {
*outin_ratio_p = atoi(param->val);
- }
}
}
@@ -394,13 +390,9 @@ DefineOperator(char *oprName,
elog(ERROR, "setof type not implemented for leftarg");
if (nodeTag(defel->arg) == T_String)
- {
typeName1 = defGetString(defel);
- }
else
- {
elog(ERROR, "type for leftarg is malformed.");
- }
}
else if (!strcasecmp(defel->defname, "rightarg"))
{
@@ -409,18 +401,12 @@ DefineOperator(char *oprName,
elog(ERROR, "setof type not implemented for rightarg");
if (nodeTag(defel->arg) == T_String)
- {
typeName2 = defGetString(defel);
- }
else
- {
elog(ERROR, "type for rightarg is malformed.");
- }
}
else if (!strcasecmp(defel->defname, "procedure"))
- {
functionName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "precedence"))
{
/* NOT IMPLEMENTED (never worked in v4.2) */
@@ -432,25 +418,15 @@ DefineOperator(char *oprName,
elog(NOTICE, "CREATE OPERATOR: associativity not implemented");
}
else if (!strcasecmp(defel->defname, "commutator"))
- {
commutatorName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "negator"))
- {
negatorName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "restrict"))
- {
restrictionName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "join"))
- {
joinName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "hashes"))
- {
canHash = TRUE;
- }
else if (!strcasecmp(defel->defname, "sort1"))
{
/* ----------------
@@ -462,9 +438,7 @@ DefineOperator(char *oprName,
sortName1 = defGetString(defel);
}
else if (!strcasecmp(defel->defname, "sort2"))
- {
sortName2 = defGetString(defel);
- }
else
{
elog(NOTICE, "DefineOperator: attribute \"%s\" not recognized",
@@ -476,9 +450,7 @@ DefineOperator(char *oprName,
* make sure we have our required definitions
*/
if (functionName == NULL)
- {
elog(ERROR, "Define: \"procedure\" unspecified");
- }
/* ----------------
* now have OperatorCreate do all the work..
@@ -528,13 +500,9 @@ DefineAggregate(char *aggName, List *parameters)
* sfunc1
*/
if (!strcasecmp(defel->defname, "sfunc1"))
- {
stepfunc1Name = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "basetype"))
- {
baseType = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "stype1"))
{
stepfunc1Type = defGetString(defel);
@@ -544,9 +512,7 @@ DefineAggregate(char *aggName, List *parameters)
*/
}
else if (!strcasecmp(defel->defname, "sfunc2"))
- {
stepfunc2Name = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "stype2"))
{
stepfunc2Type = defGetString(defel);
@@ -564,13 +530,9 @@ DefineAggregate(char *aggName, List *parameters)
*/
}
else if (!strcasecmp(defel->defname, "initcond1"))
- {
init1 = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "initcond2"))
- {
init2 = defGetString(defel);
- }
else
{
elog(NOTICE, "DefineAggregate: attribute \"%s\" not recognized",
@@ -647,25 +609,15 @@ DefineType(char *typeName, List *parameters)
DefElem *defel = (DefElem *) lfirst(pl);
if (!strcasecmp(defel->defname, "internallength"))
- {
internalLength = defGetTypeLength(defel);
- }
else if (!strcasecmp(defel->defname, "externallength"))
- {
externalLength = defGetTypeLength(defel);
- }
else if (!strcasecmp(defel->defname, "input"))
- {
inputName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "output"))
- {
outputName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "send"))
- {
sendName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "delimiter"))
{
char *p = defGetString(defel);
@@ -673,33 +625,21 @@ DefineType(char *typeName, List *parameters)
delimiter = p[0];
}
else if (!strcasecmp(defel->defname, "receive"))
- {
receiveName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "element"))
- {
elemName = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "default"))
- {
defaultValue = defGetString(defel);
- }
else if (!strcasecmp(defel->defname, "passedbyvalue"))
- {
byValue = true;
- }
else if (!strcasecmp(defel->defname, "alignment"))
{
char *a = defGetString(defel);
if (!strcasecmp(a, "double"))
- {
alignment = 'd';
- }
else if (!strcasecmp(a, "int"))
- {
alignment = 'i';
- }
else
{
elog(ERROR, "DefineType: \"%s\" alignment not recognized",
diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c
index 2a218b68637..6fef272c08b 100644
--- a/src/backend/commands/proclang.c
+++ b/src/backend/commands/proclang.c
@@ -80,9 +80,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
PointerGetDatum(languageName),
0, 0, 0);
if (HeapTupleIsValid(langTup))
- {
elog(ERROR, "Language %s already exists", languageName);
- }
/* ----------------
* Lookup the PL handler function and check that it is
@@ -171,9 +169,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
PointerGetDatum(languageName),
0, 0, 0);
if (!HeapTupleIsValid(langTup))
- {
elog(ERROR, "Language %s doesn't exist", languageName);
- }
if (!((Form_pg_language) GETSTRUCT(langTup))->lanispl)
{
@@ -195,9 +191,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
tup = heap_getnext(scanDesc, 0, (Buffer *) NULL);
if (!HeapTupleIsValid(tup))
- {
elog(ERROR, "Language with name '%s' not found", languageName);
- }
heap_delete(rdesc, &(tup->t_ctid));
diff --git a/src/backend/commands/recipe.c b/src/backend/commands/recipe.c
index 8034a515311..5d96623ed4c 100644
--- a/src/backend/commands/recipe.c
+++ b/src/backend/commands/recipe.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.20 1998/02/26 04:30:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.21 1998/06/15 19:28:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -387,9 +387,7 @@ tg_rewriteQuery(TgRecipe * r,
{
tle = lfirst(tl);
if (tle->resdom != NULL)
- {
tle->expr = tg_rewriteParamsInExpr(tle->expr, inputQlist);
- }
}
}
@@ -401,9 +399,7 @@ tg_rewriteQuery(TgRecipe * r,
if (orig->qual)
{
if (nodeTag(orig->qual) == T_List)
- {
elog(ERROR, "tg_rewriteQuery: Whoa! why is my qual a List???");
- }
orig->qual = tg_rewriteParamsInExpr(orig->qual, inputQlist);
}
@@ -514,9 +510,7 @@ tg_replaceNumberedParam(Node *expression,
}
}
else
- {
elog(NOTICE, "tg_replaceNumberedParam: unexpected paramkind value of %d", p->paramkind);
- }
}
break;
case T_Expr:
@@ -626,15 +620,11 @@ tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
{
tle = lfirst(tl);
if (strcmp(resname, tle->resdom->resname) == 0)
- {
return tle->expr;
- }
}
}
else
- {
elog(ERROR, "tg_rewriteParamsInExpr:can't substitute for parameter %d when that input is unconnected", p->paramid);
- }
}
else
@@ -648,9 +638,7 @@ tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
}
}
else
- {
elog(NOTICE, "tg_rewriteParamsInExpr: unexpected paramkind value of %d", p->paramkind);
- }
}
break;
case T_Expr:
@@ -716,9 +704,7 @@ getParamTypes(TgElement * elem, Oid typev[])
parameterCount = 0;
for (i = 0; i < 8; i++)
- {
typev[i] = 0;
- }
for (j = 0; j < elem->inTypes->num; j++)
{
if (parameterCount == 8)
@@ -736,13 +722,9 @@ getParamTypes(TgElement * elem, Oid typev[])
{
toid = TypeGet(elem->inTypes->val[j], &defined);
if (!OidIsValid(toid))
- {
elog(ERROR, "getParamTypes: arg type '%s' is not defined", t);
- }
if (!defined)
- {
elog(NOTICE, "getParamTypes: arg type '%s' is only a shell", t);
- }
}
typev[parameterCount++] = toid;
}
@@ -904,9 +886,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
sprintf(newquery, "select %s($1", funcName);
for (i = 1; i < parameterCount; i++)
- {
sprintf(newquery, "%s,$%d", newquery, i);
- }
sprintf(newquery, "%s)", newquery);
}
else
@@ -1071,9 +1051,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
"result",
InvalidOid,
-1, 0, false))
- {
elog(NOTICE, "tg_parseSubQuery: unexpected result from TupleDescInitEntry");
- }
else
{
relid = heap_create_with_catalog(
@@ -1083,9 +1061,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
}
}
else if (n->nodeType == TG_RECIPE_NODE)
- {
elog(NOTICE, "tg_parseSubQuery: can't handle embedded recipes yet!");
- }
else
elog(NOTICE, "unknown nodeType: %d", n->nodeType);
@@ -1134,9 +1110,7 @@ OffsetVarAttno(Node *node, int varno, int offset)
List *l;
foreach(l, (List *) node)
- {
OffsetVarAttno(lfirst(l), varno, offset);
- }
}
break;
default:
@@ -1174,9 +1148,7 @@ appendQlist(QueryTreeList *q1, QueryTreeList *q2)
for (i = 0; i < q1->len; i++)
newq->qtrees[i] = q1->qtrees[i];
for (j = 0; j < q2->len; j++)
- {
newq->qtrees[i + j] = q2->qtrees[j];
- }
return newq;
}
@@ -1225,9 +1197,7 @@ replaceSeqScan(Plan *plan, Plan *parent,
Result *newPlan;
if (plan == NULL)
- {
return;
- }
if (plan->type == T_SeqScan)
{
@@ -1288,13 +1258,9 @@ replaceSeqScan(Plan *plan, Plan *parent,
else
{
if (plan->lefttree)
- {
replaceSeqScan(plan->lefttree, plan, rt_ind, tplan);
- }
if (plan->righttree)
- {
replaceSeqScan(plan->righttree, plan, rt_ind, tplan);
- }
}
}
@@ -1352,14 +1318,10 @@ replaceTeeScans(Plan *plan, Query *parsetree, TeeInfo * teeInfo)
{
if (strcmp(teeInfo->val[i].tpi_relName,
rte->refname) == 0)
- {
tplan = teeInfo->val[i].tpi_plan;
- }
}
if (tplan == NULL)
- {
elog(NOTICE, "replaceTeeScans didn't find the corresponding tee plan");
- }
/*
* replace the sequential scan node with that var number with
diff --git a/src/backend/commands/remove.c b/src/backend/commands/remove.c
index 1eeccd9ac48..0a030e6570c 100644
--- a/src/backend/commands/remove.c
+++ b/src/backend/commands/remove.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.24 1998/05/09 23:43:45 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.25 1998/06/15 19:28:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -364,9 +364,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
0, 0, 0);
if (!HeapTupleIsValid(tup))
- {
elog(ERROR, "RemoveFunction: type '%s' not found", typename);
- }
argList[i] = tup->t_oid;
}
}
@@ -458,14 +456,10 @@ RemoveAggregate(char *aggName, char *aggType)
{
basetypeID = TypeGet(aggType, &defined);
if (!OidIsValid(basetypeID))
- {
elog(ERROR, "RemoveAggregate: type '%s' does not exist", aggType);
- }
}
else
- {
basetypeID = 0;
- }
/*
#ifndef NO_SECURITY
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index b19879b9472..572cc3b3f60 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -313,9 +313,7 @@ currval(struct varlena * seqin)
pfree(seqname);
if (elm->increment == 0) /* nextval/read_info were not called */
- {
elog(ERROR, "%s.currval is not yet defined in this session", elm->name);
- }
result = elm->last;
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c
index 45e3225de66..30a7f605910 100644
--- a/src/backend/commands/trigger.c
+++ b/src/backend/commands/trigger.c
@@ -149,14 +149,10 @@ CreateTrigger(CreateTrigStmt *stmt)
ObjectIdGetDatum(((Form_pg_proc) GETSTRUCT(tuple))->prolang),
0, 0, 0);
if (!HeapTupleIsValid(langTup))
- {
elog(ERROR, "CreateTrigger: cache lookup for PL failed");
- }
if (((Form_pg_language) GETSTRUCT(langTup))->lanispl == false)
- {
elog(ERROR, "CreateTrigger: only C and PL functions are supported");
- }
}
MemSet(nulls, ' ', Natts_pg_trigger * sizeof(char));
@@ -598,9 +594,7 @@ ExecCallTriggerFunc(Trigger *trigger)
{
if (trigger->tgfunc.fn_addr == NULL)
- {
fmgr_info(trigger->tgfoid, &trigger->tgfunc);
- }
if (trigger->tgfunc.fn_plhandler != NULL)
{
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 180523f8bf2..c206808390a 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.64 1998/04/27 04:05:31 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.65 1998/06/15 19:28:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -333,9 +333,7 @@ vc_getrels(NameData *VacRelP)
/* get a relation list entry for this guy */
old = MemoryContextSwitchTo((MemoryContext) portalmem);
if (vrl == (VRelList) NULL)
- {
vrl = cur = (VRelList) palloc(sizeof(VRelListData));
- }
else
{
cur->vrl_next = (VRelList) palloc(sizeof(VRelListData));
@@ -1029,9 +1027,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
dowrite = true;
}
else
- {
Assert(isempty);
- }
--Vnpages;
Assert(Vnpages > 0);
/* get prev reapped page from Vvpl */
@@ -1054,9 +1050,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
}
}
else
- {
Assert(!isempty);
- }
vpc->vpd_blkno = blkno;
maxoff = PageGetMaxOffsetNumber(page);
@@ -1529,9 +1523,7 @@ vc_vaconeind(VPageList vpl, Relation indrel, int nhtups)
index_delete(indrel, &res->index_iptr);
}
else
- {
nitups++;
- }
/* be tidy */
pfree(res);
@@ -2219,9 +2211,7 @@ vc_clsindices(int nindices, Relation *Irel)
return;
while (nindices--)
- {
index_close(Irel[nindices]);
- }
pfree(Irel);
} /* vc_clsindices */
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index 621854f200f..9e138b82a91 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -2,7 +2,7 @@
* Routines for handling of 'SET var TO',
* 'SHOW var' and 'RESET var' statements.
*
- * $Id: variable.c,v 1.5 1998/03/30 16:45:59 momjian Exp $
+ * $Id: variable.c,v 1.6 1998/06/15 19:28:17 momjian Exp $
*
*/
@@ -365,9 +365,7 @@ parse_date(const char *value)
ecnt++;
}
else
- {
elog(ERROR, "Bad value for date style (%s)", tok);
- }
pfree(tok);
}
diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c
index 5602cc992d7..6360f004b75 100644
--- a/src/backend/commands/view.c
+++ b/src/backend/commands/view.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.21 1998/02/26 04:31:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.22 1998/06/15 19:28:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -90,9 +90,7 @@ DefineVirtualRelation(char *relname, List *tlist)
}
}
else
- {
elog(ERROR, "attempted to define virtual relation with no attrs");
- }
/*
* now create the parametesr for keys/inheritance etc. All of them are
diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c
index 0497c922ef1..8ce988114ad 100644
--- a/src/backend/executor/execAmi.c
+++ b/src/backend/executor/execAmi.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.20 1998/02/27 16:11:26 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.21 1998/06/15 19:28:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -124,9 +124,7 @@ ExecOpenR(Oid relationOid, bool isindex)
* ----------------
*/
if (isindex)
- {
relation = index_open(relationOid);
- }
else
relation = heap_open(relationOid);
diff --git a/src/backend/executor/execJunk.c b/src/backend/executor/execJunk.c
index 75aa8de7097..51bd68bf915 100644
--- a/src/backend/executor/execJunk.c
+++ b/src/backend/executor/execJunk.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.10 1998/01/31 04:38:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.11 1998/06/15 19:28:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -230,9 +230,7 @@ ExecInitJunkFilter(List *targetList)
}
}
else
- {
cleanMap = NULL;
- }
/* ---------------------
* Finally create and initialize the JunkFilter.
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 4e14107f5fd..66460913cf3 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.47 1998/05/26 03:44:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.48 1998/06/15 19:28:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -364,9 +364,7 @@ ExecCheckPerms(CmdType operation,
++i;
}
if (!ok)
- {
elog(ERROR, "%s: %s", rname.data, aclcheck_error_strings[aclcheck_result]);
- }
}
/* ===============================================================
@@ -660,9 +658,7 @@ EndPlan(Plan *plan, EState *estate)
* ----------------
*/
if (intoRelationDesc != NULL)
- {
heap_close(intoRelationDesc);
- }
}
/* ----------------------------------------------------------------
@@ -1009,9 +1005,7 @@ ExecAppend(TupleTableSlot *slot,
*/
numIndices = resultRelationInfo->ri_NumIndices;
if (numIndices > 0)
- {
ExecInsertIndexTuples(slot, &(tuple->t_ctid), estate, false);
- }
(estate->es_processed)++;
estate->es_lastoid = newId;
@@ -1218,9 +1212,7 @@ ExecReplace(TupleTableSlot *slot,
numIndices = resultRelationInfo->ri_NumIndices;
if (numIndices > 0)
- {
ExecInsertIndexTuples(slot, &(tuple->t_ctid), estate, true);
- }
/* AFTER ROW UPDATE Triggers */
if (resultRelationDesc->trigdesc &&
diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c
index 16309ff6336..8f167b8546c 100644
--- a/src/backend/executor/execProcnode.c
+++ b/src/backend/executor/execProcnode.c
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.10 1998/05/19 18:05:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.11 1998/06/15 19:28:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -426,13 +426,9 @@ ExecEndNode(Plan *node, Plan *parent)
return;
foreach(subp, node->initPlan)
- {
ExecEndSubPlan((SubPlan *) lfirst(subp));
- }
foreach(subp, node->subPlan)
- {
ExecEndSubPlan((SubPlan *) lfirst(subp));
- }
if (node->chgParam != NULL)
{
freeList(node->chgParam);
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 34193990db0..31e2791eabe 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.32 1998/05/29 17:00:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.33 1998/06/15 19:28:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -417,16 +417,12 @@ ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
case PARAM_NAMED:
if (thisParameterKind == paramList->kind &&
strcmp(paramList->name, thisParameterName) == 0)
- {
matchFound = 1;
- }
break;
case PARAM_NUM:
if (thisParameterKind == paramList->kind &&
paramList->id == thisParameterId)
- {
matchFound = 1;
- }
break;
case PARAM_OLD:
case PARAM_NEW:
@@ -454,9 +450,7 @@ ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
thisParameterKind);
}
if (!matchFound)
- {
paramList++;
- }
} /* while */
} /* if */
@@ -821,9 +815,7 @@ ExecMakeFunctionResult(Node *node,
* its func cache.
*/
if (*isDone)
- {
((Func *) node)->func_fcache = NULL;
- }
}
return result;
}
@@ -1558,9 +1550,7 @@ ExecTargetList(List *targetlist,
#endif
resind = fjRes->resno - 1;
if (fjIsNull[curNode])
- {
null_head[resind] = 'n';
- }
else
{
null_head[resind] = ' ';
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index 96f8f21128a..1db49d391c7 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.31 1998/04/27 04:05:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.32 1998/06/15 19:28:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -804,9 +804,7 @@ ExecOpenIndices(Oid resultRelationOid,
pfree(predString);
}
else
- {
predicate = NULL;
- }
/* ----------------
* save the index information into lists
@@ -916,9 +914,7 @@ ExecOpenIndices(Oid resultRelationOid,
i = 0;
foreach(indexpreds, predList)
- {
indexInfoArray[i++]->ii_Predicate = lfirst(indexpreds);
- }
/* ----------------
* store the index info array into relation info
* ----------------
@@ -1117,9 +1113,7 @@ ExecInsertIndexTuples(TupleTableSlot *slot,
if (predicate != NULL)
{
if (econtext == NULL)
- {
econtext = makeNode(ExprContext);
- }
econtext->ecxt_scantuple = slot;
/* Skip this index-update if the predicate isn't satisfied */
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index f6e034d9881..fe14f3df728 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.16 1998/02/13 03:26:44 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.17 1998/06/15 19:28:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -176,9 +176,7 @@ postquel_start(execution_state *es)
* 30-8-1996
*/
if (es->qd->operation == CMD_UTILITY)
- {
return (TupleDesc) NULL;
- }
#endif
return ExecutorStart(es->qd, es->estate);
}
@@ -218,9 +216,7 @@ postquel_end(execution_state *es)
* 30-8-1996
*/
if (es->qd->operation == CMD_UTILITY)
- {
return;
- }
#endif
ExecutorEnd(es->qd, es->estate);
}
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 84f3d1412f0..58c837e8e9c 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -405,9 +405,7 @@ ExecAgg(Agg *node)
* the tuples we aggregate over share the same group column)
*/
if (!oneTuple)
- {
oneTuple = heap_copytuple(outerslot->val);
- }
nTuplesAgged++;
}
@@ -437,13 +435,9 @@ ExecAgg(Agg *node)
args[1] = (char *) value2[i];
}
else if (aggfns->xfn1.fn_addr != NULL)
- {
args[0] = (char *) value1[i];
- }
else if (aggfns->xfn2.fn_addr != NULL)
- {
args[0] = (char *) value2[i];
- }
else
elog(NOTICE, "ExecAgg: no valid transition functions??");
value1[i] = (Datum) fmgr_c(&aggfns->finalfn,
@@ -458,9 +452,7 @@ ExecAgg(Agg *node)
*/
}
else if (aggfns->xfn2.fn_addr != NULL)
- {
value1[i] = value2[i];
- }
else
elog(ERROR, "ExecAgg: no valid transition functions??");
}
@@ -475,9 +467,7 @@ ExecAgg(Agg *node)
aggstate->agg_done = ((Group *) outerPlan)->grpstate->grp_done;
}
else
- {
aggstate->agg_done = TRUE;
- }
/* ----------------
* form a projection tuple, store it in the result tuple
diff --git a/src/backend/executor/nodeAppend.c b/src/backend/executor/nodeAppend.c
index 86286284e91..49c7f6ba457 100644
--- a/src/backend/executor/nodeAppend.c
+++ b/src/backend/executor/nodeAppend.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.11 1998/02/26 04:31:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.12 1998/06/15 19:28:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -351,9 +351,7 @@ ExecCountSlotsAppend(Append *node)
int nSlots = 0;
foreach(plan, unionplans)
- {
nSlots += ExecCountSlotsNode((Plan *) lfirst(plan));
- }
return nSlots + APPEND_NSLOTS;
}
@@ -426,13 +424,9 @@ ExecProcAppend(Append *node)
whichplan = unionstate->as_whichplan;
if (ScanDirectionIsForward(direction))
- {
unionstate->as_whichplan = whichplan + 1;
- }
else
- {
unionstate->as_whichplan = whichplan - 1;
- }
/* ----------------
* return something from next node or an empty slot
@@ -484,9 +478,7 @@ ExecEndAppend(Append *node)
for (i = 0; i < nplans; i++)
{
if (initialized[i] == TRUE)
- {
ExecEndNode((Plan *) nth(i, unionplans), (Plan *) node);
- }
}
/* ----------------
diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c
index 81e4b540ec0..4ba1aeaa76b 100644
--- a/src/backend/executor/nodeGroup.c
+++ b/src/backend/executor/nodeGroup.c
@@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive)
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.18 1998/02/26 04:31:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.19 1998/06/15 19:28:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -114,9 +114,7 @@ ExecGroupEveryTuple(Group *node)
firsttuple = grpstate->grp_firstTuple;
/* this should occur on the first call only */
if (firsttuple == NULL)
- {
grpstate->grp_firstTuple = heap_copytuple(outerTuple);
- }
else
{
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index 81eca617fb4..eb99a1d08e8 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.20 1998/02/26 04:31:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.21 1998/06/15 19:28:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -354,9 +354,7 @@ ExecHashTableCreate(Hash *node)
shmid = 0;
if (hashtable == NULL)
- {
elog(ERROR, "not enough memory for hashjoin.");
- }
/* ----------------
* initialize the hash table header
* ----------------
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index 74a36e45efa..3354224a695 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.17 1998/03/30 16:46:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.18 1998/06/15 19:28:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -279,13 +279,9 @@ ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
ExecEvalExpr(scanexpr, exprCtxt, &isNull, &isDone);
scan_keys[j].sk_argument = scanvalue;
if (isNull)
- {
scan_keys[j].sk_flags |= SK_ISNULL;
- }
else
- {
scan_keys[j].sk_flags &= ~SK_ISNULL;
- }
}
}
}
@@ -885,9 +881,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
* ----------------
*/
if (have_runtime_keys)
- {
indexstate->iss_RuntimeKeyInfo = (Pointer) runtimeKeyInfo;
- }
else
{
indexstate->iss_RuntimeKeyInfo = NULL;
diff --git a/src/backend/executor/nodeMergejoin.c b/src/backend/executor/nodeMergejoin.c
index 0525f93296d..d3a1bdb62ea 100644
--- a/src/backend/executor/nodeMergejoin.c
+++ b/src/backend/executor/nodeMergejoin.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.15 1998/06/15 18:39:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.16 1998/06/15 19:28:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -571,13 +571,9 @@ ExecMergeJoin(MergeJoin *node)
MJ_DEBUG_QUAL(mergeclauses, qualResult);
if (qualResult)
- {
mergestate->mj_JoinState = EXEC_MJ_JOINTUPLES;
- }
else
- {
mergestate->mj_JoinState = EXEC_MJ_NEXTOUTER;
- }
break;
/*
@@ -634,13 +630,9 @@ ExecMergeJoin(MergeJoin *node)
econtext->ecxt_innertuple = innerTupleSlot;
if (TupIsNull(innerTupleSlot))
- {
mergestate->mj_JoinState = EXEC_MJ_NEXTOUTER;
- }
else
- {
mergestate->mj_JoinState = EXEC_MJ_JOINTEST;
- }
break;
/*
@@ -863,13 +855,9 @@ ExecMergeJoin(MergeJoin *node)
MJ_DEBUG_MERGE_COMPARE(innerSkipQual, compareResult);
if (compareResult)
- {
mergestate->mj_JoinState = EXEC_MJ_SKIPINNER;
- }
else
- {
mergestate->mj_JoinState = EXEC_MJ_JOINMARK;
- }
break;
/*
@@ -986,13 +974,9 @@ ExecMergeJoin(MergeJoin *node)
MJ_DEBUG_MERGE_COMPARE(outerSkipQual, compareResult);
if (compareResult)
- {
mergestate->mj_JoinState = EXEC_MJ_SKIPOUTER;
- }
else
- {
mergestate->mj_JoinState = EXEC_MJ_JOINMARK;
- }
break;
diff --git a/src/backend/executor/nodeNestloop.c b/src/backend/executor/nodeNestloop.c
index 0d5b210945f..39b89c7a79b 100644
--- a/src/backend/executor/nodeNestloop.c
+++ b/src/backend/executor/nodeNestloop.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.9 1998/02/26 04:31:31 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.10 1998/06/15 19:28:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -120,9 +120,7 @@ ExecNestLoop(NestLoop *node, Plan *parent)
needNewOuterTuple = false;
if (!TupIsNull(outerTupleSlot))
- {
ENL1_printf("have outer tuple, deal with it");
- }
else
{
ENL1_printf("outer tuple is nil, need new outer tuple");
@@ -196,9 +194,7 @@ ExecNestLoop(NestLoop *node, Plan *parent)
econtext->ecxt_innertuple = innerTupleSlot;
if (TupIsNull(innerTupleSlot))
- {
ENL1_printf("couldn't get inner tuple - need new outer tuple");
- }
else
{
ENL1_printf("got inner and outer tuples");
diff --git a/src/backend/executor/nodeSeqscan.c b/src/backend/executor/nodeSeqscan.c
index a351ea4a298..795c17e8b09 100644
--- a/src/backend/executor/nodeSeqscan.c
+++ b/src/backend/executor/nodeSeqscan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.9 1998/03/30 16:46:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.10 1998/06/15 19:28:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -129,13 +129,9 @@ ExecSeqScan(SeqScan *node)
* ----------------
*/
if ((outerPlan = outerPlan((Plan *) node)) != NULL)
- {
slot = ExecProcNode(outerPlan, (Plan *) node);
- }
else
- {
slot = ExecScan(node, SeqNext);
- }
S1_printf("ExecSeqScan: returned tuple slot: %d\n", slot);
diff --git a/src/backend/executor/nodeSort.c b/src/backend/executor/nodeSort.c
index 665555fa456..7c27a260828 100644
--- a/src/backend/executor/nodeSort.c
+++ b/src/backend/executor/nodeSort.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.14 1998/02/26 04:31:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.15 1998/06/15 19:28:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -181,9 +181,7 @@ ExecSort(Sort *node)
SO1_printf(stderr, "ExecSort: sorting done.\n");
}
else
- {
slot = (TupleTableSlot *) sortstate->csstate.cstate.cs_ResultTupleSlot;
- }
SO1_printf("ExecSort: %s\n",
"retrieving tuple from sorted relation");
diff --git a/src/backend/executor/nodeTee.c b/src/backend/executor/nodeTee.c
index 4a96dc2621e..f372a1ebea5 100644
--- a/src/backend/executor/nodeTee.c
+++ b/src/backend/executor/nodeTee.c
@@ -15,7 +15,7 @@
* ExecEndTee
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.17 1998/04/24 14:41:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.18 1998/06/15 19:28:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -315,18 +315,14 @@ ExecTee(Tee *node, Plan *parent)
/* XXX doesn't handle backwards direction yet */
if (parent == node->leftParent)
- {
branch = leftPlace;
- }
else if ((parent == node->rightParent) || (parent == (Plan *) node))
/*
* the tee node could be the root node of the plan, in which case,
* we treat it like a right-parent pull
*/
- {
branch = rightPlace;
- }
else
{
elog(ERROR, "A Tee node can only be executed from its left or right parent\n");
@@ -419,13 +415,9 @@ ExecTee(Tee *node, Plan *parent)
}
if (parent == node->leftParent)
- {
teeState->tee_leftPlace = leftPlace + 1;
- }
else
- {
teeState->tee_rightPlace = rightPlace + 1;
- }
return result;
}
diff --git a/src/backend/lib/dllist.c b/src/backend/lib/dllist.c
index 2464d4ddeff..40eb3ff8b93 100644
--- a/src/backend/lib/dllist.c
+++ b/src/backend/lib/dllist.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.9 1998/02/26 04:31:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.10 1998/06/15 19:28:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -173,9 +173,7 @@ DLRemHead(Dllist *l)
result = l->dll_head;
if (l->dll_head->dle_next)
- {
l->dll_head->dle_next->dle_prev = 0;
- }
l->dll_head = l->dll_head->dle_next;
@@ -199,9 +197,7 @@ DLRemTail(Dllist *l)
result = l->dll_tail;
if (l->dll_tail->dle_prev)
- {
l->dll_tail->dle_prev->dle_next = 0;
- }
l->dll_tail = l->dll_tail->dle_prev;
result->dle_prev = 0;
diff --git a/src/backend/lib/fstack.c b/src/backend/lib/fstack.c
index 92a21c9bba2..ae81edf251d 100644
--- a/src/backend/lib/fstack.c
+++ b/src/backend/lib/fstack.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/lib/Attic/fstack.c,v 1.7 1998/04/06 17:27:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/lib/Attic/fstack.c,v 1.8 1998/06/15 19:28:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -62,9 +62,7 @@ FixedStackPop(FixedStack stack)
AssertArg(FixedStackIsValid(stack));
if (!PointerIsValid(stack->top))
- {
return (NULL);
- }
pointer = FixedStackGetItemBase(stack, stack->top);
stack->top = stack->top->next;
@@ -110,9 +108,7 @@ FixedStackContains(FixedStack stack, Pointer pointer)
for (next = stack->top; FixedItemIsValid(next); next = next->next)
{
if (next == item)
- {
return (true);
- }
}
return (false);
}
@@ -125,9 +121,7 @@ FixedStackGetTop(FixedStack stack)
AssertArg(FixedStackIsValid(stack));
if (!PointerIsValid(stack->top))
- {
return (NULL);
- }
return (FixedStackGetItemBase(stack, stack->top));
}
@@ -144,9 +138,7 @@ FixedStackGetNext(FixedStack stack, Pointer pointer)
item = FixedStackGetItem(stack, pointer)->next;
if (!PointerIsValid(item))
- {
return (NULL);
- }
return (FixedStackGetItemBase(stack, item));
}
diff --git a/src/backend/lib/stringinfo.c b/src/backend/lib/stringinfo.c
index ccd03115506..af85d2cf7e3 100644
--- a/src/backend/lib/stringinfo.c
+++ b/src/backend/lib/stringinfo.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/lib/stringinfo.c,v 1.9 1998/01/07 21:03:04 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/lib/stringinfo.c,v 1.10 1998/06/15 19:28:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -35,9 +35,7 @@ makeStringInfo()
res = (StringInfo) palloc(sizeof(StringInfoData));
if (res == NULL)
- {
elog(ERROR, "makeStringInfo: Out of memory!");
- }
size = 100;
res->data = palloc(size);
@@ -95,9 +93,7 @@ appendStringInfo(StringInfo str, char *buffer)
*/
newlen = 2 * str->len;
while (buflen + str->len >= newlen - 1)
- {
newlen = 2 * newlen;
- }
/*
* allocate enough space.
diff --git a/src/backend/libpq/be-fsstubs.c b/src/backend/libpq/be-fsstubs.c
index c60e060cd21..8ecf45fe122 100644
--- a/src/backend/libpq/be-fsstubs.c
+++ b/src/backend/libpq/be-fsstubs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.20 1998/05/12 21:43:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.21 1998/06/15 19:28:25 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@@ -69,9 +69,7 @@ lo_open(Oid lobjId, int mode)
#endif
if (fscxt == NULL)
- {
fscxt = CreateGlobalMemory("Filesystem");
- }
currentContext = MemoryContextSwitchTo((MemoryContext) fscxt);
lobjDesc = inv_open(lobjId, mode);
@@ -171,9 +169,7 @@ lo_creat(int mode)
Oid lobjId;
if (fscxt == NULL)
- {
fscxt = CreateGlobalMemory("Filesystem");
- }
currentContext = MemoryContextSwitchTo((MemoryContext) fscxt);
diff --git a/src/backend/libpq/be-pqexec.c b/src/backend/libpq/be-pqexec.c
index ba703cb6814..38b4536ccf9 100644
--- a/src/backend/libpq/be-pqexec.c
+++ b/src/backend/libpq/be-pqexec.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.16 1998/06/04 17:26:39 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.17 1998/06/15 19:28:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -77,17 +77,11 @@ PQfn(int fnid,
for (i = 0; i < nargs; i++)
{
if (args[i].len == VAR_LENGTH_ARG)
- {
arg[i] = (char *) args[i].u.ptr;
- }
else if (args[i].len > sizeof(int4))
- {
elog(ERROR, "arg_length of argument %d too long", i);
- }
else
- {
arg[i] = (char *) args[i].u.integer;
- }
}
/* ----------------
@@ -107,13 +101,9 @@ PQfn(int fnid,
return "0";
if (result_is_int)
- {
*result_buf = (int) retval;
- }
else
- {
memmove(result_buf, retval, result_len);
- }
return "G";
}
diff --git a/src/backend/libpq/crypt.c b/src/backend/libpq/crypt.c
index 2dcb4f1be95..50ef9d4ca9f 100644
--- a/src/backend/libpq/crypt.c
+++ b/src/backend/libpq/crypt.c
@@ -145,9 +145,7 @@ crypt_loadpwdfile()
{ /* free the old data only if this is a
* reload */
while (pwd_cache_count--)
- {
free((void *) pwd_cache[pwd_cache_count]);
- }
free((void *) pwd_cache);
pwd_cache = NULL;
pwd_cache_count = 0;
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c
index a0098c65188..80c149b062d 100644
--- a/src/backend/libpq/hba.c
+++ b/src/backend/libpq/hba.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.32 1998/06/13 05:14:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.33 1998/06/15 19:28:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -995,9 +995,7 @@ GetCharSetByHost(char TableName[], int host, const char DataDir[])
/* Read the charset */
next_token(file, buf, sizeof(buf));
if (buf[0] != '\0')
- {
strcpy(HostCharset, buf);
- }
}
}
break;
@@ -1005,9 +1003,7 @@ GetCharSetByHost(char TableName[], int host, const char DataDir[])
/* Read the base charset */
next_token(file, buf, sizeof(buf));
if (buf[0] != '\0')
- {
strcpy(BaseCharset, buf);
- }
break;
case KEY_TABLE:
/* Read the original charset */
@@ -1046,9 +1042,7 @@ GetCharSetByHost(char TableName[], int host, const char DataDir[])
{
if (!strcasecmp(BaseCharset, ChArray[i]->Orig) &&
!strcasecmp(HostCharset, ChArray[i]->Dest))
- {
strncpy(TableName, ChArray[i]->Table, 79);
- }
free((struct CharsetItem *) ChArray[i]);
}
}
diff --git a/src/backend/libpq/password.c b/src/backend/libpq/password.c
index 1bb503bdcf0..af3a4c6f7e2 100644
--- a/src/backend/libpq/password.c
+++ b/src/backend/libpq/password.c
@@ -48,9 +48,7 @@ verify_password(char *auth_arg, char *user, char *password)
test_pw = strtok(NULL, ":");
if (!test_user || !test_pw ||
test_user[0] == '\0' || test_pw[0] == '\0')
- {
continue;
- }
/* kill the newline */
if (test_pw[strlen(test_pw) - 1] == '\n')
diff --git a/src/backend/libpq/portal.c b/src/backend/libpq/portal.c
index 922b622b4e5..ac0d064a06a 100644
--- a/src/backend/libpq/portal.c
+++ b/src/backend/libpq/portal.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.13 1998/02/26 04:31:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.14 1998/06/15 19:28:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -119,9 +119,7 @@ PQnportals(int rule_p)
if (portals[i] && portals[i]->portal)
{
if (!rule_p || portals[i]->portal->rule_p)
- {
++n;
- }
}
}
return (n);
@@ -690,9 +688,7 @@ PQnotifies_init()
PQNotifyList *p;
if (pqNotifyList == NULL)
- {
pqNotifyList = DLNewList();
- }
else
{
/* clean all notifies */
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index 4e1a2659ced..a3ff7bcffd1 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.43 1998/05/29 17:00:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.44 1998/06/15 19:28:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -89,13 +89,9 @@ pq_init(int fd)
elog(FATAL, "pq_init: Couldn't initialize socket connection");
PQnotifies_init();
if (getenv("LIBPQ_DEBUG"))
- {
Pfdebug = stderr;
- }
else
- {
Pfdebug = NULL;
- }
}
/* -------------------------
@@ -229,9 +225,7 @@ PQgetline(char *s, int maxlen)
return (EOF);
if (fgets(s, maxlen - 1, Pfin) == NULL)
- {
return feof(Pfin) ? EOF : 1;
- }
else
{
for (; *s; s++)
@@ -643,9 +637,7 @@ StreamServerPort(char *hostName, short portName, int *fdP)
*fdP = fd;
if (family == AF_UNIX)
- {
chmod(sock_path, 0777);
- }
return (STATUS_OK);
}
diff --git a/src/backend/libpq/pqsignal.c b/src/backend/libpq/pqsignal.c
index 32abbe0a8e0..8829af19ca3 100644
--- a/src/backend/libpq/pqsignal.c
+++ b/src/backend/libpq/pqsignal.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.7 1997/09/08 02:23:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.8 1998/06/15 19:28:27 momjian Exp $
*
* NOTES
* This shouldn't be in libpq, but the monitor and some other
@@ -56,9 +56,7 @@ pqsignal(int signo, pqsigfunc func)
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
if (signo != SIGALRM)
- {
act.sa_flags |= SA_RESTART;
- }
if (sigaction(signo, &act, &oact) < 0)
return (SIG_ERR);
return (oact.sa_handler);
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index bdb3117dfa2..30e7ed3bc5d 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.20 1998/06/04 17:26:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.21 1998/06/15 19:28:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -72,9 +72,7 @@ main(int argc, char *argv[])
#if defined(__alpha)
if (setsysinfo(SSI_NVPAIRS, buffer, 1, (caddr_t) NULL,
(unsigned long) NULL) < 0)
- {
elog(NOTICE, "setsysinfo failed: %d\n", errno);
- }
#endif
#endif /* NOFIXADE || NOPRINTADE */
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 40d8abce0c2..e43fd13d524 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.41 1998/02/26 04:32:04 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.42 1998/06/15 19:28:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -45,9 +45,7 @@ listCopy(List *list)
foreach(l, list)
{
if (newlist == NIL)
- {
newlist = nl = lcons(lfirst(l), NIL);
- }
else
{
lnext(nl) = lcons(lfirst(l), NIL);
@@ -842,9 +840,7 @@ _copyConst(Const *from)
}
}
else
- {
newnode->constvalue = from->constvalue;
- }
newnode->constisnull = from->constisnull;
newnode->constbyval = from->constbyval;
newnode->constisset = from->constisset;
@@ -1108,9 +1104,7 @@ CopyPathFields(Path *from, Path *newnode)
}
}
else
- {
Node_Copy(from, newnode, p_ordering.ord.merge);
- }
Node_Copy(from, newnode, keys);
@@ -1829,9 +1823,7 @@ copyObject(void *from)
foreach(l, list)
{
if (newlist == NIL)
- {
newlist = nl = lcons(copyObject(lfirst(l)), NIL);
- }
else
{
lnext(nl) = lcons(copyObject(lfirst(l)), NIL);
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c
index e0e7f7f9bec..2b826cdc9f4 100644
--- a/src/backend/nodes/list.c
+++ b/src/backend/nodes/list.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.12 1998/02/26 04:32:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.13 1998/06/15 19:28:31 momjian Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle
@@ -122,9 +122,7 @@ nreverse(List *list)
return (list);
for (p = list; p != NULL; p = lnext(p))
- {
rlist = lcons(lfirst(p), rlist);
- }
lfirst(list) = lfirst(rlist);
lnext(list) = lnext(rlist);
@@ -324,9 +322,7 @@ LispUnion(List *l1, List *l2)
}
}
foreach(i, l2)
- {
retval = lappend(retval, lfirst(i));
- }
return (retval);
}
@@ -356,9 +352,7 @@ LispUnioni(List *l1, List *l2)
}
}
foreach(i, l2)
- {
retval = lappendi(retval, lfirsti(i));
- }
return (retval);
}
@@ -410,13 +404,9 @@ lremove(void *elem, List *list)
if (l != NULL)
{
if (prev == NIL)
- {
result = lnext(list);
- }
else
- {
lnext(prev) = lnext(l);
- }
}
return result;
}
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index c29730db2fe..dcba4e8c889 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.35 1998/05/09 23:46:35 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.36 1998/06/15 19:28:32 momjian Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -690,9 +690,7 @@ _outFjoin(StringInfo str, Fjoin *node)
appendStringInfo(str, " :alwaysdone ");
for (i = 0; i < node->fj_nNodes; i++)
- {
appendStringInfo(str, (node->fj_alwaysDone[i]) ? "true" : "false");
- }
}
/*
@@ -779,13 +777,9 @@ _outConst(StringInfo str, Const *node)
appendStringInfo(str, node->constisnull ? "true" : "false");
appendStringInfo(str, " :constvalue ");
if (node->constisnull)
- {
appendStringInfo(str, "<>");
- }
else
- {
_outDatum(str, node->constvalue, node->consttype);
- }
appendStringInfo(str, " :constbyval ");
appendStringInfo(str, node->constbyval ? "true" : "false");
}
@@ -1496,9 +1490,7 @@ _outDatum(StringInfo str, Datum value, Oid type)
* without casting it to int first!! -mer 8 Jan 1991
*/
if (((int) length) <= -1)
- {
length = VARSIZE(s);
- }
sprintf(buf, " %d [ ", length);
appendStringInfo(str, buf);
for (i = 0; i < length; i++)
diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c
index 4ac0ee06838..54e64433b19 100644
--- a/src/backend/nodes/print.c
+++ b/src/backend/nodes/print.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.14 1998/01/20 05:03:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.15 1998/06/15 19:28:32 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -69,9 +69,7 @@ pprint(void *obj)
for (;;)
{
for (j = 0; j < indentLev * 3; j++)
- {
line[j] = ' ';
- }
for (; j < 75 && s[i] != '\0'; i++, j++)
{
line[j] = s[i];
@@ -109,9 +107,7 @@ pprint(void *obj)
printf("%s\n", line);
/* print the line before : and resets */
for (j = 0; j < indentLev * 3; j++)
- {
line[j] = ' ';
- }
}
line[j] = s[i];
break;
@@ -123,9 +119,7 @@ pprint(void *obj)
printf("%s\n", line);
}
if (j != 0)
- {
printf("%s\n", line);
- }
fflush(stdout);
return;
}
@@ -211,14 +205,10 @@ print_expr(Node *expr, List *rtable)
print_expr((Node *) get_rightop(e), rtable);
}
else
- {
printf("an expr");
- }
}
else
- {
printf("not an expr");
- }
}
/*
@@ -258,13 +248,9 @@ print_tl(List *tlist, List *rtable)
printf("\t%d %s\t", tle->resdom->resno, tle->resdom->resname);
if (tle->resdom->reskey != 0)
- {
printf("(%d):\t", tle->resdom->reskey);
- }
else
- {
printf(" :\t");
- }
print_expr(tle->expr, rtable);
printf("\n");
}
diff --git a/src/backend/nodes/read.c b/src/backend/nodes/read.c
index a0a627899c2..47938774c4b 100644
--- a/src/backend/nodes/read.c
+++ b/src/backend/nodes/read.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.11 1998/02/26 04:32:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.12 1998/06/15 19:28:32 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -78,9 +78,7 @@ nodeTokenType(char *token, int length)
* skip the optional '-' (i.e. negative number)
*/
if (*token == '-')
- {
token++;
- }
/*
* See if there is a decimal point
@@ -127,9 +125,7 @@ lsptok(char *string, int *length)
{
local_str = string;
if (length == NULL)
- {
return (NULL);
- }
}
for (; *local_str == ' '
@@ -159,9 +155,7 @@ lsptok(char *string, int *length)
}
else if (*local_str == ')' || *local_str == '(' ||
*local_str == '}' || *local_str == '{')
- {
local_str++;
- }
else
{
for (; *local_str != ' '
@@ -223,9 +217,7 @@ nodeRead(bool read_car_only)
this_value = (Node *) l;
}
else
- {
this_value = nodeRead(false);
- }
break;
case RIGHT_PAREN:
this_value = NULL;
@@ -241,13 +233,9 @@ nodeRead(bool read_car_only)
* It might be NULL but it is an atom!
*/
if (read_car_only)
- {
make_dotted_pair_cell = false;
- }
else
- {
make_dotted_pair_cell = true;
- }
}
else
{
@@ -293,18 +281,12 @@ nodeRead(bool read_car_only)
lfirst(l) = this_value;
if (!read_car_only)
- {
lnext(l) = nodeRead(false);
- }
else
- {
lnext(l) = NULL;
- }
return_value = (Node *) l;
}
else
- {
return_value = this_value;
- }
return (return_value);
}
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
index 9b54731cfb0..514d0a09c95 100644
--- a/src/backend/nodes/readfuncs.c
+++ b/src/backend/nodes/readfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.29 1998/04/27 02:58:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.30 1998/06/15 19:28:33 momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -238,9 +238,7 @@ _getPlan(Plan *node)
token = lsptok(NULL, &length); /* now get the state */
if (length == 0)
- {
node->state = (EState *) NULL;
- }
else
{ /* Disgusting hack until I figure out what
* to do here */
@@ -758,29 +756,17 @@ _readExpr()
token = lsptok(NULL, &length); /* eat :opType */
token = lsptok(NULL, &length); /* get opType */
if (!strncmp(token, "op", 2))
- {
local_node->opType = OP_EXPR;
- }
else if (!strncmp(token, "func", 4))
- {
local_node->opType = FUNC_EXPR;
- }
else if (!strncmp(token, "or", 2))
- {
local_node->opType = OR_EXPR;
- }
else if (!strncmp(token, "and", 3))
- {
local_node->opType = AND_EXPR;
- }
else if (!strncmp(token, "not", 3))
- {
local_node->opType = NOT_EXPR;
- }
else if (!strncmp(token, "subp", 4))
- {
local_node->opType = SUBPLAN_EXPR;
- }
token = lsptok(NULL, &length); /* eat :oper */
local_node->oper = nodeRead(true);
@@ -953,13 +939,9 @@ _readConst()
token = lsptok(NULL, &length); /* now read it */
if (!strncmp(token, "true", 4))
- {
local_node->constisnull = true;
- }
else
- {
local_node->constisnull = false;
- }
token = lsptok(NULL, &length); /* get :constvalue */
@@ -981,13 +963,9 @@ _readConst()
token = lsptok(NULL, &length); /* now read it */
if (!strncmp(token, "true", 4))
- {
local_node->constbyval = true;
- }
else
- {
local_node->constbyval = false;
- }
return (local_node);
}
@@ -1019,13 +997,9 @@ _readFunc()
token = lsptok(NULL, &length); /* now read it */
if (!strncmp(token, "true", 4))
- {
local_node->funcisindex = true;
- }
else
- {
local_node->funcisindex = false;
- }
token = lsptok(NULL, &length); /* get :funcsize */
token = lsptok(NULL, &length); /* now read it */
@@ -1264,13 +1238,9 @@ _readRel()
token = lsptok(NULL, &length); /* now read it */
if (!strncmp(token, "true", 4))
- {
local_node->indexed = true;
- }
else
- {
local_node->indexed = false;
- }
token = lsptok(NULL, &length); /* get :pages */
token = lsptok(NULL, &length); /* now read it */
@@ -1817,13 +1787,9 @@ _readCInfo()
token = lsptok(NULL, &length); /* now read it */
if (!strncmp(token, "true", 4))
- {
local_node->notclause = true;
- }
else
- {
local_node->notclause = false;
- }
token = lsptok(NULL, &length); /* get :indexids */
local_node->indexids = nodeRead(true); /* now read it */
@@ -1917,24 +1883,16 @@ _readJInfo()
token = lsptok(NULL, &length); /* get :mergesortable */
if (!strncmp(token, "true", 4))
- {
local_node->mergesortable = true;
- }
else
- {
local_node->mergesortable = false;
- }
token = lsptok(NULL, &length); /* get :hashjoinable */
if (!strncmp(token, "true", 4))
- {
local_node->hashjoinable = true;
- }
else
- {
local_node->hashjoinable = false;
- }
return (local_node);
}
@@ -1979,193 +1937,99 @@ parsePlanString(void)
token = lsptok(NULL, &length);
if (!strncmp(token, "PLAN", length))
- {
return_value = _readPlan();
- }
else if (!strncmp(token, "RESULT", length))
- {
return_value = _readResult();
- }
else if (!strncmp(token, "APPEND", length))
- {
return_value = _readAppend();
- }
else if (!strncmp(token, "JOIN", length))
- {
return_value = _readJoin();
- }
else if (!strncmp(token, "NESTLOOP", length))
- {
return_value = _readNestLoop();
- }
else if (!strncmp(token, "MERGEJOIN", length))
- {
return_value = _readMergeJoin();
- }
else if (!strncmp(token, "HASHJOIN", length))
- {
return_value = _readHashJoin();
- }
else if (!strncmp(token, "SCAN", length))
- {
return_value = _readScan();
- }
else if (!strncmp(token, "SEQSCAN", length))
- {
return_value = _readSeqScan();
- }
else if (!strncmp(token, "INDEXSCAN", length))
- {
return_value = _readIndexScan();
- }
else if (!strncmp(token, "TEMP", length))
- {
return_value = _readTemp();
- }
else if (!strncmp(token, "SORT", length))
- {
return_value = _readSort();
- }
else if (!strncmp(token, "AGGREG", length))
- {
return_value = _readAggreg();
- }
else if (!strncmp(token, "SUBLINK", length))
- {
return_value = _readSubLink();
- }
else if (!strncmp(token, "AGG", length))
- {
return_value = _readAgg();
- }
else if (!strncmp(token, "UNIQUE", length))
- {
return_value = _readUnique();
- }
else if (!strncmp(token, "HASH", length))
- {
return_value = _readHash();
- }
else if (!strncmp(token, "RESDOM", length))
- {
return_value = _readResdom();
- }
else if (!strncmp(token, "EXPR", length))
- {
return_value = _readExpr();
- }
else if (!strncmp(token, "ARRAYREF", length))
- {
return_value = _readArrayRef();
- }
else if (!strncmp(token, "ARRAY", length))
- {
return_value = _readArray();
- }
else if (!strncmp(token, "VAR", length))
- {
return_value = _readVar();
- }
else if (!strncmp(token, "CONST", length))
- {
return_value = _readConst();
- }
else if (!strncmp(token, "FUNC", length))
- {
return_value = _readFunc();
- }
else if (!strncmp(token, "OPER", length))
- {
return_value = _readOper();
- }
else if (!strncmp(token, "PARAM", length))
- {
return_value = _readParam();
- }
else if (!strncmp(token, "ESTATE", length))
- {
return_value = _readEState();
- }
else if (!strncmp(token, "REL", length))
- {
return_value = _readRel();
- }
else if (!strncmp(token, "TLE", length))
- {
return_value = _readTargetEntry();
- }
else if (!strncmp(token, "RTE", length))
- {
return_value = _readRangeTblEntry();
- }
else if (!strncmp(token, "PATH", length))
- {
return_value = _readPath();
- }
else if (!strncmp(token, "INDEXPATH", length))
- {
return_value = _readIndexPath();
- }
else if (!strncmp(token, "JOINPATH", length))
- {
return_value = _readJoinPath();
- }
else if (!strncmp(token, "MERGEPATH", length))
- {
return_value = _readMergePath();
- }
else if (!strncmp(token, "HASHPATH", length))
- {
return_value = _readHashPath();
- }
else if (!strncmp(token, "ORDERKEY", length))
- {
return_value = _readOrderKey();
- }
else if (!strncmp(token, "JOINKEY", length))
- {
return_value = _readJoinKey();
- }
else if (!strncmp(token, "MERGEORDER", length))
- {
return_value = _readMergeOrder();
- }
else if (!strncmp(token, "CINFO", length))
- {
return_value = _readCInfo();
- }
else if (!strncmp(token, "JOINMETHOD", length))
- {
return_value = _readJoinMethod();
- }
else if (!strncmp(token, "JINFO", length))
- {
return_value = _readJInfo();
- }
else if (!strncmp(token, "HINFO", length))
- {
return_value = _readHInfo();
- }
else if (!strncmp(token, "ITER", length))
- {
return_value = _readIter();
- }
else if (!strncmp(token, "QUERY", length))
- {
return_value = _readQuery();
- }
else if (!strncmp(token, "SORTCLAUSE", length))
- {
return_value = _readSortClause();
- }
else if (!strncmp(token, "GROUPCLAUSE", length))
- {
return_value = _readGroupClause();
- }
else
- {
elog(ERROR, "badly formatted planstring \"%.10s\"...\n", token);
- }
return ((Node *) return_value);
}
@@ -2202,9 +2066,7 @@ readDatum(Oid type)
if (byValue)
{
if (length > sizeof(Datum))
- {
elog(ERROR, "readValue: byval & length = %d", length);
- }
s = (char *) (&res);
for (i = 0; i < sizeof(Datum); i++)
{
@@ -2213,9 +2075,7 @@ readDatum(Oid type)
}
}
else if (length <= 0)
- {
s = NULL;
- }
else if (length >= 1)
{
s = (char *) palloc(length);
@@ -2230,9 +2090,7 @@ readDatum(Oid type)
token = lsptok(NULL, &tokenLength); /* skip the ']' */
if (token[0] != ']')
- {
elog(ERROR, "readValue: ']' expected, length =%d", length);
- }
return (res);
}
diff --git a/src/backend/optimizer/geqo/geqo_erx.c b/src/backend/optimizer/geqo/geqo_erx.c
index 8dc2f9fb4bd..4a8d53e7a12 100644
--- a/src/backend/optimizer/geqo/geqo_erx.c
+++ b/src/backend/optimizer/geqo/geqo_erx.c
@@ -3,7 +3,7 @@
* geqo_erx.c--
* edge recombination crossover [ER]
*
-* $Id: geqo_erx.c,v 1.8 1998/02/26 04:32:20 momjian Exp $
+* $Id: geqo_erx.c,v 1.9 1998/06/15 19:28:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -228,9 +228,7 @@ gimme_tour(Edge *edge_table, Gene *new_gene, int num_gene)
/* find destination for the newly entered point */
if (edge_table[new_gene[i - 1]].unused_edges > 0)
- {
new_gene[i] = gimme_gene(edge_table[(int) new_gene[i - 1]], edge_table);
- }
else
{ /* cope with fault */
diff --git a/src/backend/optimizer/geqo/geqo_eval.c b/src/backend/optimizer/geqo/geqo_eval.c
index 67b967533fe..7430b34bccd 100644
--- a/src/backend/optimizer/geqo/geqo_eval.c
+++ b/src/backend/optimizer/geqo/geqo_eval.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_eval.c,v 1.18 1998/02/26 04:32:21 momjian Exp $
+ * $Id: geqo_eval.c,v 1.19 1998/06/15 19:28:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -131,9 +131,7 @@ gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, Rel *outer_rel)
new_rels = lcons(gimme_clauseless_join(outer_rel, outer_rel), NIL); /* ??? MAU */
}
else
- {
new_rels = lcons(gimme_clauseless_join(outer_rel, inner_rel), NIL);
- }
}
/* process new_rel->pathlist */
@@ -221,9 +219,7 @@ gimme_clause_joins(Query *root, Rel *outer_rel, Rel *inner_rel)
rel = init_join_rel(outer_rel, get_join_rel(root, other_rels), joininfo);
}
else
- {
rel = NULL;
- }
if (rel != NULL)
join_list = lappend(join_list, rel);
@@ -700,18 +696,12 @@ geqo_joinrel_size(Rel *joinrel, Rel *outer_rel, Rel *inner_rel)
temp = (Cost) inner_rel->tuples * (Cost) outer_rel->tuples; /* cartesian product */
if (joinrel->clauseinfo)
- {
temp = temp * product_selec(joinrel->clauseinfo);
- }
if (temp >= (MAXINT - 1))
- {
ntuples = ceil(geqo_log((double) temp, (double) GEQO_LOG_BASE));
- }
else
- {
ntuples = ceil((double) temp);
- }
if (ntuples < 1)
ntuples = 1; /* make the best case 1 instead of 0 */
diff --git a/src/backend/optimizer/geqo/geqo_misc.c b/src/backend/optimizer/geqo/geqo_misc.c
index edb29e5154a..99b968ec3b6 100644
--- a/src/backend/optimizer/geqo/geqo_misc.c
+++ b/src/backend/optimizer/geqo/geqo_misc.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_misc.c,v 1.7 1998/01/07 21:03:44 momjian Exp $
+ * $Id: geqo_misc.c,v 1.8 1998/06/15 19:28:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -269,16 +269,12 @@ geqo_print_rel(Query *root, Rel *rel)
printf("______________________________\n");
printf("(");
foreach(l, rel->relids)
- {
printf("%d ", lfirsti(l));
- }
printf("): size=%d width=%d\n", rel->size, rel->width);
printf("\tpath list:\n");
foreach(l, rel->pathlist)
- {
geqo_print_path(root, lfirst(l), 1);
- }
printf("\tcheapest path:\n");
geqo_print_path(root, rel->cheapestpath, 1);
diff --git a/src/backend/optimizer/geqo/geqo_params.c b/src/backend/optimizer/geqo/geqo_params.c
index 0deed36e16f..0b1636125df 100644
--- a/src/backend/optimizer/geqo/geqo_params.c
+++ b/src/backend/optimizer/geqo/geqo_params.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
-* $Id: geqo_params.c,v 1.8 1997/09/08 21:44:30 momjian Exp $
+* $Id: geqo_params.c,v 1.9 1998/06/15 19:28:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -205,9 +205,7 @@ geqo_params(int string_length)
}
else
- {
elog(DEBUG, "geqo_params: ga parameter file\n\'%s\'\ndoes not exist or permissions are not setup correctly", conf_file);
- }
/*
* parameter checkings follow
@@ -317,13 +315,9 @@ gimme_pool_size(int string_length)
size = pow(2.0, exponent);
if (size < MIN_POOL)
- {
return (MIN_POOL);
- }
else if (size > MAX_POOL)
- {
return (MAX_POOL);
- }
else
return ((int) ceil(size));
}
diff --git a/src/backend/optimizer/geqo/geqo_paths.c b/src/backend/optimizer/geqo/geqo_paths.c
index f347ebb784a..a46a6c30a03 100644
--- a/src/backend/optimizer/geqo/geqo_paths.c
+++ b/src/backend/optimizer/geqo/geqo_paths.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_paths.c,v 1.8 1998/02/26 04:32:23 momjian Exp $
+ * $Id: geqo_paths.c,v 1.9 1998/06/15 19:28:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -147,9 +147,7 @@ set_paths(Rel *rel, Path *unorderedpath)
rel->pathlist = lremove(unorderedpath, rel->pathlist);
}
else
- {
rel->unorderedpath = (Path *) unorderedpath;
- }
return (cheapest);
}
diff --git a/src/backend/optimizer/geqo/geqo_pool.c b/src/backend/optimizer/geqo/geqo_pool.c
index 5d13b48b254..84210a4a437 100644
--- a/src/backend/optimizer/geqo/geqo_pool.c
+++ b/src/backend/optimizer/geqo/geqo_pool.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_pool.c,v 1.7 1998/04/06 02:38:04 momjian Exp $
+ * $Id: geqo_pool.c,v 1.8 1998/06/15 19:28:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -66,9 +66,7 @@ alloc_pool(int pool_size, int string_length)
/* all gene */
chromo = (Chromosome *) new_pool->data; /* vector of all chromos */
for (i = 0; i < pool_size; i++)
- {
chromo[i].string = palloc((string_length + 1) * sizeof(Gene));
- }
return (new_pool);
}
diff --git a/src/backend/optimizer/geqo/geqo_px.c b/src/backend/optimizer/geqo/geqo_px.c
index 6751d566b32..7731710a0db 100644
--- a/src/backend/optimizer/geqo/geqo_px.c
+++ b/src/backend/optimizer/geqo/geqo_px.c
@@ -6,7 +6,7 @@
* PX operator according to Syswerda
* (The Genetic Algorithms Handbook, L Davis, ed)
*
-* $Id: geqo_px.c,v 1.4 1997/09/08 21:44:35 momjian Exp $
+* $Id: geqo_px.c,v 1.5 1998/06/15 19:28:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -70,9 +70,7 @@ px(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
/* initialize city table */
for (i = 1; i <= num_gene; i++)
- {
city_table[i].used = 0;
- }
/* choose random positions that will be inherited directly from parent */
num_positions = geqo_randint(2 * num_gene / 3, num_gene / 3);
diff --git a/src/backend/optimizer/geqo/minspantree.c b/src/backend/optimizer/geqo/minspantree.c
index bb5863fec70..9d5eba97d68 100644
--- a/src/backend/optimizer/geqo/minspantree.c
+++ b/src/backend/optimizer/geqo/minspantree.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
-* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.4 1997/09/08 21:44:42 momjian Exp $
+* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.5 1998/06/15 19:28:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,9 +88,7 @@ minspantree(Query *root, List *join_rels, Rel *garel)
id2 = (int) lsecond(joinrel->relids);
if (id1 > id2)
- {
tmprel_array[id2][id1] = *(Rel *) joinrel;
- }
else
{
tmprel_array[id1][id2] = *(Rel *) joinrel; /* ever reached? */
@@ -121,25 +119,17 @@ minspantree(Query *root, List *join_rels, Rel *garel)
{
garel[1] = tmprel_array[1][3];
if (rel12->cheapestpath->path_cost > rel23->cheapestpath->path_cost)
- {
garel[2] = tmprel_array[2][3];
- }
else
- {
garel[2] = tmprel_array[1][2];
- }
}
else
{
garel[1] = tmprel_array[1][2];
if (rel13->cheapestpath->path_cost > rel23->cheapestpath->path_cost)
- {
garel[2] = tmprel_array[2][3];
- }
else
- {
garel[2] = tmprel_array[1][3];
- }
}
}
@@ -169,13 +159,9 @@ minspantree(Query *root, List *join_rels, Rel *garel)
if (connectto[tempn] != 0)
{
if (n > tempn)
- {
joinrel = (Rel *) &tmprel_array[tempn][n];
- }
else
- {
joinrel = (Rel *) &tmprel_array[n][tempn];
- }
dist = joinrel->cheapestpath->path_cost;
if (dist < disttoconnect[tempn])
@@ -192,13 +178,9 @@ minspantree(Query *root, List *join_rels, Rel *garel)
}
n = nextn;
if (n > connectto[n])
- {
garel[i] = tmprel_array[connectto[n]][n];
- }
else
- {
garel[i] = tmprel_array[n][connectto[n]];
- }
i++;
}
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 8548dcf5426..53b78cdfdc1 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.15 1998/02/26 04:32:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.16 1998/06/15 19:28:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -259,9 +259,7 @@ find_join_paths(Query *root, List *outer_rels, int levels_needed)
root->join_relation_list_ = outer_rels;
}
else
- {
root->join_relation_list_ = new_rels;
- }
if (!BushyPlanFlag)
outer_rels = new_rels;
}
@@ -407,16 +405,12 @@ debug_print_rel(Query *root, Rel *rel)
printf("(");
foreach(l, rel->relids)
- {
printf("%d ", lfirsti(l));
- }
printf("): size=%d width=%d\n", rel->size, rel->width);
printf("\tpath list:\n");
foreach(l, rel->pathlist)
- {
print_path(root, lfirst(l), 1);
- }
printf("\tcheapest path:\n");
print_path(root, rel->cheapestpath, 1);
}
diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c
index 5e723d9603e..ef7b5902347 100644
--- a/src/backend/optimizer/path/clausesel.c
+++ b/src/backend/optimizer/path/clausesel.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.7 1998/04/27 04:05:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.8 1998/06/15 19:28:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -54,9 +54,7 @@ set_clause_selectivities(List *clauseinfo_list, Cost new_selectivity)
clausenode = (CInfo *) lfirst(temp);
cost_clause = clausenode->selectivity;
if (FLOAT_IS_ZERO(cost_clause) || new_selectivity < cost_clause)
- {
clausenode->selectivity = new_selectivity;
- }
}
}
@@ -225,18 +223,14 @@ compute_selec(Query *root, List *clauses, List *or_selectivities)
List *clause = lfirst(clauses);
if (clauses == NULL)
- {
s1 = 1.0;
- }
else if (IsA(clause, Param))
{
/* XXX How're we handling this before?? -ay */
s1 = 1.0;
}
else if (IsA(clause, Const))
- {
s1 = ((bool) ((Const *) clause)->constvalue) ? 1.0 : 0.0;
- }
else if (IsA(clause, Var))
{
Oid relid = getrelid(((Var *) clause)->varno,
@@ -369,9 +363,7 @@ compute_selec(Query *root, List *clauses, List *or_selectivities)
*/
if (length(clauses) < 2)
- {
return (s1);
- }
else
{
/* Compute selectivity of the 'or'ed subclauses. */
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index b86e727da46..efe2fab25d9 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.20 1998/01/13 04:04:06 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.21 1998/06/15 19:28:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -368,13 +368,9 @@ compute_rel_size(Rel *rel)
temp = rel->tuples * product_selec(rel->clauseinfo);
Assert(temp >= 0);
if (temp >= (MAXINT - 1))
- {
temp1 = MAXINT;
- }
else
- {
temp1 = ceil((double) temp);
- }
Assert(temp1 >= 0);
Assert(temp1 <= MAXINT);
return (temp1);
@@ -449,9 +445,7 @@ compute_joinrel_size(JoinPath *joinpath)
temp = temp * product_selec(joinpath->pathclauseinfo);
if (temp >= (MAXINT - 1))
- {
temp1 = MAXINT;
- }
else
{
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index 0a960033302..fec093cd67a 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.15 1998/04/27 04:05:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.16 1998/06/15 19:28:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -662,9 +662,7 @@ match_clause_to_indexkey(Rel *rel,
else if (leftop
&& match_index_to_operand(indexkey,
(Expr *) leftop, rel, index))
- {
join_op = ((Oper *) ((Expr *) clause)->oper)->opno;
- }
if (join_op && op_class(join_op, xclass, index->relam) &&
join_clause_p((Node *) clause))
@@ -943,9 +941,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
!IsA(predicate->oper, Oper) ||
!IsA(pred_var, Var) ||
!IsA(pred_const, Const))
- {
return false;
- }
/*
* The implication can't be determined unless the predicate and the
@@ -1161,9 +1157,7 @@ extract_restrict_clauses(List *clausegroup)
CInfo *cinfo = lfirst(l);
if (!join_clause_p((Node *) cinfo->clause))
- {
restrict_cls = lappend(restrict_cls, cinfo);
- }
}
return restrict_cls;
}
@@ -1293,9 +1287,7 @@ create_index_paths(Query *root,
if (!(join_clause_p((Node *) clauseinfo->clause) &&
equal_path_merge_ordering(index->ordering,
clauseinfo->mergesortorder)))
- {
temp = false;
- }
}
if (!join || temp)
diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index fd584d6a1d4..33448a6c037 100644
--- a/src/backend/optimizer/path/joinpath.c
+++ b/src/backend/optimizer/path/joinpath.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.5 1997/09/08 21:44:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.6 1998/06/15 19:28:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -180,9 +180,7 @@ find_all_join_paths(Query *root, List *joinrels)
* wierd behavior.
*/
if (IsA_JoinPath(path))
- {
((Path *) lfirst(path))->outerjoincost = (Cost) 0;
- }
/*
* do it iff it is a join path, which is not always true, esp
@@ -354,9 +352,7 @@ match_unsorted_outer(Rel *joinrel,
}
if (xmergeinfo)
- {
clauses = xmergeinfo->jmethod.clauses;
- }
if (clauses)
{
@@ -374,19 +370,13 @@ match_unsorted_outer(Rel *joinrel,
joinrel->targetlist, clauses);
}
else
- {
merge_pathkeys = outerpath->keys;
- }
if (best_innerjoin &&
path_is_cheaper(best_innerjoin, cheapest_inner))
- {
nestinnerpath = best_innerjoin;
- }
else
- {
nestinnerpath = cheapest_inner;
- }
paths = lcons(create_nestloop_path(joinrel,
outerrel,
@@ -429,13 +419,9 @@ match_unsorted_outer(Rel *joinrel,
* wouldn't otherwise be considered.
*/
if (path_is_cheaper_than_sort)
- {
mergeinnerpath->outerjoincost = outerpath->path_cost;
- }
else
- {
mergeinnerpath = cheapest_inner;
- }
temp_node =
lcons(create_mergesort_path(joinrel,
@@ -453,9 +439,7 @@ match_unsorted_outer(Rel *joinrel,
paths);
}
else
- {
temp_node = paths;
- }
jp_list = nconc(jp_list, temp_node);
}
return (jp_list);
@@ -518,9 +502,7 @@ match_unsorted_inner(Rel *joinrel,
}
if (xmergeinfo)
- {
clauses = ((JoinMethod *) xmergeinfo)->clauses;
- }
if (clauses)
{
diff --git a/src/backend/optimizer/path/joinrels.c b/src/backend/optimizer/path/joinrels.c
index 00277253468..48b0b28c52f 100644
--- a/src/backend/optimizer/path/joinrels.c
+++ b/src/backend/optimizer/path/joinrels.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.9 1998/03/30 16:46:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.10 1998/06/15 19:28:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -138,9 +138,7 @@ find_clause_joins(Query *root, Rel *outer_rel, List *joininfo_list)
joininfo);
}
else
- {
rel = NULL;
- }
if (rel != NULL)
join_list = lappend(join_list, rel);
diff --git a/src/backend/optimizer/path/joinutils.c b/src/backend/optimizer/path/joinutils.c
index 2dfad7ec594..f1deabea5d5 100644
--- a/src/backend/optimizer/path/joinutils.c
+++ b/src/backend/optimizer/path/joinutils.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.5 1998/02/26 04:32:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.6 1998/06/15 19:28:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -106,16 +106,12 @@ match_pathkeys_joinkeys(List *pathkeys,
joinkeys = LispRemove(xjoinkey, joinkeys);
}
else
- {
return (NIL);
- }
}
if (matched_joinkeys == NULL ||
length(matched_joinkeys) != length(pathkeys))
- {
return NIL;
- }
*matchedJoinClausesPtr = nreverse(matched_joinclauses);
return (nreverse(matched_joinkeys));
@@ -239,9 +235,7 @@ match_paths_joinkeys(List *joinkeys,
matched_path = path;
}
else
- {
matched_path = path;
- }
}
}
return matched_path;
@@ -341,9 +335,7 @@ new_join_pathkeys(List *outer_pathkeys,
x = new_join_pathkey(outer_pathkey, NIL,
join_rel_tlist, joinclauses);
if (x != NIL)
- {
t_list = lappend(t_list, x);
- }
}
return (t_list);
}
@@ -396,9 +388,7 @@ new_join_pathkey(List *subkeys,
matched_subkeys);
}
else
- {
newly_considered_subkeys = matched_subkeys;
- }
considered_subkeys =
append(considered_subkeys, newly_considered_subkeys);
diff --git a/src/backend/optimizer/path/orindxpath.c b/src/backend/optimizer/path/orindxpath.c
index 073aa18eb9a..fc535ba8ba6 100644
--- a/src/backend/optimizer/path/orindxpath.c
+++ b/src/backend/optimizer/path/orindxpath.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.5 1998/02/26 04:32:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.6 1998/06/15 19:28:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -128,9 +128,7 @@ create_or_index_paths(Query *root,
create_or_index_paths(root, rel, lnext(clauses)));
}
else
- {
t_list = create_or_index_paths(root, rel, lnext(clauses));
- }
}
}
@@ -237,21 +235,13 @@ best_or_subclause_index(Query *root,
Cost subclause_selec;
if (constant_on_right)
- {
value = ((Const *) get_rightop(subclause))->constvalue;
- }
else
- {
value = NameGetDatum("");
- }
if (constant_on_right)
- {
flag = (_SELEC_IS_CONSTANT_ || _SELEC_CONSTANT_RIGHT_);
- }
else
- {
flag = _SELEC_CONSTANT_RIGHT_;
- }
index_selectivity(lfirsti(index->relids),
index->classlist,
lconsi(opno, NIL),
diff --git a/src/backend/optimizer/path/predmig.c b/src/backend/optimizer/path/predmig.c
index 0a73ea8b33e..e67188fa418 100644
--- a/src/backend/optimizer/path/predmig.c
+++ b/src/backend/optimizer/path/predmig.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.10 1998/03/30 16:46:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.11 1998/06/15 19:28:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -444,9 +444,7 @@ xfunc_form_groups(Query *queryInfo, Stream root, Stream bottom)
primjoin, NIL));
}
else
- {
set_groupsel(temp, 1.0);
- }
}
else
/* a restriction, or 2-ary join pred */
diff --git a/src/backend/optimizer/path/prune.c b/src/backend/optimizer/path/prune.c
index 250a670fc43..85bc780261b 100644
--- a/src/backend/optimizer/path/prune.c
+++ b/src/backend/optimizer/path/prune.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.13 1998/04/02 07:27:15 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.14 1998/06/15 19:28:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,9 +75,7 @@ prune_joinrel(Rel *rel, List *other_rels)
other_rel->pathlist);
}
else
- {
result = nconc(result, lcons(other_rel, NIL));
- }
}
return (result);
}
@@ -110,15 +108,11 @@ prune_rel_paths(List *rel_list)
path = (Path *) lfirst(y);
if (!path->p_ordering.ord.sortop)
- {
break;
- }
}
cheapest = (JoinPath *) prune_rel_path(rel, path);
if (IsA_JoinPath(cheapest))
- {
rel->size = compute_joinrel_size(cheapest);
- }
else
elog(ERROR, "non JoinPath called");
}
@@ -149,9 +143,7 @@ prune_rel_path(Rel *rel, Path *unorderedpath)
rel->pathlist = lremove(unorderedpath, rel->pathlist);
}
else
- {
rel->unorderedpath = (Path *) unorderedpath;
- }
return (cheapest);
}
diff --git a/src/backend/optimizer/path/xfunc.c b/src/backend/optimizer/path/xfunc.c
index 935a2422f52..6aaf09823df 100644
--- a/src/backend/optimizer/path/xfunc.c
+++ b/src/backend/optimizer/path/xfunc.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.14 1998/06/15 18:39:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.15 1998/06/15 19:28:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -335,13 +335,9 @@ xfunc_pullup(Query *queryInfo,
(LispValue) get_locclauseinfo(parentpath)));
/* put new childpath into the path tree */
if (whichchild == INNER)
- {
set_innerjoinpath(parentpath, (pathPtr) newkid);
- }
else
- {
set_outerjoinpath(parentpath, (pathPtr) newkid);
- }
/*
* * recompute parentpath cost from scratch -- the cost * of the join
@@ -497,9 +493,7 @@ xfunc_func_expense(LispValue node, LispValue args)
elog(ERROR, "Oper's function is undefined");
}
else
- {
funcid = get_funcid((Func) node);
- }
/* look up tuple in cache */
tupl = SearchSysCacheTuple(PROOID, ObjectIdGetDatum(funcid), 0, 0, 0);
@@ -1188,9 +1182,7 @@ xfunc_fixvars(LispValue clause, /* clause being pulled up */
tmpclause = lnext(tmpclause))
xfunc_fixvars(lfirst(tmpclause), rel, varno);
else
- {
elog(ERROR, "Clause node of undetermined type");
- }
}
@@ -1411,9 +1403,7 @@ xfunc_LispRemove(LispValue foo, List bar)
for (temp = bar; !null(temp); temp = lnext(temp))
if (!equal((Node) (foo), (Node) (lfirst(temp))))
- {
result = lappend(result, lfirst(temp));
- }
else
sanity = true; /* found a matching item to remove! */
@@ -1444,9 +1434,7 @@ xfunc_copyrel(Rel from, Rel *to)
/* COPY_CHECKARGS() */
if (to == NULL)
- {
return false;
- }
/* COPY_CHECKNULL() */
if (from == NULL)
@@ -1458,9 +1446,7 @@ xfunc_copyrel(Rel from, Rel *to)
/* COPY_NEW(c) */
newnode = (Rel) (*alloc) (classSize(Rel));
if (newnode == NULL)
- {
return false;
- }
/* ----------------
* copy node superclass fields
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 7c450104ce7..22d44471ac4 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.27 1998/02/26 04:32:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.28 1998/06/15 19:28:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -678,9 +678,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
while (indexkeys[pos] != 0)
{
if (varatt == indexkeys[pos])
- {
break;
- }
pos++;
}
}
@@ -689,14 +687,10 @@ fix_indxqual_references(Node *clause, Path *index_path)
return (newclause);
}
else
- {
return (clause);
- }
}
else if (IsA(clause, Const))
- {
return (clause);
- }
else if (IsA(clause, Param))
{
/* Function parameter used as index scan arg. DZ - 27-8-1996 */
@@ -749,9 +743,7 @@ fix_indxqual_references(Node *clause, Path *index_path)
make_clause(expr->opType, expr->oper, new_subclauses);
}
else
- {
return (clause);
- }
}
else
{
@@ -776,13 +768,9 @@ fix_indxqual_references(Node *clause, Path *index_path)
* (var const) ...) ?
*/
if (new_subclauses)
- {
return (Node *) new_subclauses;
- }
else
- {
return (clause);
- }
}
}
@@ -1179,9 +1167,7 @@ make_unique(List *tlist, Plan *lefttree, char *uniqueAttr)
if (strcmp(uniqueAttr, "*") == 0)
node->uniqueAttr = NULL;
else
- {
node->uniqueAttr = pstrdup(uniqueAttr);
- }
return (node);
}
@@ -1209,9 +1195,7 @@ generate_fjoin(List *tlist)
fjoinList = lappend(fjoinList, tlistElem);
}
else
- {
newTlist = lappend(newTlist, tlistElem);
- }
}
/*
diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c
index 914788d8bb8..cacf728f4d4 100644
--- a/src/backend/optimizer/plan/initsplan.c
+++ b/src/backend/optimizer/plan/initsplan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.11 1998/03/16 05:49:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.12 1998/06/15 19:28:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -150,9 +150,7 @@ initialize_base_rels_jinfo(Query *root, List *clauses)
List *clause;
foreach(clause, clauses)
- {
add_clause_to_rels(root, lfirst(clause));
- }
return;
}
diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c
index e9f27cd5098..9af01930374 100644
--- a/src/backend/optimizer/plan/planmain.c
+++ b/src/backend/optimizer/plan/planmain.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.21 1998/03/31 23:30:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.22 1998/06/15 19:28:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -162,9 +162,7 @@ query_planner(Query *root,
(Plan *) scan));
}
else
- {
return ((Plan *) scan);
- }
}
break;
@@ -308,9 +306,7 @@ subplanner(Query *root,
* it.
*/
if (final_relation)
- {
return (create_plan((Path *) final_relation->cheapestpath));
- }
else
{
elog(NOTICE, "final relation is nil");
@@ -423,9 +419,7 @@ make_groupPlan(List **tlist,
}
if (length(glc) != 0)
- {
elog(ERROR, "group attribute disappeared from target list");
- }
/*
* If non-GroupBy entries were removed from TL - we are to add Vars
diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c
index 422ef3cc29a..c1e3194133b 100644
--- a/src/backend/optimizer/plan/setrefs.c
+++ b/src/backend/optimizer/plan/setrefs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.21 1998/04/15 15:29:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.22 1998/06/15 19:28:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -73,34 +73,22 @@ set_tlist_references(Plan *plan)
return;
if (IsA_Join(plan))
- {
set_join_tlist_references((Join *) plan);
- }
else if (IsA(plan, SeqScan) &&plan->lefttree &&
IsA_Temp(plan->lefttree))
- {
set_tempscan_tlist_references((SeqScan *) plan);
- }
else if (IsA(plan, Sort))
- {
set_temp_tlist_references((Temp *) plan);
- }
else if (IsA(plan, Result))
- {
set_result_tlist_references((Result *) plan);
- }
else if (IsA(plan, Hash))
- {
set_tlist_references(plan->lefttree);
- }
else if (IsA(plan, Choose))
{
List *x;
foreach(x, ((Choose *) plan)->chooseplanlist)
- {
set_tlist_references((Plan *) lfirst(x));
- }
}
}
@@ -200,9 +188,7 @@ set_temp_tlist_references(Temp *temp)
(source)->targetlist);
}
else
- {
elog(ERROR, "calling set_temp_tlist_references with empty lefttree");
- }
}
/*
@@ -326,9 +312,7 @@ replace_clause_joinvar_refs(Expr *clause,
return (NIL);
}
else if (single_node((Node *) clause))
- {
return ((List *) clause);
- }
else if (and_clause((Node *) clause))
{
List *andclause =
@@ -609,9 +593,7 @@ replace_result_clause(Node *clause,
((Var *) clause)->varattno = subplanVar->resdom->resno;
}
else if (IsA(clause, Aggreg))
- {
replace_result_clause(((Aggreg *) clause)->target, subplanTargetList);
- }
else if (is_funcclause(clause))
{
List *subExpr;
@@ -622,9 +604,7 @@ replace_result_clause(Node *clause,
*/
subExpr = ((Expr *) clause)->args;
foreach(t, subExpr)
- {
replace_result_clause(lfirst(t), subplanTargetList);
- }
}
else if (IsA(clause, ArrayRef))
{
@@ -635,13 +615,9 @@ replace_result_clause(Node *clause,
* expression and its index expression...
*/
foreach(t, aref->refupperindexpr)
- {
replace_result_clause(lfirst(t), subplanTargetList);
- }
foreach(t, aref->reflowerindexpr)
- {
replace_result_clause(lfirst(t), subplanTargetList);
- }
replace_result_clause(aref->refexpr,
subplanTargetList);
replace_result_clause(aref->refassgnexpr,
@@ -687,18 +663,14 @@ OperandIsInner(Node *opnd, int inner_relid)
*/
if (IsA(opnd, Var) &&
(inner_relid == ((Var *) opnd)->varno))
- {
return true;
- }
if (is_funcclause(opnd))
{
List *firstArg = lfirst(((Expr *) opnd)->args);
if (IsA(firstArg, Var) &&
(inner_relid == ((Var *) firstArg)->varno))
- {
return true;
- }
}
return false;
}
@@ -864,9 +836,7 @@ del_agg_clause(Node *clause)
List *t;
if (IsA(clause, Var))
- {
return clause;
- }
else if (is_funcclause(clause))
{
@@ -875,9 +845,7 @@ del_agg_clause(Node *clause)
* arguments...
*/
foreach(t, ((Expr *) clause)->args)
- {
lfirst(t) = del_agg_clause(lfirst(t));
- }
}
else if (IsA(clause, Aggreg))
{
@@ -895,13 +863,9 @@ del_agg_clause(Node *clause)
* expression and its index expression...
*/
foreach(t, aref->refupperindexpr)
- {
lfirst(t) = del_agg_clause(lfirst(t));
- }
foreach(t, aref->reflowerindexpr)
- {
lfirst(t) = del_agg_clause(lfirst(t));
- }
aref->refexpr = del_agg_clause(aref->refexpr);
aref->refassgnexpr = del_agg_clause(aref->refassgnexpr);
}
@@ -921,9 +885,7 @@ del_agg_clause(Node *clause)
right = del_agg_clause(right);
}
else if (IsA(clause, Param) ||IsA(clause, Const))
- {
return clause;
- }
else
{
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c
index 11e466ce5ef..559b28bbd74 100644
--- a/src/backend/optimizer/plan/subselect.c
+++ b/src/backend/optimizer/plan/subselect.c
@@ -92,9 +92,7 @@ _replace_var(Var *var)
}
if ((i = lfirsti(vpe)) < 0) /* parameter is not assigned */
- {
i = _new_param(var, PlannerQueryLevel - var->varlevelsup);
- }
retval = makeNode(Param);
retval->paramkind = PARAM_EXEC;
diff --git a/src/backend/optimizer/prep/prepqual.c b/src/backend/optimizer/prep/prepqual.c
index b6443b8a094..7bb288f9566 100644
--- a/src/backend/optimizer/prep/prepqual.c
+++ b/src/backend/optimizer/prep/prepqual.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.8 1998/02/26 04:32:57 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.9 1998/06/15 19:28:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -129,13 +129,9 @@ pull_args(Expr *qual)
return (make_orclause(pull_ors(t_list)));
}
else if (not_clause((Node *) qual))
- {
return (make_notclause(pull_args(get_notclausearg(qual))));
- }
else
- {
return (qual);
- }
}
/*
@@ -159,9 +155,7 @@ pull_ors(List *orlist)
copyObject((Node *) lnext(orlist)))));
}
else
- {
return (lcons(lfirst(orlist), pull_ors(lnext(orlist))));
- }
}
/*
@@ -185,9 +179,7 @@ pull_ands(List *andlist)
copyObject((Node *) lnext(andlist)))));
}
else
- {
return (lcons(lfirst(andlist), pull_ands(lnext(andlist))));
- }
}
/*
@@ -219,9 +211,7 @@ find_nots(Expr *qual)
List *t_list = NIL;
foreach(temp, qual->args)
- {
t_list = lappend(t_list, find_nots(lfirst(temp)));
- }
return (make_andclause(t_list));
}
@@ -231,9 +221,7 @@ find_nots(Expr *qual)
List *t_list = NIL;
foreach(temp, qual->args)
- {
t_list = lappend(t_list, find_nots(lfirst(temp)));
- }
return (make_orclause(t_list));
}
else if (not_clause((Node *) qual))
@@ -277,9 +265,7 @@ push_nots(Expr *qual)
(make_opclause(op, get_leftop(qual), get_rightop(qual)));
}
else
- {
return (make_notclause(qual));
- }
}
else if (and_clause((Node *) qual))
{
@@ -293,9 +279,7 @@ push_nots(Expr *qual)
List *t_list = NIL;
foreach(temp, qual->args)
- {
t_list = lappend(t_list, push_nots(lfirst(temp)));
- }
return (make_orclause(t_list));
}
else if (or_clause((Node *) qual))
@@ -304,9 +288,7 @@ push_nots(Expr *qual)
List *t_list = NIL;
foreach(temp, qual->args)
- {
t_list = lappend(t_list, push_nots(lfirst(temp)));
- }
return (make_andclause(t_list));
}
else if (not_clause((Node *) qual))
@@ -357,9 +339,7 @@ normalize(Expr *qual)
List *t_list = NIL;
foreach(temp, qual->args)
- {
t_list = lappend(t_list, normalize(lfirst(temp)));
- }
return (make_andclause(t_list));
}
else if (or_clause((Node *) qual))
@@ -370,9 +350,7 @@ normalize(Expr *qual)
bool has_andclause = FALSE;
foreach(temp, qual->args)
- {
orlist = lappend(orlist, normalize(lfirst(temp)));
- }
foreach(temp, orlist)
{
if (and_clause(lfirst(temp)))
@@ -427,9 +405,7 @@ or_normalize(List *orlist)
lnext(new_orlist))));
}
else
- {
return (orlist);
- }
}
/*
@@ -562,13 +538,9 @@ remove_ands(Expr *qual)
return ((List *) make_orclause((List *) t_list));
}
else if (not_clause((Node *) qual))
- {
return ((List *) make_notclause((Expr *) remove_ands((Expr *) get_notclausearg(qual))));
- }
else
- {
return ((List *) qual);
- }
}
/*****************************************************************************
diff --git a/src/backend/optimizer/prep/preptlist.c b/src/backend/optimizer/prep/preptlist.c
index 5e67d26010a..3f97f7bda6c 100644
--- a/src/backend/optimizer/prep/preptlist.c
+++ b/src/backend/optimizer/prep/preptlist.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.10 1998/02/26 04:33:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.11 1998/06/15 19:28:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -67,9 +67,7 @@ preprocess_targetlist(List *tlist,
List *temp = NIL;
if (result_relation >= 1 && command_type != CMD_SELECT)
- {
relid = getrelid(result_relation, range_table);
- }
/*
* for heap_formtuple to work, the targetlist must match the exact
@@ -171,9 +169,7 @@ expand_targetlist(List *tlist,
return (replace_matching_resname(ntlist, tlist));
}
else
- {
return (tlist);
- }
}
@@ -210,9 +206,7 @@ replace_matching_resname(List *new_tlist, List *old_tlist)
t_list = lappend(t_list, matching_old_tl);
}
else
- {
t_list = lappend(t_list, new_tle);
- }
}
/*
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c
index 5cede30f487..0c09c1e82ba 100644
--- a/src/backend/optimizer/prep/prepunion.c
+++ b/src/backend/optimizer/prep/prepunion.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.23 1998/03/31 23:30:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.24 1998/06/15 19:28:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -333,9 +333,7 @@ find_all_inheritors(List *unexamined_relids,
new_examined_relids);
if (new_unexamined_relids == NULL)
- {
return (new_examined_relids);
- }
else
{
return (find_all_inheritors(new_unexamined_relids,
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index 17b6113be83..e37da74b53e 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.16 1998/02/26 04:33:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.17 1998/06/15 19:28:47 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -332,13 +332,9 @@ pull_constant_clauses(List *quals, List **constantQual)
foreach(q, quals)
{
if (!contain_var_clause(lfirst(q)))
- {
constqual = lcons(lfirst(q), constqual);
- }
else
- {
restqual = lcons(lfirst(q), restqual);
- }
}
freeList(quals);
*constantQual = constqual;
@@ -371,9 +367,7 @@ clause_relids_vars(Node *clause, List **relids, List **vars)
List *vi;
if (!intMember(var->varno, varno_list))
- {
varno_list = lappendi(varno_list, var->varno);
- }
foreach(vi, var_list)
{
Var *in_list = (Var *) lfirst(vi);
@@ -410,9 +404,7 @@ NumRelids(Node *clause)
Var *var = (Var *) lfirst(i);
if (!intMember(var->varno, var_list))
- {
var_list = lconsi(var->varno, var_list);
- }
}
return (length(var_list));
@@ -497,14 +489,10 @@ qual_clause_p(Node *clause)
/* How about Param-s ? - vadim 02/03/98 */
if (IsA(get_leftop((Expr *) clause), Var) &&
IsA(get_rightop((Expr *) clause), Const))
- {
return (true);
- }
else if (IsA(get_rightop((Expr *) clause), Var) &&
IsA(get_leftop((Expr *) clause), Const))
- {
return (true);
- }
return (false);
}
@@ -519,17 +507,11 @@ void
fix_opid(Node *clause)
{
if (clause == NULL || single_node(clause))
- {
;
- }
else if (or_clause(clause) || and_clause(clause))
- {
fix_opids(((Expr *) clause)->args);
- }
else if (is_funcclause(clause))
- {
fix_opids(((Expr *) clause)->args);
- }
else if (IsA(clause, ArrayRef))
{
ArrayRef *aref = (ArrayRef *) clause;
@@ -540,9 +522,7 @@ fix_opid(Node *clause)
fix_opid(aref->refassgnexpr);
}
else if (not_clause(clause))
- {
fix_opid((Node *) get_notclausearg((Expr *) clause));
- }
else if (is_opclause(clause))
{
replace_opid((Oper *) ((Expr *) clause)->oper);
@@ -550,9 +530,7 @@ fix_opid(Node *clause)
fix_opid((Node *) get_rightop((Expr *) clause));
}
else if (agg_clause(clause))
- {
fix_opid(((Aggreg *) clause)->target);
- }
else if (is_subplan(clause) &&
((SubPlan *) ((Expr *) clause)->oper)->sublink->subLinkType != EXISTS_SUBLINK)
{
diff --git a/src/backend/optimizer/util/indexnode.c b/src/backend/optimizer/util/indexnode.c
index 3b3c44c3be5..33a52e2c8d9 100644
--- a/src/backend/optimizer/util/indexnode.c
+++ b/src/backend/optimizer/util/indexnode.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.6 1998/02/26 04:33:13 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.7 1998/06/15 19:28:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,13 +36,9 @@ List *
find_relation_indices(Query *root, Rel *rel)
{
if (rel->indexed)
- {
return (find_secondary_index(root, lfirsti(rel->relids)));
- }
else
- {
return (NIL);
- }
}
/*
diff --git a/src/backend/optimizer/util/joininfo.c b/src/backend/optimizer/util/joininfo.c
index 90c03f3f8eb..32e0f60454c 100644
--- a/src/backend/optimizer/util/joininfo.c
+++ b/src/backend/optimizer/util/joininfo.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.6 1998/02/26 04:33:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.7 1998/06/15 19:28:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -103,13 +103,9 @@ other_join_clause_var(Var *var, Expr *clause)
r = (Var *) get_rightop(clause);
if (var_equal(var, l))
- {
retval = r;
- }
else if (var_equal(var, r))
- {
retval = l;
- }
}
return (retval);
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index 96a5bb9a126..23917e2c9d9 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.7 1998/02/26 04:33:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.8 1998/06/15 19:28:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -77,9 +77,7 @@ set_cheapest(Rel *parent_rel, List *pathlist)
Path *path = (Path *) lfirst(p);
if (path_is_cheaper(path, cheapest_so_far))
- {
cheapest_so_far = path;
- }
}
parent_rel->cheapestpath = cheapest_so_far;
@@ -129,9 +127,7 @@ add_pathlist(Rel *parent_rel, List *unique_paths, List *new_paths)
{ /* (IsA(old_path,Path)) { */
new_path->parent = parent_rel;
if (!parent_rel->pruneable)
- {
unique_paths = lcons(new_path, unique_paths);
- }
else
unique_paths = lcons(new_path,
LispRemove(old_path, unique_paths));
@@ -180,16 +176,12 @@ better_path(Path *new_path, List *unique_paths, bool *noOther)
}
if (old_path == NULL)
- {
*noOther = true;
- }
else
{
*noOther = false;
if (path_is_cheaper(new_path, old_path))
- {
retval = old_path;
- }
}
return (retval);
@@ -299,14 +291,10 @@ create_index_path(Query *root,
* if no index keys were found, we can't order the path).
*/
if (pathnode->path.keys == NULL)
- {
pathnode->path.p_ordering.ord.sortop = NULL;
- }
}
else
- {
pathnode->path.keys = NULL;
- }
if (is_join_scan || restriction_clauses == NULL)
{
@@ -468,9 +456,7 @@ create_nestloop_path(Rel *joinrel,
/* add in expensive function costs -- JMH 7/7/92 */
#if 0
if (XfuncMode != XFUNC_OFF)
- {
pathnode->path_cost += xfunc_get_path_cost((Path *) pathnode);
- }
#endif
return (pathnode);
}
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c
index 2237d6c1b35..43477b54dac 100644
--- a/src/backend/optimizer/util/plancat.c
+++ b/src/backend/optimizer/util/plancat.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.16 1998/02/26 04:33:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.17 1998/06/15 19:28:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -282,27 +282,19 @@ index_selectivity(Oid indid,
i = 0;
foreach(xopno, opnos)
- {
opno_array[i++] = lfirsti(xopno);
- }
i = 0;
foreach(xattno, attnos)
- {
attno_array[i++] = lfirsti(xattno);
- }
i = 0;
foreach(value, values)
- {
value_array[i++] = (char *) lfirst(value);
- }
i = 0;
foreach(flag, flags)
- {
flag_array[i++] = lfirsti(flag);
- }
IndexSelectivity(indid,
relid,
diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c
index 2ed37d5f5c5..b151155bc1d 100644
--- a/src/backend/optimizer/util/tlist.c
+++ b/src/backend/optimizer/util/tlist.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.12 1998/02/26 04:33:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.13 1998/06/15 19:28:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -385,9 +385,7 @@ flatten_tlist(List *tlist)
temp_entry = lfirst(temp);
vars = pull_var_clause((Node *) get_expr(temp_entry));
if (vars != NULL)
- {
tlist_vars = nconc(tlist_vars, vars);
- }
}
foreach(temp, tlist_vars)
diff --git a/src/backend/optimizer/util/var.c b/src/backend/optimizer/util/var.c
index 346e1635892..7fa3281afa1 100644
--- a/src/backend/optimizer/util/var.c
+++ b/src/backend/optimizer/util/var.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.11 1998/02/26 04:33:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.12 1998/06/15 19:28:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,9 +48,7 @@ pull_varnos(Node *me)
{
case T_List:
foreach(i, (List *) me)
- {
result = nconc(result, pull_varnos(lfirst(i)));
- }
break;
case T_ArrayRef:
foreach(i, ((ArrayRef *) me)->refupperindexpr)
@@ -182,9 +180,7 @@ pull_var_clause(Node *clause)
pull_var_clause(lfirst(((Expr *) lfirst(temp))->args)));
}
else if (IsA(clause, Aggreg))
- {
retval = pull_var_clause(((Aggreg *) clause)->target);
- }
else if (IsA(clause, ArrayRef))
{
List *temp;
diff --git a/src/backend/parser/gram.c b/src/backend/parser/gram.c
index 919454de1af..acae0a4348c 100644
--- a/src/backend/parser/gram.c
+++ b/src/backend/parser/gram.c
@@ -218,7 +218,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.12 1998/06/13 04:27:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.13 1998/06/15 19:28:51 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c
index 083d4ee15df..7c874f88454 100644
--- a/src/backend/parser/parse_agg.c
+++ b/src/backend/parser/parse_agg.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.10 1998/03/30 16:36:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.11 1998/06/15 19:28:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -351,9 +351,7 @@ agg_error(char *caller, char *aggname, Oid basetypeID)
*/
if (basetypeID == InvalidOid)
- {
elog(ERROR, "%s: aggregate '%s' for all types does not exist", caller, aggname);
- }
else
{
elog(ERROR, "%s: aggregate '%s' for '%s' does not exist", caller, aggname,
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 007983adf7e..4f4d74c15d7 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.29 1998/05/29 14:00:21 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.30 1998/06/15 19:28:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -90,9 +90,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
result = (Node *) make_array_ref(temp, att->indirection);
}
else
- {
result = temp;
- }
break;
}
case T_A_Const:
@@ -465,9 +463,7 @@ parser_typecast(Value *expr, TypeName *typename, int16 atttypmod)
tp = (Type) typenameType(type_string);
}
else
- {
tp = (Type) typenameType(typename->name);
- }
len = typeLen(tp);
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 66453634aec..8f625e9874c 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.18 1998/05/29 14:00:21 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.19 1998/06/15 19:28:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -278,9 +278,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
PointerGetDatum(funcname),
0, 0, 0)))
&& IS_BINARY_COMPATIBLE(typeTypeId(tp), basetype))
- {
return((Node *)lfirst(fargs));
- }
}
}
@@ -668,13 +666,9 @@ func_select_candidate(int nargs,
{
if ((input_typeids[i] != UNKNOWNOID)
&& (current_typeids[i] == input_typeids[i]))
- {
nmatch++;
- }
else if (IS_BINARY_COMPATIBLE(current_typeids[i], input_typeids[i]))
- {
nident++;
- }
}
if ((nmatch + nident) == nargs)
@@ -791,9 +785,7 @@ printf("func_select_candidate- column #%d input type is %s\n",
for (current_candidate = candidates;
current_candidate != NULL;
current_candidate = current_candidate->next)
- {
ncandidates++;
- }
}
if (ncandidates == 1)
@@ -970,9 +962,7 @@ argtype_inherit(int nargs, Oid *oid_array)
{
arginh[i].self = oid_array[i];
if ((relid = typeidTypeRelid(oid_array[i])) != InvalidOid)
- {
arginh[i].nsupers = find_inheritors(relid, &(arginh[i].supervec));
- }
else
{
arginh[i].nsupers = 0;
@@ -1105,9 +1095,7 @@ find_inheritors(Oid relid, Oid **supervec)
}
else
- {
*supervec = (Oid *) NULL;
- }
return (nvisited);
}
diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c
index 7042e4740fc..d05e1adea35 100644
--- a/src/backend/parser/parse_oper.c
+++ b/src/backend/parser/parse_oper.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.12 1998/05/29 14:00:22 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.13 1998/06/15 19:28:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -217,9 +217,7 @@ oper_select_candidate(int nargs,
{
if ((input_typeids[i] != UNKNOWNOID)
&& (current_typeids[i] == input_typeids[i]))
- {
nmatch++;
- }
}
#ifdef PARSEDEBUG
@@ -257,9 +255,7 @@ printf("oper_select_candidate- reject candidate as possible match\n");
{
if (!can_coerce_type(1, &input_typeids[0], &candidates->args[0])
|| !can_coerce_type(1, &input_typeids[1], &candidates->args[1]))
- {
ncandidates = 0;
- }
return ((ncandidates == 1)? candidates->args: NULL);
}
@@ -283,14 +279,10 @@ printf("oper_select_candidate- reject candidate as possible match\n");
if (input_typeids[i] != UNKNOWNOID)
{
if (current_typeids[i] == input_typeids[i])
- {
nmatch++;
- }
else if (IsPreferredType(current_category, current_typeids[i])
&& can_coerce_type(1, &input_typeids[i], &current_typeids[i]))
- {
nmatch++;
- }
}
}
@@ -348,13 +340,9 @@ printf("oper_select_candidate- unable to coerce preferred candidate\n");
{
if ((input_typeids[i] != UNKNOWNOID)
&& (input_typeids[i] != InvalidOid))
- {
current_type = input_typeids[i];
- }
else
- {
unknownOids = TRUE;
- }
}
if (unknownOids && (current_type != UNKNOWNOID))
@@ -510,14 +498,10 @@ printf("oper_exact: commutative operator found\n");
}
/* disable for now... - thomas 1998-05-14 */
else
- {
tup = NULL;
- }
}
if (!HeapTupleIsValid(tup) && (!noWarnings))
- {
op_error(op, arg1, arg2);
- }
}
return tup;
@@ -589,9 +573,7 @@ printf("oper_inexact: found candidate\n");
}
else
- {
tup = NULL;
- }
/* Could not choose one, for whatever reason... */
if (!HeapTupleIsValid(tup))
@@ -757,9 +739,7 @@ right_oper(char *op, Oid arg)
Int8GetDatum('r'));
}
else
- {
tup = NULL;
- }
if (!HeapTupleIsValid(tup))
{
@@ -846,9 +826,7 @@ op_error(char *op, Oid arg1, Oid arg2)
tp2 = NULL;
if (typeidIsValid(arg1))
- {
tp1 = typeidType(arg1);
- }
else
{
elog(ERROR, "Left hand side of operator '%s' has an unknown type"
@@ -856,9 +834,7 @@ op_error(char *op, Oid arg1, Oid arg2)
}
if (typeidIsValid(arg2))
- {
tp2 = typeidType(arg2);
- }
else
{
elog(ERROR, "Right hand side of operator %s has an unknown type"
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index 51b3fe0b0f4..86b7474c200 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.15 1998/06/05 03:49:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.16 1998/06/15 19:28:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -164,9 +164,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
lindx[i] = ((Const *) aind->lidx)->constvalue;
}
else
- {
lindx[i] = 1;
- }
if (lindx[i] > uindx[i])
elog(ERROR, "yyparse: lower index cannot be greater than upper index");
@@ -336,9 +334,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
}
if (p_target == NIL)
- {
p_target = tail_p_target = lcons(tent, NIL);
- }
else
{
lnext(tail_p_target) = lcons(tent, NIL);
@@ -379,20 +375,14 @@ printf("parse_target: try coercing from %s to %s via text\n",
{
}
else if (can_coerce_type(1, &type_id, &text_id))
- {
expr = coerce_type(pstate, expr, type_id, text_id);
- }
else
- {
expr = NULL;
- }
}
#endif
else
- {
expr = NULL;
- }
return expr;
} /* coerce_target_expr() */
@@ -521,13 +511,9 @@ make_targetlist_expr(ParseState *pstate,
Oid typelem;
if (arrayRef && !(((A_Indices *) lfirst(arrayRef))->lidx))
- {
typelem = typeidTypElem(attrtype);
- }
else
- {
typelem = attrtype;
- }
expr = coerce_target_expr(pstate, expr, type_id, typelem);
@@ -550,9 +536,7 @@ printf("parse_target: attrtypmod is %d\n", (int4) attrtypmod);
* Then explicitly size for storage...
*/
if (attrtypmod > 0)
- {
expr = size_target_expr(pstate, expr, attrtype, attrtypmod);
- }
}
if (arrayRef != NIL)
diff --git a/src/backend/parser/parse_type.c b/src/backend/parser/parse_type.c
index 5b2529f6847..c611c589c46 100644
--- a/src/backend/parser/parse_type.c
+++ b/src/backend/parser/parse_type.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.10 1998/05/29 14:00:24 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.11 1998/06/15 19:28:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -79,14 +79,10 @@ typenameType(char *s)
HeapTuple tup;
if (s == NULL)
- {
elog(ERROR, "type(): Null type");
- }
if (!(tup = SearchSysCacheTuple(TYPNAME, PointerGetDatum(s), 0, 0, 0)))
- {
elog(ERROR, "type name lookup of %s failed", s);
- }
return ((Type) tup);
}
@@ -209,9 +205,7 @@ typeidTypElem(Oid type_id)
if (!(typeTuple = SearchSysCacheTuple(TYPOID,
ObjectIdGetDatum(type_id),
0, 0, 0)))
- {
elog(ERROR, "type id lookup of %u failed", type_id);
- }
type = (TypeTupleForm) GETSTRUCT(typeTuple);
return (type->typelem);
diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c
index 765a59c61ad..efd3268fe49 100644
--- a/src/backend/parser/parser.c
+++ b/src/backend/parser/parser.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.33 1998/02/26 04:33:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.34 1998/06/15 19:28:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -111,9 +111,7 @@ define_sets(Node *clause)
bool oidbyval = typeByVal(t);
if (clause == NULL)
- {
return;
- }
else if (IsA(clause, LispList))
{
define_sets(lfirst(clause));
@@ -123,9 +121,7 @@ define_sets(Node *clause)
{
if (get_constisnull((Const) clause) ||
!get_constisset((Const) clause))
- {
return;
- }
setoid = SetDefine(((Const *) clause)->constvalue,
typeidTypeName(((Const *) clause)->consttype));
set_constvalue((Const) clause, setoid);
@@ -134,22 +130,16 @@ define_sets(Node *clause)
set_constypeByVal((Const) clause, oidbyval);
}
else if (IsA(clause, Iter))
- {
define_sets(((Iter *) clause)->iterexpr);
- }
else if (single_node(clause))
- {
return;
- }
else if (or_clause(clause) || and_clause(clause))
{
List *temp;
/* mapcan */
foreach(temp, ((Expr *) clause)->args)
- {
define_sets(lfirst(temp));
- }
}
else if (is_funcclause(clause))
{
@@ -157,18 +147,12 @@ define_sets(Node *clause)
/* mapcan */
foreach(temp, ((Expr *) clause)->args)
- {
define_sets(lfirst(temp));
- }
}
else if (IsA(clause, ArrayRef))
- {
define_sets(((ArrayRef *) clause)->refassgnexpr);
- }
else if (not_clause(clause))
- {
define_sets(get_notclausearg(clause));
- }
else if (is_opclause(clause))
{
define_sets(get_leftop(clause));
diff --git a/src/backend/parser/scan.c b/src/backend/parser/scan.c
index eb98c8a2165..dd0304b97f0 100644
--- a/src/backend/parser/scan.c
+++ b/src/backend/parser/scan.c
@@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.20 1998/05/09 23:27:39 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.21 1998/06/15 19:28:56 momjian Exp $
*/
#define FLEX_SCANNER
@@ -555,7 +555,7 @@ char *yytext;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.20 1998/05/09 23:27:39 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.21 1998/06/15 19:28:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
diff --git a/src/backend/port/dynloader/bsd.c b/src/backend/port/dynloader/bsd.c
index 957dc297677..4d679731ea1 100644
--- a/src/backend/port/dynloader/bsd.c
+++ b/src/backend/port/dynloader/bsd.c
@@ -68,9 +68,7 @@ BSD44_derived_dlopen(const char *file, int num)
void *vp;
if ((vp = dlopen((char *) file, num)) == (void *) NULL)
- {
sprintf(error_message, "dlopen (%s) failed", file);
- }
return (vp);
#endif
}
@@ -91,9 +89,7 @@ BSD44_derived_dlsym(void *handle, const char *name)
name = buf;
}
if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
- {
sprintf(error_message, "dlsym (%s) failed", name);
- }
return (vp);
#endif
}
diff --git a/src/backend/port/dynloader/bsdi.c b/src/backend/port/dynloader/bsdi.c
index f23267e5862..f01c16071b5 100644
--- a/src/backend/port/dynloader/bsdi.c
+++ b/src/backend/port/dynloader/bsdi.c
@@ -36,9 +36,7 @@ pg_dlopen(char *filename)
if (!dl_initialized)
{
if (dld_init(dld_find_executable(pg_pathname)))
- {
return NULL;
- }
/*
* if there are undefined symbols, we want dl to search from the
@@ -51,9 +49,7 @@ pg_dlopen(char *filename)
* link the file, then check for undefined symbols!
*/
if (dld_link(filename))
- {
return NULL;
- }
/*
* If undefined symbols: try to link with the C and math libraries!
diff --git a/src/backend/port/dynloader/hpux.c b/src/backend/port/dynloader/hpux.c
index 0f1517ac966..948faea34f4 100644
--- a/src/backend/port/dynloader/hpux.c
+++ b/src/backend/port/dynloader/hpux.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/port/dynloader/hpux.c,v 1.3 1998/02/26 04:34:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/port/dynloader/hpux.c,v 1.4 1998/06/15 19:28:59 momjian Exp $
*
* NOTES
* all functions are defined here -- it's impossible to trace the
@@ -38,9 +38,7 @@ pg_dlsym(void *handle, char *funcname)
func_ptr f;
if (shl_findsym((shl_t *) & handle, funcname, TYPE_PROCEDURE, &f) == -1)
- {
f = (func_ptr) NULL;
- }
return (f);
}
diff --git a/src/backend/port/dynloader/linux.c b/src/backend/port/dynloader/linux.c
index 41507207d07..aa13f09a19b 100644
--- a/src/backend/port/dynloader/linux.c
+++ b/src/backend/port/dynloader/linux.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/port/dynloader/linux.c,v 1.7 1998/02/26 04:34:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/port/dynloader/linux.c,v 1.8 1998/06/15 19:28:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -44,9 +44,7 @@ pg_dlopen(char *filename)
if (!dl_initialized)
{
if (dld_init(dld_find_executable(pg_pathname)))
- {
return NULL;
- }
/*
* if there are undefined symbols, we want dl to search from the
@@ -59,9 +57,7 @@ pg_dlopen(char *filename)
* link the file, then check for undefined symbols!
*/
if (dld_link(filename))
- {
return NULL;
- }
/*
* If undefined symbols: try to link with the C and math libraries!
diff --git a/src/backend/port/dynloader/ultrix4.c b/src/backend/port/dynloader/ultrix4.c
index 7d1d493c2bc..9ddda044ff9 100644
--- a/src/backend/port/dynloader/ultrix4.c
+++ b/src/backend/port/dynloader/ultrix4.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/port/dynloader/ultrix4.c,v 1.1 1998/03/10 05:23:40 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/port/dynloader/ultrix4.c,v 1.2 1998/06/15 19:28:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -37,9 +37,7 @@ pg_dlopen(char *filename)
if (!dl_initialized)
{
if (!dl_init(pg_pathname))
- {
return NULL;
- }
/*
* if there are undefined symbols, we want dl to search from the
diff --git a/src/backend/port/strcasecmp.c b/src/backend/port/strcasecmp.c
index f6a4af95b18..54a62f7cff8 100644
--- a/src/backend/port/strcasecmp.c
+++ b/src/backend/port/strcasecmp.c
@@ -1,4 +1,4 @@
-/* $Id: strcasecmp.c,v 1.3 1998/02/11 19:11:10 momjian Exp $ */
+/* $Id: strcasecmp.c,v 1.4 1998/06/15 19:28:57 momjian Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
@@ -71,12 +71,8 @@ strcasecmp(char *s1, char *s2)
u1 = (unsigned char) *s1++;
u2 = (unsigned char) *s2++;
if (charmap[u1] != charmap[u2])
- {
return charmap[u1] - charmap[u2];
- }
if (u1 == '\0')
- {
return 0;
- }
}
}
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 9249e68e460..aec207e5288 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.87 1998/06/09 17:36:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.88 1998/06/15 19:29:00 momjian Exp $
*
* NOTES
*
@@ -1067,9 +1067,7 @@ BackendStartup(Port *port)
static char envEntry[NR_ENVIRONMENT_VBL][2 * ARGV_SIZE];
for (i = 0; i < NR_ENVIRONMENT_VBL; ++i)
- {
MemSet(envEntry[i], 0, 2 * ARGV_SIZE);
- }
/*
* Set up the necessary environment variables for the backend This
diff --git a/src/backend/regex/engine.c b/src/backend/regex/engine.c
index 1964f2a0248..6381d5990c9 100644
--- a/src/backend/regex/engine.c
+++ b/src/backend/regex/engine.c
@@ -831,14 +831,10 @@ sopno stopst;
/* how about a word boundary? */
if ((flagch == BOL || (lastc != OUT && !ISWORD(lastc))) &&
(c != OUT && ISWORD(c)))
- {
flagch = BOW;
- }
if ((lastc != OUT && ISWORD(lastc)) &&
(flagch == EOL || (c != OUT && !ISWORD(c))))
- {
flagch = EOW;
- }
if (flagch == BOW || flagch == EOW)
{
st = step(m->g, startst, stopst, st, flagch, st);
@@ -927,14 +923,10 @@ sopno stopst;
/* how about a word boundary? */
if ((flagch == BOL || (lastc != OUT && !ISWORD(lastc))) &&
(c != OUT && ISWORD(c)))
- {
flagch = BOW;
- }
if ((lastc != OUT && ISWORD(lastc)) &&
(flagch == EOL || (c != OUT && !ISWORD(c))))
- {
flagch = EOW;
- }
if (flagch == BOW || flagch == EOW)
{
st = step(m->g, startst, stopst, st, flagch, st);
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c
index a54e70ad2ed..01b95427c62 100644
--- a/src/backend/regex/regcomp.c
+++ b/src/backend/regex/regcomp.c
@@ -1643,13 +1643,9 @@ sopno pos;
for (i = 1; i < NPAREN; i++)
{
if (p->pbegin[i] >= pos)
- {
p->pbegin[i]++;
- }
if (p->pend[i] >= pos)
- {
p->pend[i]++;
- }
}
memmove((char *) &p->strip[pos + 1], (char *) &p->strip[pos],
diff --git a/src/backend/rewrite/locks.c b/src/backend/rewrite/locks.c
index ac21bed8403..04698be13e3 100644
--- a/src/backend/rewrite/locks.c
+++ b/src/backend/rewrite/locks.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.9 1998/02/26 04:35:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.10 1998/06/15 19:29:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -137,9 +137,7 @@ matchLocks(CmdType event,
if (parsetree->commandType != CMD_SELECT)
{
if (parsetree->resultRelation != varno)
- {
return (NULL);
- }
}
nlocks = rulelocks->numLocks;
@@ -154,9 +152,7 @@ matchLocks(CmdType event,
thisLockWasTriggered(varno,
oneLock->attrno,
parsetree))
- {
real_locks = lappend(real_locks, oneLock);
- }
}
}
diff --git a/src/backend/rewrite/rewriteDefine.c b/src/backend/rewrite/rewriteDefine.c
index 3bce63ac663..cb1bbd5bcf1 100644
--- a/src/backend/rewrite/rewriteDefine.c
+++ b/src/backend/rewrite/rewriteDefine.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.15 1998/06/04 17:26:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.16 1998/06/15 19:29:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -96,9 +96,7 @@ InsertRule(char *rulname,
eventrel = heap_openr(evobj);
if (eventrel == NULL)
- {
elog(ERROR, "rules cannot be defined on relations not in schema");
- }
eventrel_oid = RelationGetRelationId(eventrel);
/*
@@ -128,9 +126,7 @@ InsertRule(char *rulname,
'%s'::bool);";
if (strlen(template) + strlen(rulname) + strlen(actionbuf) +
strlen(qualbuf) + 20 /* fudge fac */ > RULE_PLAN_SIZE)
- {
elog(ERROR, "DefineQueryRewrite: rule plan string too big.");
- }
sprintf(rulebuf, template,
rulname, evtype, eventrel_oid, evslot_index, actionbuf,
qualbuf, is_instead);
@@ -209,9 +205,7 @@ DefineQueryRewrite(RuleStmt *stmt)
event_relation = heap_openr(event_obj->relname);
if (event_relation == NULL)
- {
elog(ERROR, "virtual relations not supported yet");
- }
ev_relid = RelationGetRelationId(event_relation);
if (eslot_string == NULL)
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c
index 5bb24720f8f..97c468a9389 100644
--- a/src/backend/rewrite/rewriteHandler.c
+++ b/src/backend/rewrite/rewriteHandler.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.15 1998/03/30 16:36:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.16 1998/06/15 19:29:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -299,9 +299,7 @@ ApplyRetrieveRule(Query *parsetree,
}
}
else
- {
nothing = TRUE;
- }
rtable = copyObject(parsetree->rtable);
foreach(rt, rtable)
@@ -337,9 +335,7 @@ ApplyRetrieveRule(Query *parsetree,
rtable = nconc(rtable, rule_rtable);
}
else
- {
rtable = nconc(rtable, copyObject(rule_action->rtable));
- }
parsetree->rtable = rtable;
rule_action->rtable = rtable;
@@ -566,9 +562,7 @@ fireRules(Query *parsetree,
*--------------------------------------------------
*/
if ((info->event == CMD_INSERT) || (info->event == CMD_UPDATE))
- {
FixNew(info, parsetree);
- }
/*--------------------------------------------------
* Step 3:
@@ -613,9 +607,7 @@ RewriteQuery(Query *parsetree, bool *instead_flag, List **qual_products)
* only for a delete may the targetlist be NULL
*/
if (event != CMD_DELETE)
- {
Assert(parsetree->targetList != NULL);
- }
result_relation = parsetree->resultRelation;
@@ -844,8 +836,6 @@ CheckViewPerms(Relation view, List *rtable)
aclcheck_res = pg_aclcheck(rte->relname, uname.data, ACL_RD);
if (aclcheck_res != ACLCHECK_OK)
- {
elog(ERROR, "%s: %s", rte->relname, aclcheck_error_strings[aclcheck_res]);
- }
}
}
diff --git a/src/backend/rewrite/rewriteManip.c b/src/backend/rewrite/rewriteManip.c
index 8c9bc3412a4..0c124a36389 100644
--- a/src/backend/rewrite/rewriteManip.c
+++ b/src/backend/rewrite/rewriteManip.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.13 1998/02/26 04:35:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.14 1998/06/15 19:29:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,9 +75,7 @@ OffsetVarNodes(Node *node, int offset)
List *l;
foreach(l, (List *) node)
- {
OffsetVarNodes(lfirst(l), offset);
- }
}
break;
default:
@@ -222,9 +220,7 @@ FindMatchingNew(List *tlist, int attno)
TargetEntry *tle = lfirst(i);
if (tle->resdom->resno == attno)
- {
return (tle->expr);
- }
}
return NULL;
}
@@ -288,14 +284,10 @@ ResolveNew(RewriteInfo *info, List *targetlist, Node **nodePtr,
((Var *) node)->varnoold = info->current_varno;
}
else
- {
*nodePtr = make_null(((Var *) node)->vartype);
- }
}
else
- {
*nodePtr = n;
- }
}
break;
}
diff --git a/src/backend/rewrite/rewriteSupport.c b/src/backend/rewrite/rewriteSupport.c
index ced98f59dcb..964e50f7020 100644
--- a/src/backend/rewrite/rewriteSupport.c
+++ b/src/backend/rewrite/rewriteSupport.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.20 1998/04/27 04:06:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.21 1998/06/15 19:29:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -69,9 +69,7 @@ RuleIdGetActionInfo(Oid ruleoid, bool *instead_flag, Query **parseTrees)
ruleTupdesc, &instead_is_null);
if (action_is_null || instead_is_null)
- {
elog(ERROR, "internal error: rewrite rule not properly set up");
- }
ruleaction = textout((struct varlena *) ruleaction);
rule_evqual_string = textout((struct varlena *) rule_evqual_string);
diff --git a/src/backend/storage/buffer/buf_table.c b/src/backend/storage/buffer/buf_table.c
index fbbf52ce381..6006e36c503 100644
--- a/src/backend/storage/buffer/buf_table.c
+++ b/src/backend/storage/buffer/buf_table.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_table.c,v 1.10 1998/01/07 21:04:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_table.c,v 1.11 1998/06/15 19:29:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -91,9 +91,7 @@ BufTableLookup(BufferTag *tagPtr)
return (NULL);
}
if (!found)
- {
return (NULL);
- }
return (&(BufferDescriptors[result->id]));
}
@@ -111,9 +109,7 @@ BufTableDelete(BufferDesc *buf)
* BM_DELETED keeps us from removing buffer twice.
*/
if (buf->flags & BM_DELETED)
- {
return (TRUE);
- }
buf->flags |= BM_DELETED;
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 7ab6019f999..324545cf959 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.37 1998/04/24 14:42:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.38 1998/06/15 19:29:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -137,9 +137,7 @@ RelationGetBufferWithBuffer(Relation relation,
bufHdr = &LocalBufferDescriptors[-buffer - 1];
if (bufHdr->tag.relId.relId == relation->rd_id &&
bufHdr->tag.blockNum == blockNumber)
- {
return (buffer);
- }
}
}
return (ReadBuffer(relation, blockNumber));
@@ -258,9 +256,7 @@ ReadBufferWithBufferLock(Relation reln,
}
if (!bufHdr)
- {
return (InvalidBuffer);
- }
/* if its already in the buffer pool, we're done */
if (found)
@@ -534,9 +530,7 @@ BufferAlloc(Relation reln,
buf->tag.blockNum, buf->sb_relname);
}
else
- {
buf->flags &= ~BM_DIRTY;
- }
}
/*
@@ -607,9 +601,7 @@ BufferAlloc(Relation reln,
{
WaitIO(buf2, BufMgrLock);
if (buf2->flags & BM_IO_ERROR)
- {
*foundPtr = FALSE;
- }
}
SpinRelease(BufMgrLock);
@@ -697,9 +689,7 @@ WriteBuffer(Buffer buffer)
BufferDesc *bufHdr;
if (WriteMode == BUFFER_FLUSH_WRITE)
- {
return (FlushBuffer(buffer, TRUE));
- }
else
{
@@ -852,9 +842,7 @@ FlushBuffer(Buffer buffer, bool release)
bufHdr->tag.blockNum, bufHdr->sb_relname);
}
else
- {
bufHdr->flags &= ~BM_DIRTY;
- }
if (release)
UnpinBuffer(bufHdr);
SpinRelease(BufMgrLock);
@@ -877,9 +865,7 @@ WriteNoReleaseBuffer(Buffer buffer)
BufferDesc *bufHdr;
if (WriteMode == BUFFER_FLUSH_WRITE)
- {
return (FlushBuffer(buffer, FALSE));
- }
else
{
@@ -1205,9 +1191,7 @@ ResetBufferPool()
if (BufferIsValid(i))
{
while (PrivateRefCount[i - 1] > 0)
- {
ReleaseBuffer(i);
- }
}
LastRefCount[i - 1] = 0;
}
@@ -1418,9 +1402,7 @@ ReleaseRelationBuffers(Relation rdesc)
buf = &LocalBufferDescriptors[i];
if ((buf->flags & BM_DIRTY) &&
(buf->tag.relId.relId == rdesc->rd_id))
- {
buf->flags &= ~BM_DIRTY;
- }
}
return;
}
@@ -1472,9 +1454,7 @@ DropBuffers(Oid dbid)
{
buf = &BufferDescriptors[i - 1];
if ((buf->tag.relId.dbId == dbid) && (buf->flags & BM_DIRTY))
- {
buf->flags &= ~BM_DIRTY;
- }
}
SpinRelease(BufMgrLock);
}
diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c
index e24d36cb8d4..d5c0272a8a6 100644
--- a/src/backend/storage/buffer/freelist.c
+++ b/src/backend/storage/buffer/freelist.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/freelist.c,v 1.10 1998/06/15 18:39:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/freelist.c,v 1.11 1998/06/15 19:29:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -105,9 +105,7 @@ PinBuffer(BufferDesc *buf)
buf->flags &= ~BM_FREE;
}
else
- {
NotInQueue(buf);
- }
b = BufferDescriptorGetBuffer(buf) - 1;
Assert(PrivateRefCount[b] >= 0);
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 969a5e16694..6493b947dbf 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Id: fd.c,v 1.31 1998/04/05 21:04:27 momjian Exp $
+ * $Id: fd.c,v 1.32 1998/06/15 19:29:11 momjian Exp $
*
* NOTES:
*
@@ -533,9 +533,7 @@ FileInvalidate(File file)
{
Assert(file > 0);
if (!FileIsNotOpen(file))
- {
LruDelete(file);
- }
}
#endif
@@ -583,9 +581,7 @@ tryAgain:
Insert(file);
if (fileName == NULL)
- {
elog(ERROR, "fileNameOpenFile: NULL fname");
- }
vfdP->fileName = malloc(strlen(fileName) + 1);
strcpy(vfdP->fileName, fileName);
@@ -709,9 +705,7 @@ FileRead(File file, char *buffer, int amount)
FileAccess(file);
returnCode = read(VfdCache[file].fd, buffer, amount);
if (returnCode > 0)
- {
VfdCache[file].seekPos += returnCode;
- }
return returnCode;
}
@@ -815,9 +809,7 @@ FileSync(File file)
*/
if (VfdCache[file].fd < 0 || !(VfdCache[file].fdstate & FD_DIRTY))
- {
returnCode = 0;
- }
else
{
returnCode = fsync(VfdCache[file].fd);
diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c
index 768b144ff56..b9834c0f8d6 100644
--- a/src/backend/storage/ipc/ipc.c
+++ b/src/backend/storage/ipc/ipc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.21 1998/05/29 17:00:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.22 1998/06/15 19:29:13 momjian Exp $
*
* NOTES
*
@@ -310,9 +310,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
exitpg(3);
}
for (i = 0; i < semNum; i++)
- {
array[i] = semStartValue;
- }
semun.array = array;
errStatus = semctl(semId, 0, SETALL, semun);
if (errStatus == -1)
@@ -513,9 +511,7 @@ IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
shmid = PrivateMemoryCreate(memKey, size);
}
else
- {
shmid = shmget(memKey, size, IPC_CREAT | permission);
- }
if (shmid < 0)
{
@@ -564,9 +560,7 @@ static void
IpcMemoryDetach(int status, char *shmaddr)
{
if (shmdt(shmaddr) < 0)
- {
elog(NOTICE, "IpcMemoryDetach: shmdt(0x%x): %m", shmaddr);
- }
}
/****************************************************************************/
@@ -582,13 +576,9 @@ IpcMemoryAttach(IpcMemoryId memId)
char *memAddress;
if (UsePrivateMemory)
- {
memAddress = (char *) PrivateMemoryAttach(memId);
- }
else
- {
memAddress = (char *) shmat(memId, 0, 0);
- }
/* if ( *memAddress == -1) { XXX ??? */
if (memAddress == (char *) -1)
diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c
index e90d9802aeb..e5697e5a2ed 100644
--- a/src/backend/storage/ipc/shmem.c
+++ b/src/backend/storage/ipc/shmem.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.19 1998/05/26 17:29:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.20 1998/06/15 19:29:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -189,18 +189,14 @@ InitShmem(unsigned int key, unsigned int size)
* allocator and binding table.
*/
if (!InitSpinLocks(ShmemBootstrap, IPCKeyGetSpinLockSemaphoreKey(key)))
- {
return (FALSE);
- }
/*
* We have just allocated additional space for two spinlocks. Now
* setup the global free space count
*/
if (ShmemBootstrap)
- {
*ShmemFreeStart = currFreeSpace;
- }
/* if ShmemFreeStart is NULL, then the allocator won't work */
Assert(*ShmemFreeStart);
@@ -256,9 +252,7 @@ InitShmem(unsigned int key, unsigned int size)
}
else
- {
Assert(!ShmemBootstrap);
- }
/* now release the lock acquired in ShmemHashInit */
SpinRelease(BindingLock);
@@ -303,16 +297,12 @@ ShmemAlloc(unsigned long size)
*ShmemFreeStart += size;
}
else
- {
newSpace = NULL;
- }
SpinRelease(ShmemLock);
if (!newSpace)
- {
elog(NOTICE, "ShmemAlloc: out of memory ");
- }
return (newSpace);
}
@@ -420,13 +410,9 @@ ShmemPIDLookup(int pid, SHMEM_OFFSET *locationPtr)
}
if (found)
- {
*locationPtr = result->location;
- }
else
- {
result->location = *locationPtr;
- }
SpinRelease(BindingLock);
return (TRUE);
@@ -473,9 +459,7 @@ ShmemPIDDestroy(int pid)
if (found)
return (location);
else
- {
return (INVALID_OFFSET);
- }
}
/*
diff --git a/src/backend/storage/ipc/sinval.c b/src/backend/storage/ipc/sinval.c
index 44f7b2b6e96..59732f2deb1 100644
--- a/src/backend/storage/ipc/sinval.c
+++ b/src/backend/storage/ipc/sinval.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.9 1997/09/08 02:28:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.10 1998/06/15 19:29:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -49,9 +49,7 @@ CreateSharedInvalidationState(IPCKey key)
status = SISegmentInit(true, IPCKeyGetSIBufferMemoryBlock(key));
if (status == -1)
- {
elog(FATAL, "CreateSharedInvalidationState: failed segment init");
- }
}
/****************************************************************************/
@@ -73,9 +71,7 @@ AttachSharedInvalidationState(IPCKey key)
status = SISegmentInit(false, IPCKeyGetSIBufferMemoryBlock(key));
if (status == -1)
- {
elog(FATAL, "AttachSharedInvalidationState: failed segment init");
- }
}
void
@@ -126,13 +122,9 @@ RegisterSharedInvalid(int cacheId, /* XXX */
newInvalid.hashIndex = hashIndex;
if (ItemPointerIsValid(pointer))
- {
ItemPointerCopy(pointer, &newInvalid.pointerData);
- }
else
- {
ItemPointerSetInvalid(&newInvalid.pointerData);
- }
SpinAcquire(SInvalLock);
if (!SISetDataEntry(shmInvalBuffer, &newInvalid))
diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c
index 6bdf5a9f521..391e78d38bb 100644
--- a/src/backend/storage/ipc/sinvaladt.c
+++ b/src/backend/storage/ipc/sinvaladt.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.8 1997/09/08 21:47:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.9 1998/06/15 19:29:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -133,9 +133,7 @@ SIAssignBackendId(SISeg *segInOutP, BackendTag backendTag)
(segInOutP->procState[index].limit <
stateP->limit ||
stateP->tag < backendTag)))
- {
stateP = &segInOutP->procState[index];
- }
}
/* verify that all "procState" entries checked for matching tags */
@@ -664,9 +662,7 @@ SIReadEntryData(SISeg *segP,
}
/* check whether we can remove dead messages */
if (i > MAXNUMMESSAGES)
- {
elog(FATAL, "SIReadEntryData: Invalid segment state");
- }
}
/************************************************************************/
@@ -696,9 +692,7 @@ SIDelExpiredDataEntries(SISeg *segP)
{
/* this adjusts also the state limits! */
if (!SIDelDataEntry(segP))
- {
elog(FATAL, "SIDelExpiredDataEntries: Invalid segment state");
- }
}
}
}
@@ -779,13 +773,9 @@ SISegmentGet(int key, /* the corresponding key for the segment */
IpcMemoryId shmid;
if (create)
- {
shmid = IpcMemoryCreate(key, size, IPCProtection);
- }
else
- {
shmid = IpcMemoryIdGet(key, size);
- }
return (shmid);
}
diff --git a/src/backend/storage/ipc/spin.c b/src/backend/storage/ipc/spin.c
index bf45092fbfa..0d6aac7fbae 100644
--- a/src/backend/storage/ipc/spin.c
+++ b/src/backend/storage/ipc/spin.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.10 1997/09/22 04:20:53 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/spin.c,v 1.11 1998/06/15 19:29:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -157,9 +157,7 @@ SpinRelease(SPINLOCK lockid)
S_UNLOCK(&(slckP->shlock));
}
else
- {
S_UNLOCK(&(slckP->shlock));
- }
S_UNLOCK(&(slckP->exlock));
S_UNLOCK(&(slckP->locklock));
#ifdef LOCKDEBUG
diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c
index 7dff1921d05..c3d63ac36b2 100644
--- a/src/backend/storage/large_object/inv_api.c
+++ b/src/backend/storage/large_object/inv_api.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.29 1998/04/27 04:06:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.30 1998/06/15 19:29:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -527,9 +527,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
/* either append or replace a block, as required */
if (!HeapTupleIsValid(htup))
- {
tuplen = inv_wrnew(obj_desc, buf, nbytes - nwritten);
- }
else
{
if (obj_desc->offset > obj_desc->highbyte)
@@ -734,9 +732,7 @@ inv_wrnew(LargeObjectDesc *obj_desc, char *buf, int nbytes)
}
}
else
- {
nwritten = nbytes;
- }
/*
* Insert a new file system block tuple, index it, and write it out.
diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c
index c841d34bb1f..7fc61e8285a 100644
--- a/src/backend/storage/lmgr/lmgr.c
+++ b/src/backend/storage/lmgr/lmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.11 1998/01/07 21:05:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.12 1998/06/15 19:29:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -119,9 +119,7 @@ RelationGetLRelId(Relation relation)
*/
if (strcmp(RelationGetRelationName(relation)->data,
VariableRelationName) == 0)
- {
return (VariableRelationLRelId);
- }
return (linfo->lRelId);
}
@@ -519,9 +517,7 @@ RelationUnsetLockForWrite(Relation relation)
*/
Assert(RelationIsValid(relation));
if (LockingDisabled())
- {
return;
- }
linfo = (LockInfo) relation->lockInfo;
@@ -598,9 +594,7 @@ RelationSetLockForTupleRead(Relation relation, ItemPointer itemPointer)
curXact = GetCurrentTransactionId();
if ((linfo->flags & ReadRelationLock) &&
TransactionIdEquals(curXact, linfo->transactionIdData))
- {
return;
- }
/* ----------------
* If we don't already have a tuple lock this transaction
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index f97e2ebdfb8..1ff19ce4021 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.26 1998/02/26 04:36:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.27 1998/06/15 19:29:20 momjian Exp $
*
* NOTES
* Outside modules can create a lock table and acquire/release
@@ -383,13 +383,9 @@ LockTabRename(LockTableId tableId)
LockTableId newTableId;
if (NumTables >= MAX_TABLES)
- {
return (INVALID_TABLEID);
- }
if (AllTables[tableId] == INVALID_TABLEID)
- {
return (INVALID_TABLEID);
- }
/* other modules refer to the lock table by a tableId */
newTableId = NumTables;
@@ -493,9 +489,7 @@ LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
}
if (LockingIsDisabled)
- {
return (TRUE);
- }
LOCK_PRINT("Acquire", lockName, lockt);
masterLock = ltable->ctl->masterLock;
@@ -606,9 +600,7 @@ LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
status = LockResolveConflicts(ltable, lock, lockt, myXid);
if (status == STATUS_OK)
- {
GrantLock(lock, lockt);
- }
else if (status == STATUS_FOUND)
{
#ifdef USER_LOCKS
@@ -757,9 +749,7 @@ LockResolveConflicts(LOCKTAB *ltable,
for (i = 1; i <= nLockTypes; i++, tmpMask <<= 1)
{
if (lock->activeHolders[i] != myHolders[i])
- {
bitmask |= tmpMask;
- }
}
/* ------------------------
@@ -873,9 +863,7 @@ LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
}
if (LockingIsDisabled)
- {
return (TRUE);
- }
LOCK_PRINT("Release", lockName, lockt);
@@ -997,13 +985,9 @@ LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
SpinRelease(masterLock);
#ifdef USER_LOCKS
if ((is_user_lock) && (result))
- {
elog(NOTICE, "LockRelease: you don't have a lock on this tag");
- }
else
- {
elog(NOTICE, "LockRelease: find xid, table corrupted");
- }
#else
elog(NOTICE, "LockReplace: xid table corrupted");
#endif
@@ -1027,13 +1011,9 @@ LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
{
#ifdef USER_LOCKS
if (result->queue.prev == INVALID_OFFSET)
- {
elog(NOTICE, "LockRelease: xid.prev == INVALID_OFFSET");
- }
if (result->queue.next == INVALID_OFFSET)
- {
elog(NOTICE, "LockRelease: xid.next == INVALID_OFFSET");
- }
#endif
if (result->queue.next != INVALID_OFFSET)
SHMQueueDelete(&result->queue);
@@ -1165,9 +1145,7 @@ LockReleaseAll(LockTableId tableId, SHM_QUEUE *lockQueue)
elog(NOTICE, "LockReleaseAll: tableId=%d, pid=%d", tableId, MyProcPid);
#endif
if (is_user_lock_table)
- {
tableId = 1;
- }
#endif
Assert(tableId < NumTables);
diff --git a/src/backend/storage/lmgr/multi.c b/src/backend/storage/lmgr/multi.c
index 2196444299f..db9917f86aa 100644
--- a/src/backend/storage/lmgr/multi.c
+++ b/src/backend/storage/lmgr/multi.c
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.11 1998/01/23 19:53:40 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.12 1998/06/15 19:29:21 momjian Exp $
*
* NOTES:
* (1) The lock.c module assumes that the caller here is doing
@@ -99,9 +99,7 @@ InitMultiLevelLockm()
tableId = LockTabInit("LockTable", MultiConflicts, MultiPrios, 5);
MultiTableId = tableId;
if (!(MultiTableId))
- {
elog(ERROR, "InitMultiLockm: couldnt initialize lock table");
- }
/* -----------------------
* No short term lock table for now. -Jeff 15 July 1991
*
@@ -434,9 +432,7 @@ MultiRelease(LockTableId tableId,
}
status = LockRelease(tableId, tmpTag, locks[i]);
if (!status)
- {
elog(ERROR, "MultiRelease: couldn't release after error");
- }
}
}
/* shouldn't reach here */
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index be91266cf6f..31d43723805 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.34 1998/02/26 04:36:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.35 1998/06/15 19:29:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.34 1998/02/26 04:36:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.35 1998/06/15 19:29:21 momjian Exp $
*/
#include <sys/time.h>
#include <unistd.h>
@@ -239,9 +239,7 @@ InitProcess(IPCKey key)
MyProc->sem.semKey = semKey;
}
else
- {
MyProc->sem.semId = -1;
- }
/* ----------------------
* Release the lock.
@@ -271,9 +269,7 @@ InitProcess(IPCKey key)
*/
location = MAKE_OFFSET(MyProc);
if ((!ShmemPIDLookup(MyProcPid, &location)) || (location != MAKE_OFFSET(MyProc)))
- {
elog(FATAL, "InitProc: ShmemPID table broken");
- }
MyProc->errType = NO_ERROR;
SHMQueueElemInit(&(MyProc->links));
@@ -353,12 +349,9 @@ ProcKill(int exitStatus, int pid)
proc = (PROC *) MAKE_PTR(location);
- if (proc != MyProc)
- {
- Assert(pid != MyProcPid);
- }
- else
- MyProc = NULL;
+ Assert(proc == MyProc || pid != MyProcPid);
+
+ MyProc = NULL;
/* ---------------
* Assume one lock table.
@@ -408,13 +401,9 @@ ProcQueueAlloc(char *name)
ShmemInitStruct(name, (unsigned) sizeof(PROC_QUEUE), &found);
if (!queue)
- {
return (NULL);
- }
if (!found)
- {
ProcQueueInit(queue);
- }
return (queue);
}
diff --git a/src/backend/storage/page/bufpage.c b/src/backend/storage/page/bufpage.c
index 13fdbf11c7f..e330cc05973 100644
--- a/src/backend/storage/page/bufpage.c
+++ b/src/backend/storage/page/bufpage.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.17 1998/04/24 14:42:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.18 1998/06/15 19:29:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -161,9 +161,7 @@ PageAddItem(Page page,
upper = ((PageHeader) page)->pd_upper - alignedSize;
if (lower > upper)
- {
return (InvalidOffsetNumber);
- }
itemId = &((PageHeader) page)->pd_linp[offsetNumber - 1];
(*itemId).lp_off = upper;
@@ -342,9 +340,7 @@ PageGetFreeSpace(Page page)
space = ((PageHeader) page)->pd_upper - ((PageHeader) page)->pd_lower;
if (space < sizeof(ItemIdData))
- {
return (0);
- }
space -= sizeof(ItemIdData);/* XXX not always true */
return (space);
@@ -464,8 +460,6 @@ PageIndexTupleDeleteAdjustLinePointers(PageHeader phdr,
for (i = PageGetMaxOffsetNumber((Page) phdr) - 1; i >= 0; i--)
{
if (phdr->pd_linp[i].lp_off <= offset)
- {
phdr->pd_linp[i].lp_off += size;
- }
}
}
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 8f3611e268b..2545523850d 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.30 1998/03/20 04:22:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.31 1998/06/15 19:29:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -227,9 +227,7 @@ mdunlink(Relation reln)
#else
v = &Md_fdvec[fd];
if (v != (MdfdVec *) NULL)
- {
FileUnlink(v->mdfd_vfd);
- }
#endif
MemoryContextSwitchTo(oldcxt);
@@ -416,21 +414,15 @@ mdread(Relation reln, BlockNumber blocknum, char *buffer)
#endif
if (FileSeek(v->mdfd_vfd, seekpos, SEEK_SET) != seekpos)
- {
return (SM_FAIL);
- }
status = SM_SUCCESS;
if ((nbytes = FileRead(v->mdfd_vfd, buffer, BLCKSZ)) != BLCKSZ)
{
if (nbytes == 0)
- {
MemSet(buffer, 0, BLCKSZ);
- }
else
- {
status = SM_FAIL;
- }
}
return (status);
@@ -461,9 +453,7 @@ mdwrite(Relation reln, BlockNumber blocknum, char *buffer)
#endif
if (FileSeek(v->mdfd_vfd, seekpos, SEEK_SET) != seekpos)
- {
return (SM_FAIL);
- }
status = SM_SUCCESS;
if (FileWrite(v->mdfd_vfd, buffer, BLCKSZ) != BLCKSZ)
@@ -500,9 +490,7 @@ mdflush(Relation reln, BlockNumber blocknum, char *buffer)
#endif
if (FileSeek(v->mdfd_vfd, seekpos, SEEK_SET) != seekpos)
- {
return (SM_FAIL);
- }
/* write and sync the block */
status = SM_SUCCESS;
@@ -705,9 +693,7 @@ mdnblocks(Relation reln)
v = v->mdfd_chain;
}
else
- {
return ((segno * RELSEG_SIZE) + nblocks);
- }
}
#else
return (_mdnblocks(v->mdfd_vfd, BLCKSZ));
@@ -805,9 +791,7 @@ mdabort()
v = &Md_fdvec[i];
if (v != (MdfdVec *) NULL)
#endif
- {
v->mdfd_flags &= ~MDFD_DIRTY;
- }
}
return (SM_SUCCESS);
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c
index 7ec50debf8a..3110c9afdd4 100644
--- a/src/backend/tcop/fastpath.c
+++ b/src/backend/tcop/fastpath.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.17 1998/05/06 23:50:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.18 1998/06/15 19:29:26 momjian Exp $
*
* NOTES
* This cruft is the server side of PQfn.
@@ -290,9 +290,7 @@ HandleFunctionRequest()
*/
fip = &last_fp;
if (!valid_fp_info(fid, fip))
- {
update_fp_info(fid, fip);
- }
if (fip->nargs != nargs)
{
@@ -308,9 +306,7 @@ HandleFunctionRequest()
for (i = 0; i < 8; ++i)
{
if (i >= nargs)
- {
arg[i] = (char *) NULL;
- }
else
{
argsize = pq_getint(4);
@@ -328,9 +324,7 @@ HandleFunctionRequest()
if (!(p = palloc(argsize + VARHDRSZ + 1))) /* Added +1 to solve
* memory leak - Peter
* 98 Jan 6 */
- {
elog(ERROR, "HandleFunctionRequest: palloc failed");
- }
VARSIZE(p) = argsize + VARHDRSZ;
pq_getnchar(VARDATA(p), 0, argsize);
}
@@ -338,9 +332,7 @@ HandleFunctionRequest()
{ /* ... fixed */
/* XXX cross our fingers and trust "argsize" */
if (!(p = palloc(argsize + 1)))
- {
elog(ERROR, "HandleFunctionRequest: palloc failed");
- }
pq_getnchar(p, 0, argsize);
}
palloced |= (1 << i);
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index e0d8599465b..9670f326404 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.75 1998/06/09 17:13:04 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.76 1998/06/15 19:29:27 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -565,9 +565,7 @@ pg_parse_and_plan(char *query_string, /* string to execute */
* function executor will crash. DZ - 30-8-1996
*/
else
- {
plan_list = lappend(plan_list, NULL);
- }
#endif
}
@@ -1177,9 +1175,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
exitpg(1);
}
else if (argc - optind == 1)
- {
DBName = argv[optind];
- }
else if ((DBName = userName) == NULL)
{
fprintf(stderr, "%s: USER undefined and no database specified\n",
@@ -1270,9 +1266,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
/* initialize */
if (!Quiet)
- {
puts("\tInitPostgres()..");
- }
InitPostgres(DBName);
@@ -1314,7 +1308,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface");
- puts("$Revision: 1.75 $ $Date: 1998/06/09 17:13:04 $");
+ puts("$Revision: 1.76 $ $Date: 1998/06/15 19:29:27 $");
}
/* ----------------
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index 83ec8c9fd1f..f34c56f4130 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.40 1998/06/15 18:39:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.41 1998/06/15 19:29:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -367,9 +367,7 @@ ProcessUtility(Node *parsetree,
stmt->definition); /* rest */
break;
case TYPE_P:
- {
DefineType(stmt->defname, stmt->definition);
- }
break;
case AGGREGATE:
DefineAggregate(stmt->defname, /* aggregate name */
@@ -479,9 +477,7 @@ ProcessUtility(Node *parsetree,
relationName = RewriteGetRuleEventRel(rulename);
aclcheck_result = pg_aclcheck(relationName, userName, ACL_RU);
if (aclcheck_result != ACLCHECK_OK)
- {
elog(ERROR, "%s: %s", relationName, aclcheck_error_strings[aclcheck_result]);
- }
#endif
RemoveRewriteRule(rulename);
}
@@ -553,9 +549,7 @@ ProcessUtility(Node *parsetree,
break;
case T_VersionStmt:
- {
elog(ERROR, "CREATE VERSION is not currently implemented");
- }
break;
case T_CreatedbStmt:
diff --git a/src/backend/tioga/Varray.c b/src/backend/tioga/Varray.c
index d5258cb5403..3a8ca434625 100644
--- a/src/backend/tioga/Varray.c
+++ b/src/backend/tioga/Varray.c
@@ -43,8 +43,6 @@ AppendVarray(Varray * array, void *value, CopyingFunct copy)
copy(value, VARRAY_NTH(array->val, array->size, array->nobj));
array->nobj++;
if (array->nobj >= array->maxObj)
- {
ENLARGE_VARRAY(array, array->maxObj / 2);
- }
return array->nobj;
}
diff --git a/src/backend/tioga/tgRecipe.c b/src/backend/tioga/tgRecipe.c
index 94caf287d40..ab2697085e9 100644
--- a/src/backend/tioga/tgRecipe.c
+++ b/src/backend/tioga/tgRecipe.c
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tioga/Attic/tgRecipe.c,v 1.8 1998/02/26 04:36:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tioga/Attic/tgRecipe.c,v 1.9 1998/06/15 19:29:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -385,9 +385,7 @@ lookupEdges(TgRecipe * r, char *name)
ntups = PQntuplesGroup(pbuf, 0);
if (ntups == 0)
- {
return;
- }
fromNode_attnum = PQfnumber(pbuf, 0, "fromNode");
fromPort_attnum = PQfnumber(pbuf, 0, "fromPort");
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index aff5abb5045..f212dfcdd70 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.27 1998/02/26 04:36:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.28 1998/06/15 19:29:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -98,13 +98,9 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
*s != ACL_MODECHG_EQL_CHR)
{ /* we just read a keyword, not a name */
if (!strcmp(name, ACL_IDTYPE_GID_KEYWORD))
- {
aip->ai_idtype = ACL_IDTYPE_GID;
- }
else if (strcmp(name, ACL_IDTYPE_UID_KEYWORD))
- {
elog(ERROR, "aclparse: bad keyword, must be [group|user]");
- }
s = getid(s, name); /* move s to the name beyond the keyword */
if (name[0] == '\0')
elog(ERROR, "aclparse: a name must follow the [group|user] keyword");
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c
index 7cfc425c181..3b60534278f 100644
--- a/src/backend/utils/adt/arrayfuncs.c
+++ b/src/backend/utils/adt/arrayfuncs.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.29 1998/03/30 16:47:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.30 1998/06/15 19:29:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -157,9 +157,7 @@ array_in(char *string, /* input array in external form */
ndim++;
}
else
- {
done = true;
- }
}
if (ndim == 0)
@@ -170,9 +168,7 @@ array_in(char *string, /* input array in external form */
for (i = 0; i < ndim; lBound[i++] = 1);
}
else
- {
elog(ERROR, "array_in: Need to specify dimension");
- }
}
else
{
@@ -273,9 +269,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
char *q;
for (i = 0; i < MAXDIM; ++i)
- {
temp[i] = dim[i] = 0;
- }
if (strncmp(str, "{}", 2) == 0)
return (0);
@@ -292,9 +286,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
case '\\':
/* skip escaped characters (\ and ") inside strings */
if (scanning_string && *(q + 1))
- {
q++;
- }
break;
case '\0':
@@ -343,9 +335,7 @@ _ArrayCount(char *str, int dim[], int typdelim)
q++;
}
for (i = 0; i < ndim; ++i)
- {
dim[i] = temp[i];
- }
return (ndim);
}
@@ -493,13 +483,9 @@ _ReadArrayStr(char *arrayStr,
if (values[i])
{
if (typalign == 'd')
- {
*nbytes += DOUBLEALIGN(*(int32 *) values[i]);
- }
else
- {
*nbytes += INTALIGN(*(int32 *) values[i]);
- }
}
else
{
@@ -555,9 +541,7 @@ _ReadLOArray(char *str,
str = _AdvanceBy1word(str, &chunkfile);
}
else
- {
elog(ERROR, "usage: <input file> -chunk DEFAULT/<access pattern file> -invert/-native [-noreorg <chunk file>]");
- }
}
if (inputfile == NULL)
@@ -1040,9 +1024,7 @@ array_clip(ArrayType *array,
1, isNull);
}
else
- {
_ReadArray(lowerIndx, upperIndx, len, fd, newfd, array, 1, isNull);
- }
}
#ifdef LOARRAY
LOclose(fd);
@@ -1245,9 +1227,7 @@ array_assgn(ArrayType *array,
if (!SanityCheckInput(ndim, n, dim, lb, upperIndx) ||
!SanityCheckInput(ndim, n, dim, lb, lowerIndx))
- {
return ((char *) array);
- }
for (i = 0; i < n; i++)
if (lowerIndx[i] > upperIndx[i])
@@ -1338,13 +1318,9 @@ system_cache_lookup(Oid element_type,
*typelem = typeStruct->typelem;
*typalign = typeStruct->typalign;
if (input)
- {
*proc = typeStruct->typinput;
- }
else
- {
*proc = typeStruct->typoutput;
- }
}
static Datum
@@ -1367,9 +1343,7 @@ _ArrayCast(char *value, bool byval, int len)
}
}
else
- {
return (Datum) value;
- }
return 0;
}
@@ -1400,9 +1374,7 @@ ArrayCastAndSet(char *src,
}
}
else
- {
memmove(dest, src, typlen);
- }
inc = typlen;
}
else
diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c
index 90f92bd24fa..d57c362afc6 100644
--- a/src/backend/utils/adt/cash.c
+++ b/src/backend/utils/adt/cash.c
@@ -9,7 +9,7 @@
* workings can be found in the book "Software Solutions in C" by
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.23 1998/03/02 00:13:36 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.24 1998/06/15 19:29:32 momjian Exp $
*/
#include <stdio.h>
@@ -122,9 +122,7 @@ printf( "cashin- negative symbol; string is '%s'\n", s);
}
else if (*s == psymbol)
- {
s++;
- }
#ifdef CASHDEBUG
printf( "cashin- string is '%s'\n", s);
@@ -687,9 +685,7 @@ cash_words_out(Cash *value)
p += 6;
}
else
- {
*buf = 0;
- }
m0 = *value % 100; /* cents */
m1 = (*value / 100) % 1000; /* hundreds */
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 2acf11e50bc..b0f38347f81 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.22 1998/02/26 04:36:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.23 1998/06/15 19:29:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -175,13 +175,9 @@ int
date_cmp(DateADT dateVal1, DateADT dateVal2)
{
if (dateVal1 < dateVal2)
- {
return -1;
- }
else if (dateVal1 > dateVal2)
- {
return 1;
- }
return 0;
} /* date_cmp() */
diff --git a/src/backend/utils/adt/datum.c b/src/backend/utils/adt/datum.c
index 5fd7c1ed119..c3c93d5eca0 100644
--- a/src/backend/utils/adt/datum.c
+++ b/src/backend/utils/adt/datum.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.9 1998/01/05 16:39:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datum.c,v 1.10 1998/06/15 19:29:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -56,9 +56,7 @@ datumGetSize(Datum value, Oid type, bool byVal, Size len)
if (byVal)
{
if (len <= sizeof(Datum))
- {
size = len;
- }
else
{
elog(ERROR,
@@ -116,9 +114,7 @@ datumCopy(Datum value, Oid type, bool byVal, Size len)
if (byVal)
- {
res = value;
- }
else
{
if (value == 0)
@@ -131,9 +127,7 @@ datumCopy(Datum value, Oid type, bool byVal, Size len)
*/
s = (char *) palloc(realSize);
if (s == NULL)
- {
elog(ERROR, "datumCopy: out of memory\n");
- }
memmove(s, DatumGetPointer(value), realSize);
res = (Datum) s;
}
diff --git a/src/backend/utils/adt/dt.c b/src/backend/utils/adt/dt.c
index f7f18b559d2..89f92e2e0fc 100644
--- a/src/backend/utils/adt/dt.c
+++ b/src/backend/utils/adt/dt.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.54 1998/06/15 18:39:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.55 1998/06/15 19:29:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -188,9 +188,7 @@ datetime_out(DateTime *dt)
}
else
- {
EncodeSpecialDateTime(DT_INVALID, buf);
- }
result = palloc(strlen(buf) + 1);
@@ -682,9 +680,7 @@ timespan_cmp(TimeSpan *timespan1, TimeSpan *timespan2)
}
else if (TIMESPAN_IS_INVALID(*timespan2))
- {
return (-1);
- }
span1 = timespan1->time;
if (timespan1->month != 0)
@@ -727,17 +723,11 @@ datetime_smaller(DateTime *datetime1, DateTime *datetime2)
dt2 = SetDateTime(dt2);
if (DATETIME_IS_INVALID(dt1))
- {
*result = dt2;
- }
else if (DATETIME_IS_INVALID(dt2))
- {
*result = dt1;
- }
else
- {
*result = ((dt2 < dt1) ? dt2 : dt1);
- }
return (result);
} /* datetime_smaller() */
@@ -764,17 +754,11 @@ datetime_larger(DateTime *datetime1, DateTime *datetime2)
dt2 = SetDateTime(dt2);
if (DATETIME_IS_INVALID(dt1))
- {
*result = dt2;
- }
else if (DATETIME_IS_INVALID(dt2))
- {
*result = dt1;
- }
else
- {
*result = ((dt2 > dt1) ? dt2 : dt1);
- }
return (result);
} /* datetime_larger() */
@@ -812,9 +796,7 @@ datetime_mi(DateTime *datetime1, DateTime *datetime2)
}
else
- {
result->time = JROUND(dt1 - dt2);
- }
result->month = 0;
return (result);
@@ -894,13 +876,9 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span)
if (tm->tm_mday > mdays[tm->tm_mon - 1])
{
if ((tm->tm_mon == 2) && isleap(tm->tm_year))
- {
tm->tm_mday = (mdays[tm->tm_mon - 1] + 1);
- }
else
- {
tm->tm_mday = mdays[tm->tm_mon - 1];
- }
}
#ifdef DATEDEBUG
@@ -912,9 +890,7 @@ datetime_pl_span(DateTime *datetime, TimeSpan *span)
}
else
- {
DATETIME_INVALID(dt);
- }
}
*result = dt;
@@ -1241,15 +1217,11 @@ datetime_age(DateTime *datetime1, DateTime *datetime2)
}
if (tm2timespan(tm, fsec, result) != 0)
- {
elog(ERROR, "Unable to decode datetime", NULL);
- }
}
else
- {
elog(ERROR, "Unable to decode datetime", NULL);
- }
return (result);
} /* datetime_age() */
@@ -1676,9 +1648,7 @@ datetime_part(text *units, DateTime *datetime)
type = DecodeUnits(0, lowunits, &val);
if (type == IGNORE)
- {
type = DecodeSpecial(0, lowunits, &val);
- }
#ifdef DATEDEBUG
if (type == IGNORE)
@@ -1843,9 +1813,7 @@ timespan_part(text *units, TimeSpan *timespan)
type = DecodeUnits(0, lowunits, &val);
if (type == IGNORE)
- {
type = DecodeSpecial(0, lowunits, &val);
- }
#ifdef DATEDEBUG
if (type == IGNORE)
@@ -2701,9 +2669,7 @@ ParseDateTime(char *timestr, char *lowstr,
* day later
*/
else
- {
ftype[nf] = DTK_NUMBER;
- }
}
@@ -2761,9 +2727,7 @@ ParseDateTime(char *timestr, char *lowstr,
/* otherwise something wrong... */
}
else
- {
return -1;
- }
/* ignore punctuation but use as delimiter */
}
@@ -2774,17 +2738,13 @@ ParseDateTime(char *timestr, char *lowstr,
}
else
- {
return -1;
- }
/* force in a delimiter */
*lp++ = '\0';
nf++;
if (nf > MAXDATEFIELDS)
- {
return -1;
- }
#ifdef DATEDEBUG
printf("ParseDateTime- set field[%d] to %s type %d\n", (nf - 1), field[nf - 1], ftype[nf - 1]);
#endif
@@ -3361,9 +3321,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, double *fsec)
str = cp + 1;
tm->tm_sec = strtol(str, &cp, 10);
if (*cp == '\0')
- {
*fsec = 0;
- }
else if (*cp == '.')
{
str = cp;
@@ -3372,9 +3330,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, double *fsec)
return -1;
}
else
- {
return -1;
- }
}
/* do a sanity check */
@@ -3498,19 +3454,13 @@ DecodeNumber(int flen, char *str, int fmask, int *tmask, struct tm * tm, double
*tmask = DTK_M(YEAR);
tm->tm_year = val;
if (tm->tm_year < 70)
- {
tm->tm_year += 2000;
- }
else if (tm->tm_year < 100)
- {
tm->tm_year += 1900;
- }
}
else
- {
return -1;
- }
return 0;
} /* DecodeNumber() */
@@ -3583,9 +3533,7 @@ DecodeNumberField(int len, char *str, int fmask, int *tmask, struct tm * tm, dou
if (cp == (str + 4))
return -1;
if (*cp == '.')
- {
*fsec = strtod(cp, NULL);
- }
*(str + 4) = '\0';
tm->tm_min = strtod((str + 2), &cp);
*(str + 2) = '\0';
@@ -3593,9 +3541,7 @@ DecodeNumberField(int len, char *str, int fmask, int *tmask, struct tm * tm, dou
}
else
- {
return -1;
- }
return 0;
} /* DecodeNumberField() */
@@ -3631,9 +3577,7 @@ DecodeTimezone(char *str, int *tzp)
}
else
- {
min = 0;
- }
tz = (hr * 60 + min) * 60;
if (*str == '-')
@@ -3658,9 +3602,7 @@ DecodeSpecial(int field, char *lowtoken, int *val)
#if USE_DATE_CACHE
if ((datecache[field] != NULL)
&& (strncmp(lowtoken, datecache[field]->token, TOKMAXLEN) == 0))
- {
tp = datecache[field];
- }
else
{
#endif
@@ -3942,9 +3884,7 @@ DecodeUnits(int field, char *lowtoken, int *val)
#if USE_DATE_CACHE
if ((deltacache[field] != NULL)
&& (strncmp(lowtoken, deltacache[field]->token, TOKMAXLEN) == 0))
- {
tp = deltacache[field];
- }
else
{
#endif
@@ -3962,13 +3902,9 @@ DecodeUnits(int field, char *lowtoken, int *val)
{
type = tp->type;
if ((type == TZ) || (type == DTZ))
- {
*val = FROMVAL(tp);
- }
else
- {
*val = tp->value;
- }
}
return (type);
diff --git a/src/backend/utils/adt/filename.c b/src/backend/utils/adt/filename.c
index 77bfa4df4e1..b1fc58f9fb0 100644
--- a/src/backend/utils/adt/filename.c
+++ b/src/backend/utils/adt/filename.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.14 1998/02/26 04:37:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.15 1998/06/15 19:29:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -111,14 +111,10 @@ filename_in(char *file)
ind = len + 1;
}
else
- {
elog(ERROR, "Couldn't find %s in your environment", environment);
- }
}
else
- {
ind = 0;
- }
strcat(str, file + ind);
return (str);
}
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index 7c63f08b7c9..d77fef0a169 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.32 1998/05/09 22:39:55 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.33 1998/06/15 19:29:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -254,9 +254,7 @@ path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point *p)
s++;
}
else
- {
return (FALSE);
- }
}
*ss = s;
@@ -960,9 +958,7 @@ line_parallel(LINE *l1, LINE *l2)
return (FPeq(l1->m, l2->m));
#endif
if (FPzero(l1->B))
- {
return (FPzero(l2->B));
- }
return (FPeq(l2->A, l1->A * (l2->B / l1->B)));
} /* line_parallel() */
@@ -977,13 +973,9 @@ line_perp(LINE *l1, LINE *l2)
return (FPeq(l1->m / l2->m, -1.0));
#endif
if (FPzero(l1->A))
- {
return (FPzero(l2->B));
- }
else if (FPzero(l1->B))
- {
return (FPzero(l2->A));
- }
return (FPeq(((l1->A * l2->B) / (l1->B * l2->A)), -1.0));
} /* line_perp() */
@@ -1396,9 +1388,7 @@ path_distance(PATH *p1, PATH *p2)
min = tmp;
}
else
- {
pfree(tmp);
- }
}
return (min);
@@ -2007,9 +1997,7 @@ dist_ps(Point *pt, LSEG *lseg)
* and through the input point
*/
if (lseg->p[1].x == lseg->p[0].x)
- {
m = 0;
- }
else if (lseg->p[1].y == lseg->p[0].y)
{ /* slope is infinite */
m = (double) DBL_MAX;
@@ -2140,9 +2128,7 @@ dist_sl(LSEG *lseg, LINE *line)
result = d2;
}
else
- {
pfree(d2);
- }
}
return (result);
@@ -2998,9 +2984,7 @@ make_bound_box(POLYGON *poly)
box_fill(&(poly->boundbox), x1, x2, y1, y2);
}
else
- {
elog(ERROR, "Unable to create bounding box for empty polygon", NULL);
- }
}
/*------------------------------------------------------------------
@@ -3717,9 +3701,7 @@ poly_center(POLYGON *poly)
}
else
- {
result = NULL;
- }
return (result);
} /* poly_center() */
@@ -3935,9 +3917,7 @@ circle_in(char *str)
while (isspace(*cp))
cp++;
if (*cp == LDELIM)
- {
s = cp;
- }
}
if (!pair_decode(s, &circle->center.x, &circle->center.y, &s))
@@ -3962,9 +3942,7 @@ circle_in(char *str)
s++;
}
else
- {
elog(ERROR, "Bad circle external representation '%s'", str);
- }
}
if (*s != '\0')
@@ -4511,9 +4489,7 @@ poly_circle(POLYGON *poly)
circle->center.y /= poly->npts;
for (i = 0; i < poly->npts; i++)
- {
circle->radius += point_dt(&poly->p[i], &circle->center);
- }
circle->radius /= poly->npts;
if (FPzero(circle->radius))
@@ -4570,23 +4546,17 @@ point_inside(Point *p, int npts, Point plist[])
y = plist[i].y - p->y;
if ((cross = lseg_crossing(x, y, px, py)) == HIT_IT)
- {
return 2;
- }
crossnum += cross;
px = x;
py = y;
}
if ((cross = lseg_crossing(x0, y0, px, py)) == HIT_IT)
- {
return 2;
- }
crossnum += cross;
if (crossnum != 0)
- {
return 1;
- }
return 0;
} /* point_inside() */
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index c186ea15908..daf0f6105b9 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.42 1998/02/26 04:37:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.43 1998/06/15 19:29:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -131,9 +131,7 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn)
#ifdef USE_POSIX_TIME
if (tzp != NULL)
- {
tx = localtime((time_t *) &time);
- }
else
{
tx = gmtime((time_t *) &time);
diff --git a/src/backend/utils/adt/name.c b/src/backend/utils/adt/name.c
index 69d821ad878..679dadbe45c 100644
--- a/src/backend/utils/adt/name.c
+++ b/src/backend/utils/adt/name.c
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.12 1998/05/29 13:31:52 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.13 1998/06/15 19:29:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -219,9 +219,7 @@ NameComputeLength(Name name)
for (length = 0, charP = name->data;
length < NAMEDATALEN && *charP != '\0';
length++, charP++)
- {
;
- }
return (uint32) length;
}
diff --git a/src/backend/utils/adt/not_in.c b/src/backend/utils/adt/not_in.c
index 66f5f83b5ee..6274d813c5d 100644
--- a/src/backend/utils/adt/not_in.c
+++ b/src/backend/utils/adt/not_in.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.8 1998/01/31 04:38:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/not_in.c,v 1.9 1998/06/15 19:29:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -89,9 +89,7 @@ int4notin(int16 not_in_arg, char *relation_and_attr)
integer_value = DatumGetInt16(value);
if (left_side_argument == integer_value)
- {
retval = false;
- }
}
/* close the relation */
@@ -120,9 +118,7 @@ my_varattno(Relation rd, char *a)
for (i = 0; i < rd->rd_rel->relnatts; i++)
{
if (!namestrcmp(&rd->rd_att->attrs[i]->attname, a))
- {
return (i + 1);
- }
}
return (-1);
}
diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c
index 6797253b9b0..5a60a670792 100644
--- a/src/backend/utils/adt/numutils.c
+++ b/src/backend/utils/adt/numutils.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.23 1998/02/26 04:37:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.24 1998/06/15 19:29:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -236,9 +236,7 @@ ftoa(double value, char *ascii, int width, int prec1, char format)
/* output left of dp */
expon--;
if (*p)
- {
*a++ = *p++;
- }
else
*a++ = '0';
}
diff --git a/src/backend/utils/adt/oidint2.c b/src/backend/utils/adt/oidint2.c
index 38dcfe7f9fc..1bcb37ef740 100644
--- a/src/backend/utils/adt/oidint2.c
+++ b/src/backend/utils/adt/oidint2.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint2.c,v 1.5 1998/02/26 04:37:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint2.c,v 1.6 1998/06/15 19:29:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,13 +31,9 @@ oidint2in(char *o)
oi->oi_oid = (Oid) pg_atoi(o, sizeof(Oid), '/');
if (*p == '\0')
- {
oi->oi_int2 = 0;
- }
else
- {
oi->oi_int2 = (int16) pg_atoi(++p, sizeof(int2), '\0');
- }
return (oi);
}
diff --git a/src/backend/utils/adt/oidint4.c b/src/backend/utils/adt/oidint4.c
index 2c45edb1ec8..90f482708bc 100644
--- a/src/backend/utils/adt/oidint4.c
+++ b/src/backend/utils/adt/oidint4.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint4.c,v 1.5 1998/02/26 04:37:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint4.c,v 1.6 1998/06/15 19:29:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,13 +30,9 @@ oidint4in(char *o)
oi->oi_oid = (Oid) pg_atoi(o, sizeof(Oid), '/');
if (*p == '\0')
- {
oi->oi_int4 = 0;
- }
else
- {
oi->oi_int4 = pg_atoi(++p, sizeof(int4), '\0');
- }
return (oi);
}
diff --git a/src/backend/utils/adt/oracle_compat.c b/src/backend/utils/adt/oracle_compat.c
index 3324108250a..d056652ed02 100644
--- a/src/backend/utils/adt/oracle_compat.c
+++ b/src/backend/utils/adt/oracle_compat.c
@@ -1,7 +1,7 @@
/*
* Edmund Mergl <E.Mergl@bawue.de>
*
- * $Id: oracle_compat.c,v 1.13 1998/04/27 17:08:19 scrappy Exp $
+ * $Id: oracle_compat.c,v 1.14 1998/06/15 19:29:36 momjian Exp $
*
*/
@@ -54,9 +54,7 @@ lower(text *string)
ptr_ret = VARDATA(ret);
while (m--)
- {
*ptr_ret++ = tolower((unsigned char)*ptr++);
- }
return ret;
}
@@ -94,9 +92,7 @@ upper(text *string)
ptr_ret = VARDATA(ret);
while (m--)
- {
*ptr_ret++ = toupper((unsigned char)*ptr++);
- }
return ret;
}
@@ -141,13 +137,9 @@ initcap(text *string)
while (m--)
{
if (*(ptr_ret - 1) == ' ' || *(ptr_ret - 1) == ' ')
- {
*ptr_ret++ = toupper((unsigned char)*ptr++);
- }
else
- {
*ptr_ret++ = tolower((unsigned char)*ptr++);
- }
}
return ret;
@@ -202,9 +194,7 @@ lpad(text *string1, int4 len, text *string2)
ptr1 = VARDATA(string1);
while (n--)
- {
*ptr_ret++ = *ptr1++;
- }
return ret;
}
@@ -250,9 +240,7 @@ rpad(text *string1, int4 len, text *string2)
ptr_ret = VARDATA(ret);
while (n--)
- {
*ptr_ret++ = *ptr1++;
- }
ptr2 = VARDATA(string2);
@@ -306,15 +294,11 @@ btrim(text *string, text *set)
while (ptr2 <= end2)
{
if (*ptr == *ptr2)
- {
break;
- }
++ptr2;
}
if (*ptr != *ptr2)
- {
break;
- }
ptr++;
ptr2 = VARDATA(set);
}
@@ -329,15 +313,11 @@ btrim(text *string, text *set)
while (ptr2 <= end2)
{
if (*end == *ptr2)
- {
break;
- }
++ptr2;
}
if (*end != *ptr2)
- {
break;
- }
--end;
ptr2 = VARDATA(set);
}
@@ -391,15 +371,11 @@ ltrim(text *string, text *set)
while (ptr2 <= end2)
{
if (*ptr == *ptr2)
- {
break;
- }
++ptr2;
}
if (*ptr != *ptr2)
- {
break;
- }
ptr++;
ptr2 = VARDATA(set);
}
@@ -455,15 +431,11 @@ rtrim(text *string, text *set)
while (ptr2 <= end2)
{
if (*ptr == *ptr2)
- {
break;
- }
++ptr2;
}
if (*ptr != *ptr2)
- {
break;
- }
--ptr;
ptr2 = VARDATA(set);
}
@@ -479,9 +451,7 @@ rtrim(text *string, text *set)
ptr_ret = VARDATA(ret) + m - 1;
while (m--)
- {
*ptr_ret-- = *ptr--;
- }
return ret;
}
@@ -524,9 +494,7 @@ substr(text *string, int4 m, int4 n)
ptr_ret = VARDATA(ret);
while (len--)
- {
*ptr_ret++ = *ptr++;
- }
return ret;
}
diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c
index 26549def6d9..abf6cfb608b 100644
--- a/src/backend/utils/adt/regexp.c
+++ b/src/backend/utils/adt/regexp.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.17 1998/04/26 04:07:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.18 1998/06/15 19:29:36 momjian Exp $
*
* Alistair Crooks added the code for the regex caching
* agc - cached the regular expressions used - there's a good chance
@@ -97,15 +97,11 @@ RE_compile_and_execute(struct varlena * text_re, char *text, int cflags)
for (oldest = 0, i = 1; i < rec; i++)
{
if (rev[i].cre_lru < rev[oldest].cre_lru)
- {
oldest = i;
- }
}
}
else
- {
oldest = rec++;
- }
/* if there was an old re, then de-allocate the space it used */
if (rev[oldest].cre_s != (char *) NULL)
@@ -115,9 +111,7 @@ RE_compile_and_execute(struct varlena * text_re, char *text, int cflags)
rev[i].cre_lru =
(rev[i].cre_lru - rev[oldest].cre_lru) / 2;
if (rev[i].cre_lru > lru)
- {
lru = rev[i].cre_lru;
- }
}
pg95_regfree(&rev[oldest].cre_re);
diff --git a/src/backend/utils/adt/regproc.c b/src/backend/utils/adt/regproc.c
index f47fc6bced8..96263e9da4d 100644
--- a/src/backend/utils/adt/regproc.c
+++ b/src/backend/utils/adt/regproc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.18 1998/04/26 04:07:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.19 1998/06/15 19:29:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -72,9 +72,7 @@ regprocin(char *proname)
RelationGetTupleDescriptor(proc),
&isnull);
if (isnull)
- {
elog(FATAL, "regprocin: null procedure %s", proname);
- }
break;
case 0:
result = (RegProcedure) 0;
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 695d4b1d525..3326d398f7f 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.18 1998/02/26 04:37:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.19 1998/06/15 19:29:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -506,13 +506,9 @@ hashsel(Oid operatorObjectId,
}
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
if (ntuples > 0)
- {
resultData = 1.0 / (float64data) ntuples;
- }
else
- {
resultData = (float64data) (1.0 / 100.0);
- }
result = &resultData;
}
@@ -573,13 +569,9 @@ hashnpage(Oid operatorObjectId,
ntuples = ((Form_pg_class) GETSTRUCT(atp))->reltuples;
if (ntuples > 0)
- {
tempData = 1.0 / (float64data) ntuples;
- }
else
- {
tempData = (float64data) (1.0 / 100.0);
- }
temp = &tempData;
}
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c
index cd43dcdace9..863e21e2cce 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.32 1998/05/29 13:33:24 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.33 1998/06/15 19:29:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -98,9 +98,7 @@ bpcharin(char *s, int dummy, int16 atttypmod)
/* blank pad the string if necessary */
for (; i < len; i++)
- {
*r++ = ' ';
- }
return (result);
}
@@ -186,9 +184,7 @@ printf("'\n");
/* blank pad the string if necessary */
for (; i < rlen; i++)
- {
*r++ = ' ';
- }
return (result);
} /* bpchar() */
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index 6475a018895..46f74c41442 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.35 1998/05/29 13:33:58 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.36 1998/06/15 19:29:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -657,13 +657,9 @@ byteaGetBit(text *v, int32 n)
byte = byteaGetByte(v, byteNo);
if (byte & (1 << bitNo))
- {
return ((int32) 1);
- }
else
- {
return ((int32) 0);
- }
}
/*-------------------------------------------------------------
@@ -729,9 +725,7 @@ byteaSetBit(text *v, int32 n, int32 newBit)
* sanity check!
*/
if (newBit != 0 && newBit != 1)
- {
elog(ERROR, "byteaSetByte: new bit must be 0 or 1");
- }
/*
* get the byte where the bit we want is stored.
@@ -744,13 +738,9 @@ byteaSetBit(text *v, int32 n, int32 newBit)
* calculate the new value for that byte
*/
if (newBit == 0)
- {
newByte = oldByte & (~(1 << bitNo));
- }
else
- {
newByte = oldByte | (1 << bitNo);
- }
/*
* NOTE: 'byteaSetByte' creates a copy of 'v' & sets the byte.
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index 47ce6a8b6ea..2a4a8605466 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.28 1998/06/15 18:39:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.29 1998/06/15 19:29:38 momjian Exp $
*
* Notes:
* XXX This needs to use exception.h to handle recovery when
@@ -172,9 +172,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
if (cp)
relation = heap_open(cp->relationId);
else
- {
relation = heap_openr(cache->cc_relname);
- }
didopen = 1;
}
@@ -325,9 +323,7 @@ comphash(long l, char *v)
i = 0;
while (l--)
- {
i += *v++;
- }
return (i);
}
@@ -643,9 +639,7 @@ SystemCacheRelationFlushed(Oid relId)
for (cache = Caches; PointerIsValid(cache); cache = cache->cc_next)
{
if (cache->relationId == relId)
- {
cache->relationId = InvalidOid;
- }
}
}
@@ -769,15 +763,11 @@ InitSysCache(char *relname,
{
cp->cc_key[i] = key[i];
if (!key[i])
- {
elog(FATAL, "InitSysCache: called with 0 key[%d]", i);
- }
if (key[i] < 0)
{
if (key[i] != ObjectIdAttributeNumber)
- {
elog(FATAL, "InitSysCache: called with %d key[%d]", key[i], i);
- }
else
{
cp->cc_klen[i] = sizeof(Oid);
@@ -990,9 +980,7 @@ SearchSysCache(struct catcache * cache,
*/
MemoryContextSwitchTo((MemoryContext) CacheCxt);
if (HeapTupleIsValid(ntp))
- {
ntp = heap_copytuple(ntp);
- }
}
else
{
@@ -1150,9 +1138,7 @@ RelationInvalidateCatalogCacheTuple(Relation relation,
/* OPT inline simplification of CatalogCacheIdInvalidate */
if (!PointerIsValid(function))
- {
function = CatalogCacheIdInvalidate;
- }
(*function) (ccp->id,
CatalogCacheComputeTupleHashIndex(ccp, relation, tuple),
diff --git a/src/backend/utils/cache/fcache.c b/src/backend/utils/cache/fcache.c
index 2a8df51c6a1..943ec3d0a7b 100644
--- a/src/backend/utils/cache/fcache.c
+++ b/src/backend/utils/cache/fcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.11 1998/02/26 04:37:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.12 1998/06/15 19:29:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -288,9 +288,7 @@ init_fcache(Oid foid,
retval->nargs = retval->func.fn_nargs;
}
else
- {
retval->func.fn_addr = (func_ptr) NULL;
- }
return (retval);
@@ -316,7 +314,5 @@ setFcache(Node *node, Oid foid, List *argList, ExprContext *econtext)
fnode->func_fcache = fcache;
}
else
- {
elog(ERROR, "init_fcache: node must be Oper or Func!");
- }
}
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 20762257e89..b7121544282 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.10 1998/02/23 17:43:23 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.11 1998/06/15 19:29:39 momjian Exp $
*
* Note - this code is real crufty...
*
@@ -140,9 +140,7 @@ LocalInvalidInvalidate(LocalInvalid invalid, void (*function) ())
&((InvalidationUserData *) invalid)->dataP[-1];
if (PointerIsValid(function))
- {
(*function) ((Pointer) &entryDataP->userData);
- }
invalid = (Pointer) entryDataP->nextP;
@@ -485,17 +483,11 @@ RelationInvalidateRelationCache(Relation relation,
* ----------------
*/
if (relationId == MyRelationRelationId)
- {
objectId = tuple->t_oid;
- }
else if (relationId == MyAttributeRelationId)
- {
objectId = ((AttributeTupleForm) GETSTRUCT(tuple))->attrelid;
- }
else if (relationId == MyAMRelationId)
- {
objectId = tuple->t_oid;
- }
else if (relationId == MyAMOPRelationId)
{
; /* objectId is unused */
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index b56c25e94de..08ee8ea2dd8 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.13 1998/02/26 04:37:30 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.14 1998/06/15 19:29:40 momjian Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@@ -251,9 +251,7 @@ op_mergesortable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
return TRUE;
}
else
- {
return FALSE;
- }
}
/*
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 3fe7de4c321..686cc610f2b 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.39 1998/06/15 18:39:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.40 1998/06/15 19:29:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -380,9 +380,7 @@ scan_pg_rel_seq(RelationBuildDescInfo buildinfo)
* ----------------
*/
if (!HeapTupleIsValid(pg_class_tuple))
- {
return_tuple = pg_class_tuple;
- }
else
{
/* ------------------
@@ -907,13 +905,9 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo)
* ----------------
*/
if (relp->relhasrules)
- {
RelationBuildRuleLock(relation);
- }
else
- {
relation->rd_rules = NULL;
- }
/* Triggers */
if (relp->reltriggers > 0)
@@ -926,9 +920,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo)
* ----------------
*/
if (OidIsValid(relam))
- {
IndexedAccessMethodInitialize(relation);
- }
/* ----------------
* initialize the relation lock manager information
@@ -993,9 +985,7 @@ IndexedAccessMethodInitialize(Relation relation)
support = (RegProcedure *) palloc(supportSize);
}
else
- {
support = (RegProcedure *) NULL;
- }
IndexSupportInitialize(strategy, support,
relation->rd_att->attrs[0]->attrelid,
@@ -1346,9 +1336,7 @@ RelationFlushRelation(Relation *relationPtr,
int j;
for (j = 0; j < relation->rd_rules->numLocks; j++)
- {
pfree(relation->rd_rules->rules[j]);
- }
pfree(relation->rd_rules->rules);
pfree(relation->rd_rules);
}
@@ -1460,9 +1448,7 @@ RelationFlushIndexes(Relation *r,
if (relation->rd_rel->relkind == RELKIND_INDEX && /* XXX style */
(!OidIsValid(accessMethodId) ||
relation->rd_rel->relam == accessMethodId))
- {
RelationFlushRelation(&relation, false);
- }
}
#endif
@@ -1588,9 +1574,7 @@ RelationPurgeLocalRelation(bool xactCommitted)
}
}
else
- {
smgrunlink(DEFAULT_SMGR, reln);
- }
}
else if (!IsBootstrapProcessingMode() && !(reln->rd_istemp))
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index 480a913e9d9..0348fa3481a 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.17 1998/05/09 23:45:29 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.18 1998/06/15 19:29:40 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
@@ -406,30 +406,22 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
return ((HeapTuple) NULL);
}
- if (!AMI_OVERRIDE)
- {
- Assert(PointerIsValid(SysCache[cacheId]));
- }
- else
+ Assert(AMI_OVERRIDE || PointerIsValid(SysCache[cacheId]));
+
+ if (!PointerIsValid(SysCache[cacheId]))
{
+ SysCache[cacheId] =
+ InitSysCache(cacheinfo[cacheId].name,
+ cacheinfo[cacheId].indname,
+ cacheId,
+ cacheinfo[cacheId].nkeys,
+ cacheinfo[cacheId].key,
+ cacheinfo[cacheId].iScanFunc);
if (!PointerIsValid(SysCache[cacheId]))
- {
- SysCache[cacheId] =
- InitSysCache(cacheinfo[cacheId].name,
- cacheinfo[cacheId].indname,
- cacheId,
- cacheinfo[cacheId].nkeys,
- cacheinfo[cacheId].key,
- cacheinfo[cacheId].iScanFunc);
- if (!PointerIsValid(SysCache[cacheId]))
- {
- elog(ERROR,
- "InitCatalogCache: Can't init cache %.16s(%d)",
- cacheinfo[cacheId].name,
- cacheId);
- }
-
- }
+ elog(ERROR,
+ "InitCatalogCache: Can't init cache %.16s(%d)",
+ cacheinfo[cacheId].name,
+ cacheId);
}
tp = SearchSysCache(SysCache[cacheId], key1, key2, key3, key4);
@@ -559,9 +551,7 @@ SearchSysCacheGetAttribute(int cacheId,
}
if (attributeByValue)
- {
returnValue = (void *) attributeValue;
- }
else
{
char *tmp;
@@ -662,9 +652,7 @@ TypeDefaultRetrieve(Oid typId)
returnValue = (void *) i32;
}
else
- {
returnValue = NULL;
- }
}
else
{
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index fdbae14e99b..88ca05a1b2f 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.28 1998/05/19 18:05:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.29 1998/06/15 19:29:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -63,9 +63,7 @@ elog(int lev, const char *fmt,...)
va_start(ap, fmt);
if (lev == DEBUG && Debugfile < 0)
- {
return;
- }
switch (lev)
{
case NOIND:
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index 1611cd1a966..e92878019b4 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.17 1998/01/31 04:38:57 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.18 1998/06/15 19:29:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -149,9 +149,7 @@ handle_load(char *filename, char *funcname)
if (file_scanner == (DynamicFileList *) NULL)
{
if (stat(filename, &stat_buf) == -1)
- {
elog(ERROR, "stat failed on file %s", filename);
- }
for (file_scanner = file_list;
file_scanner != (DynamicFileList *) NULL
@@ -168,9 +166,7 @@ handle_load(char *filename, char *funcname)
}
}
else
- {
file_scanner = (DynamicFileList *) NULL;
- }
/*
* File not loaded yet.
@@ -202,13 +198,9 @@ handle_load(char *filename, char *funcname)
{
load_error = (char *) pg_dlerror();
if (file_scanner == file_list)
- {
file_list = (DynamicFileList *) NULL;
- }
else
- {
file_tail->next = (DynamicFileList *) NULL;
- }
free((char *) file_scanner);
elog(ERROR, "Load of file %s failed: %s", filename, load_error);
@@ -226,9 +218,7 @@ handle_load(char *filename, char *funcname)
retval = (func_ptr) pg_dlsym(file_scanner->handle, funcname);
if (retval == (func_ptr) NULL)
- {
elog(ERROR, "Can't find function %s in file %s", funcname, filename);
- }
return (retval);
}
@@ -254,9 +244,7 @@ load_file(char *filename)
int done = 0;
if (stat(filename, &stat_buf) == -1)
- {
elog(ERROR, "stat failed on file %s", filename);
- }
if (file_list != (DynamicFileList *) NULL
&& !NOT_EQUAL(stat_buf, *file_list))
@@ -272,17 +260,11 @@ load_file(char *filename)
while (!done)
{
if (file_scanner->next == (DynamicFileList *) NULL)
- {
done = 1;
- }
else if (!NOT_EQUAL(stat_buf, *(file_scanner->next)))
- {
done = 1;
- }
else
- {
file_scanner = file_scanner->next;
- }
}
if (file_scanner->next != (DynamicFileList *) NULL)
diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c
index 618ab6a802f..c2a5b53aeb6 100644
--- a/src/backend/utils/fmgr/fmgr.c
+++ b/src/backend/utils/fmgr/fmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.16 1998/03/07 06:03:28 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.17 1998/06/15 19:29:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -50,9 +50,7 @@ fmgr_pl(char *arg0,...)
{
va_start(pvar, arg0);
for (i = 1; i < fmgr_pl_finfo->fn_nargs; i++)
- {
values.data[i] = va_arg(pvar, char *);
- }
va_end(pvar);
}
}
@@ -91,9 +89,7 @@ fmgr_c(FmgrInfo *finfo,
* instead.
*/
if (finfo->fn_plhandler != NULL)
- {
return (*(finfo->fn_plhandler)) (finfo, values, isNull);
- }
switch (n_arguments)
{
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c
index 23f4f43d9bd..07afdc3954e 100644
--- a/src/backend/utils/hash/dynahash.c
+++ b/src/backend/utils/hash/dynahash.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.13 1998/02/26 04:37:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.14 1998/06/15 19:29:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -165,9 +165,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
MemSet(hashp, 0, sizeof(HTAB));
if (flags & HASH_FUNCTION)
- {
hashp->hash = info->hash;
- }
else
{
/* default */
@@ -185,9 +183,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
/* hash table already exists, we're just attaching to it */
if (flags & HASH_ATTACH)
- {
return (hashp);
- }
}
else
@@ -204,9 +200,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
{
hashp->hctl = (HHDR *) hashp->alloc((unsigned long) sizeof(HHDR));
if (!hashp->hctl)
- {
return (0);
- }
}
if (!hdefault(hashp))
@@ -227,9 +221,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
hctl->sshift = my_log2(info->ssize);
}
if (flags & HASH_FFACTOR)
- {
hctl->ffactor = info->ffactor;
- }
/*
* SHM hash tables have fixed maximum size (allocate a maximal sized
@@ -251,9 +243,7 @@ hash_create(int nelem, HASHCTL *info, int flags)
hctl->datasize = info->datasize;
}
if (flags & HASH_ALLOC)
- {
hashp->alloc = info->alloc;
- }
if (init_htab(hashp, nelem))
{
@@ -327,9 +317,7 @@ init_htab(HTAB *hashp, int nelem)
nsegs = 1 << my_log2(nsegs);
if (nsegs > hctl->dsize)
- {
hctl->dsize = nsegs;
- }
/* Use two low order bits of points ???? */
@@ -452,9 +440,7 @@ call_hash(HTAB *hashp, char *k, int len)
bucket = hash_val & hctl->high_mask;
if (bucket > hctl->max_bucket)
- {
bucket = bucket & hctl->low_mask;
- }
return (bucket);
}
@@ -534,9 +520,7 @@ hash_search(HTAB *hashp,
curr = GET_BUCKET(hashp, currIndex);
if (!memcmp((char *) &(curr->key), keyPtr, hctl->keysize))
- {
break;
- }
prevIndexPtr = &(curr->next);
currIndex = *prevIndexPtr;
#if HASH_STATISTICS
@@ -608,9 +592,7 @@ hash_search(HTAB *hashp,
/* no free elements. allocate another chunk of buckets */
if (!bucket_alloc(hashp))
- {
return (NULL);
- }
currIndex = hctl->freeBucketIndex;
}
Assert(currIndex != INVALID_INDEX);
@@ -754,13 +736,9 @@ expand_table(HTAB *hashp)
/* Allocate new segment if necessary */
if (new_segnum >= hctl->dsize)
- {
dir_realloc(hashp);
- }
if (!(hashp->dir[new_segnum] = seg_alloc(hashp)))
- {
return (0);
- }
hctl->nsegs++;
}
@@ -851,9 +829,7 @@ seg_alloc(HTAB *hashp)
sizeof(SEGMENT) * hashp->hctl->ssize);
if (!segp)
- {
return (0);
- }
MemSet((char *) segp, 0,
(long) sizeof(SEGMENT) * hashp->hctl->ssize);
@@ -887,9 +863,7 @@ bucket_alloc(HTAB *hashp)
hashp->alloc((unsigned long) BUCKET_ALLOC_INCR * bucketSize);
if (!tmpBucket)
- {
return (0);
- }
tmpIndex = MAKE_HASHOFFSET(hashp, tmpBucket);
diff --git a/src/backend/utils/init/findbe.c b/src/backend/utils/init/findbe.c
index e84256d6de9..06d6c7a5ef1 100644
--- a/src/backend/utils/init/findbe.c
+++ b/src/backend/utils/init/findbe.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.9 1998/06/09 17:13:05 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.10 1998/06/15 19:29:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -110,9 +110,7 @@ ValidateBinary(char *path)
if (pwp)
{
if (pwp->pw_gid == buf.st_gid)
- {
++in_grp;
- }
else if (pwp->pw_name &&
(gp = getgrgid(buf.st_gid)))
{
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 27bb849a08b..650068d22d4 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.28 1998/05/29 17:00:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.29 1998/06/15 19:29:49 momjian Exp $
*
* NOTES
* InitPostgres() is the function called from PostgresMain
@@ -295,9 +295,7 @@ InitCommunication()
postid = getenv("POSTID");
if (!PointerIsValid(postid))
- {
MyBackendTag = -1;
- }
else
{
MyBackendTag = atoi(postid);
@@ -307,9 +305,7 @@ InitCommunication()
ipc_key = getenv("IPC_KEY");
if (!PointerIsValid(ipc_key))
- {
key = -1;
- }
else
{
key = atoi(ipc_key);
@@ -367,9 +363,7 @@ InitCommunication()
* ----------------
*/
if (MyBackendTag == -1)
- {
MyBackendTag = 1;
- }
key = PrivateIPCKey;
}
diff --git a/src/backend/utils/misc/database.c b/src/backend/utils/misc/database.c
index 7b3433b0baa..a2ab2f3ba76 100644
--- a/src/backend/utils/misc/database.c
+++ b/src/backend/utils/misc/database.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.9 1998/05/29 13:43:14 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.10 1998/06/15 19:29:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -144,9 +144,7 @@ ExpandDatabasePath(char *dbpath)
}
/* no path delimiter? then add the default path prefixes */
else
- {
sprintf(buf, "%s%cbase%c%s", DataDir, SEP_CHAR, SEP_CHAR, dbpath);
- }
path = palloc(strlen(buf) + 1);
strcpy(path, buf);
diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c
index db98bdc83d3..5de78307f66 100644
--- a/src/backend/utils/mmgr/aset.c
+++ b/src/backend/utils/mmgr/aset.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.8 1997/09/08 20:57:46 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.9 1998/06/15 19:29:51 momjian Exp $
*
* NOTE
* XXX This is a preliminary implementation which lacks fail-fast
@@ -130,9 +130,7 @@ AllocSetReset(AllocSet set)
AssertArg(AllocSetIsValid(set));
while (AllocPointerIsValid(pointer = AllocSetGetFirst(set)))
- {
AllocSetFree(set, pointer);
- }
}
#ifdef NOT_USED
@@ -144,9 +142,7 @@ AllocSetReset_debug(char *file, int line, AllocSet set)
AssertArg(AllocSetIsValid(set));
while (AllocPointerIsValid(pointer = AllocSetGetFirst(set)))
- {
AllocSetFree(set, pointer);
- }
}
#endif
@@ -189,9 +185,7 @@ AllocSetAlloc(AllocSet set, Size size)
alloc = (AllocElem) malloc(sizeof(*alloc) + size);
if (!PointerIsValid(alloc))
- {
elog(FATAL, "palloc failure: memory exhausted");
- }
/* add to allocation list */
OrderedElemPushInto(&alloc->elemData, &set->setData);
@@ -298,9 +292,7 @@ AllocSetIterate(AllocSet set,
{
if (PointerIsValid(function))
- {
(*function) (pointer);
- }
count += 1;
}
@@ -319,9 +311,7 @@ AllocSetCount(AllocSet set)
for (pointer = AllocSetGetFirst(set);
AllocPointerIsValid(pointer);
pointer = AllocPointerGetNext(pointer))
- {
count++;
- }
return count;
}
@@ -346,9 +336,7 @@ AllocSetGetFirst(AllocSet set)
alloc = (AllocElem) OrderedSetGetHead(&set->setData);
if (!AllocElemIsValid(alloc))
- {
return (NULL);
- }
return (AllocElemGetAllocPointer(alloc));
}
@@ -369,9 +357,7 @@ AllocPointerGetNext(AllocPointer pointer)
OrderedElemGetSuccessor(&AllocPointerGetAllocElem(pointer)->elemData);
if (!AllocElemIsValid(alloc))
- {
return (NULL);
- }
return (AllocElemGetAllocPointer(alloc));
}
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 880b8cddc72..dbe9b65fb91 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.7 1998/02/26 04:38:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.8 1998/06/15 19:29:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -151,9 +151,7 @@ EnableMemoryContext(bool on)
AssertArg(BoolIsValid(on));
if (BypassEnable(&MemoryContextEnableCount, on))
- {
return;
- }
processing = true;
@@ -188,9 +186,7 @@ EnableMemoryContext(bool on)
OrderedElemPop(&TopGlobalMemoryData.elemData);
}
else
- {
GlobalMemoryDestroy(context);
- }
/* what is needed for the top? */
}
@@ -493,15 +489,11 @@ GlobalMemoryDump(GlobalMemory this)
context = (GlobalMemory) OrderedElemGetPredecessor(&this->elemData);
if (PointerIsValid(context))
- {
printf("\tpredecessor=%s\n", GlobalMemoryGetName(context));
- }
context = (GlobalMemory) OrderedElemGetSuccessor(&this->elemData);
if (PointerIsValid(context))
- {
printf("\tsucessor=%s\n", GlobalMemoryGetName(context));
- }
AllocSetDump(&this->setData); /* XXX is this right interface */
}
diff --git a/src/backend/utils/mmgr/oset.c b/src/backend/utils/mmgr/oset.c
index 4c76d73d36a..810964e94dd 100644
--- a/src/backend/utils/mmgr/oset.c
+++ b/src/backend/utils/mmgr/oset.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.7 1998/02/11 19:13:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.8 1998/06/15 19:29:53 momjian Exp $
*
* NOTE
* XXX This is a preliminary implementation which lacks fail-fast
@@ -68,9 +68,7 @@ OrderedSetGetHead(OrderedSet set)
elem = set->head;
if (elem->next)
- {
return (OrderedElemGetBase(elem));
- }
return (NULL);
}
@@ -85,9 +83,7 @@ OrderedSetGetTail(OrderedSet set)
elem = set->tail;
if (elem->prev)
- {
return (OrderedElemGetBase(elem));
- }
return (NULL);
}
@@ -101,9 +97,7 @@ OrderedElemGetPredecessor(OrderedElem elem)
{
elem = elem->prev;
if (elem->prev)
- {
return (OrderedElemGetBase(elem));
- }
return (NULL);
}
@@ -115,9 +109,7 @@ OrderedElemGetSuccessor(OrderedElem elem)
{
elem = elem->next;
if (elem->next)
- {
return (OrderedElemGetBase(elem));
- }
return (NULL);
}
diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c
index e12b6f44ac9..b910696ea46 100644
--- a/src/backend/utils/mmgr/portalmem.c
+++ b/src/backend/utils/mmgr/portalmem.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.11 1998/06/15 18:39:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.12 1998/06/15 19:29:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -594,9 +594,7 @@ GetPortalByName(char *name)
AssertState(PortalManagerEnabled);
if (PointerIsValid(name))
- {
PortalHashTableLookup(name, portal);
- }
else
{
if (!PortalIsValid(BlankPortal))
diff --git a/src/backend/utils/sort/psort.c b/src/backend/utils/sort/psort.c
index 926c464fd26..88890556bed 100644
--- a/src/backend/utils/sort/psort.c
+++ b/src/backend/utils/sort/psort.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.40 1998/06/15 18:39:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.41 1998/06/15 19:29:54 momjian Exp $
*
* NOTES
* Sorts the first relation into the second relation.
@@ -1072,9 +1072,7 @@ resettape(FILE *file)
file = freopen(tp->tl_name, "w+", file);
if (file == NULL)
- {
elog(FATAL, "could not freopen temporary file");
- }
}
#endif
diff --git a/src/backend/utils/time/tqual.c b/src/backend/utils/time/tqual.c
index 3f9bc0410d3..14b961f0669 100644
--- a/src/backend/utils/time/tqual.c
+++ b/src/backend/utils/time/tqual.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.15 1998/04/24 14:42:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.16 1998/06/15 19:29:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -44,9 +44,7 @@ setheapoverride(bool on)
HeapSpecialCommandId = GetCurrentCommandId();
}
else
- {
HeapSpecialTransactionId = InvalidTransactionId;
- }
}
#endif /* !defined(GOODAMI) */
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index dddc211ea82..bc58b8e45c2 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.20 1998/02/26 04:38:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.21 1998/06/15 19:30:00 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
@@ -126,9 +126,7 @@ findParentsByOid(TableInfo *tblinfo, int numTables,
for (i = 0; i < numInherits; i++)
{
if (strcmp(inhinfo[i].inhrel, oid) == 0)
- {
numParents++;
- }
}
*numParentsPtr = numParents;
@@ -396,9 +394,7 @@ flagInhAttrs(TableInfo *tblinfo, int numTables,
if (strInArray(tblinfo[i].attnames[j],
tblinfo[parentInd].attnames,
tblinfo[parentInd].numatts) != -1)
- {
tblinfo[i].inhAttrs[j] = 1;
- }
}
}
}
@@ -493,8 +489,6 @@ fmtId(const char *rawid)
cp = id;
}
else
- {
cp = rawid;
- }
return (cp);
} /* fmtId() */
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f386231d14e..b57c8bf85b1 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.71 1998/05/06 23:53:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.72 1998/06/15 19:30:01 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@@ -351,9 +351,7 @@ dumpClasses_dumpData(FILE *fout, const char *classname,
do
{
if (PQgetisnull(res, tuple, field))
- {
fprintf(fout, "NULL");
- }
else
{
switch (PQftype(res, field))
@@ -613,9 +611,7 @@ main(int argc, char **argv)
/* open the output file */
if (filename == NULL)
- {
g_fout = stdout;
- }
else
{
g_fout = fopen(filename, "w");
@@ -688,9 +684,7 @@ main(int argc, char **argv)
tblinfo = dumpSchema(NULL, &numTables, tablename, acls);
if (!schemaOnly)
- {
dumpClasses(tblinfo, numTables, g_fout, tablename, oids);
- }
if (!dataOnly) /* dump indexes and triggers at the end
* for performance */
@@ -2011,9 +2005,7 @@ dumpFuncs(FILE *fout, FuncInfo *finfo, int numFuncs,
int i;
for (i = 0; i < numFuncs; i++)
- {
dumpOneFunc(fout, finfo, i, tinfo, numTypes);
- }
}
/*
@@ -2228,9 +2220,7 @@ dumpAggs(FILE *fout, AggInfo *agginfo, int numAggs,
if (strcmp(agginfo[i].aggfinalfn, "-") == 0)
finalfunc[0] = '\0';
else
- {
sprintf(finalfunc, "FINALFUNC = %s", agginfo[i].aggfinalfn);
- }
if (sfunc1[0] != '\0' && sfunc2[0] != '\0')
{
comma1[0] = ',';
@@ -2581,9 +2571,7 @@ dumpIndices(FILE *fout, IndInfo *indinfo, int numIndices,
fmtId(indinfo[i].indrelname));
if (strcmp(indinfo[i].indproc, "0") == 0)
- {
funcname = NULL;
- }
else
{
@@ -2729,9 +2717,7 @@ dumpTuples(PGresult *res, FILE *fout, int *attrmap)
for (j = 0; j < n; j++)
{
for (k = 0; k < m; k++)
- {
outVals[attrmap[k]] = PQgetvalue(res, j, k);
- }
for (k = 0; k < m; k++)
{
char *pval = outVals[k];
diff --git a/src/bin/pg_id/pg_id.c b/src/bin/pg_id/pg_id.c
index b246131b84a..7388946051e 100644
--- a/src/bin/pg_id/pg_id.c
+++ b/src/bin/pg_id/pg_id.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.5 1997/09/08 02:32:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.6 1998/06/15 19:30:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,9 +53,7 @@ main(int argc, char **argv)
printf("%ld\n", (long) pw->pw_uid);
}
else
- {
printf("%ld\n", (long) getuid());
- }
exit(0);
}
diff --git a/src/bin/pgtclsh/pgtclAppInit.c b/src/bin/pgtclsh/pgtclAppInit.c
index f344dd403ef..d121d28a14a 100644
--- a/src/bin/pgtclsh/pgtclAppInit.c
+++ b/src/bin/pgtclsh/pgtclAppInit.c
@@ -76,9 +76,7 @@ int
Tcl_AppInit(Tcl_Interp * interp)
{
if (Tcl_Init(interp) == TCL_ERROR)
- {
return TCL_ERROR;
- }
/*
* Call the init procedures for included packages. Each call should
@@ -90,9 +88,7 @@ Tcl_AppInit(Tcl_Interp * interp)
*/
if (Pgtcl_Init(interp) == TCL_ERROR)
- {
return TCL_ERROR;
- }
/*
* Call Tcl_CreateCommand for application-specific commands, if they
diff --git a/src/bin/pgtclsh/pgtkAppInit.c b/src/bin/pgtclsh/pgtkAppInit.c
index bdb569cb3c9..0bf685bd1a3 100644
--- a/src/bin/pgtclsh/pgtkAppInit.c
+++ b/src/bin/pgtclsh/pgtkAppInit.c
@@ -75,13 +75,9 @@ int
Tcl_AppInit(Tcl_Interp * interp)
{
if (Tcl_Init(interp) == TCL_ERROR)
- {
return TCL_ERROR;
- }
if (Tk_Init(interp) == TCL_ERROR)
- {
return TCL_ERROR;
- }
/*
* Call the init procedures for included packages. Each call should
@@ -93,9 +89,7 @@ Tcl_AppInit(Tcl_Interp * interp)
*/
if (Pgtcl_Init(interp) == TCL_ERROR)
- {
return TCL_ERROR;
- }
/*
* Call Tcl_CreateCommand for application-specific commands, if they
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index e698f68fb53..9f699ad8d74 100644
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.144 1998/05/15 01:57:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.145 1998/06/15 19:30:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -307,9 +307,7 @@ handle_sigint (SIGNAL_ARGS)
exit(1); /* accept signal if no connection */
/* Try to send cancel request */
if (PQrequestCancel(cancelConn))
- {
fprintf(stderr, "\nCANCEL request sent\n");
- }
else
{
fprintf(stderr, "\nCannot send cancel request:\n%s\n",
@@ -1361,13 +1359,9 @@ do_copy(const char *args, PsqlSettings *pset)
strcat(query, " TO stdout");
if (from)
- {
copystream = fopen(file, "r");
- }
else
- {
copystream = fopen(file, "w");
- }
if (copystream == NULL)
fprintf(stderr,
"Unable to open file %s which to copy, errno = %s (%d).",
@@ -2176,9 +2170,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
}
else
- {
query_alloced = true;
- }
}
interactive = ((source == stdin) && !pset->notty);
@@ -2321,9 +2313,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
strcat(query, query_start);
}
else
- {
strcpy(query, query_start);
- }
}
line[i] = hold_char;
query_start = line + i;
@@ -2345,9 +2335,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
/* inside a quote? */
if (in_quote && (line[i] != '\'' || was_bslash))
- {
/* do nothing */ ;
- }
else if (xcomment != NULL) /* inside an extended
* comment? */
{
@@ -2375,9 +2363,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
break;
}
else if (line[i] == '\'')
- {
in_quote ^= 1;
- }
/* semi-colon? then send query now */
else if (!paren_level && line[i] == ';')
{
@@ -2411,9 +2397,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
}
else if (paren_level && line[i] == ')')
- {
paren_level--;
- }
}
}
@@ -2544,9 +2528,7 @@ main(int argc, char **argv)
case 'c':
singleQuery = strdup(optarg);
if (singleQuery[0] == '\\')
- {
singleSlashCmd = 1;
- }
break;
case 'd':
dbname = optarg;
@@ -2625,9 +2607,7 @@ main(int argc, char **argv)
free(connect_string);
}
else
- {
settings.db = PQsetdb(host, port, NULL, NULL, dbname);
- }
dbname = PQdb(settings.db);
@@ -2642,9 +2622,7 @@ main(int argc, char **argv)
cancelConn = settings.db; /* enable SIGINT to send cancel */
if (listDatabases)
- {
exit(listAllDbs(&settings));
- }
if (!settings.quiet && !settings.notty && !singleQuery && !qfilename)
{
printf("Welcome to the POSTGRESQL interactive sql monitor:\n");
@@ -2802,9 +2780,7 @@ handleCopyIn(PGresult *res, const bool mustprompt, FILE *copystream)
for (; buflen > 1 &&
!(linedone = (c = getc(copystream)) == '\n' || c == EOF);
--buflen)
- {
*s++ = c;
- }
if (c == EOF)
{
PQputline(res->conn, "\\.");
@@ -2816,9 +2792,7 @@ handleCopyIn(PGresult *res, const bool mustprompt, FILE *copystream)
if (firstload)
{
if (!strcmp(copybuf, "\\."))
- {
copydone = true;
- }
firstload = false;
}
}
@@ -2949,9 +2923,7 @@ make_connect_string(char *host, char *port, char *dbname,
connect_string = (char *) malloc(connect_string_len);
if (!connect_string)
- {
return 0;
- }
connect_string[0] = '\0';
if (host)
{
diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c
index ecbd2354617..8e4f8cdd25a 100644
--- a/src/interfaces/ecpg/lib/ecpglib.c
+++ b/src/interfaces/ecpg/lib/ecpglib.c
@@ -895,9 +895,7 @@ ECPGdisconnect(int lineno, const char *connection_name)
return false;
}
else
- {
ECPGfinish(con);
- }
}
return true;
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index dd395c80eb9..7f4041de3b5 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -291,9 +291,7 @@ ECPGdump_a_struct(FILE *o, const char *name, const char * ind_name, long arrsiz,
offset = obuf;
}
else
- {
offset = offsetarg;
- }
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);
prefix = pbuf;
@@ -349,9 +347,7 @@ ECPGfree_type(struct ECPGtype * typ)
free(typ->u.members);
}
else
- {
abort();
- }
}
free(typ);
}
diff --git a/src/interfaces/libpgtcl/pgtclCmds.c b/src/interfaces/libpgtcl/pgtclCmds.c
index 0d80434edbd..b7eae9d6b78 100644
--- a/src/interfaces/libpgtcl/pgtclCmds.c
+++ b/src/interfaces/libpgtcl/pgtclCmds.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.23 1998/03/30 17:39:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.24 1998/06/15 19:30:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -62,13 +62,9 @@ translate_escape(char *p, int isArray)
case '7':
c = DIGIT(c);
if (ISOCTAL(*s))
- {
c = (c << 3) + DIGIT(*s++);
- }
if (ISOCTAL(*s))
- {
c = (c << 3) + DIGIT(*s++);
- }
*p = c;
break;
case 'b':
@@ -102,13 +98,9 @@ translate_escape(char *p, int isArray)
* the caller.
*/
if (isArray)
- {
return p + 1;
- }
else
- {
*p = c;
- }
break;
case '\0':
@@ -132,9 +124,7 @@ translate_escape(char *p, int isArray)
/* Shift the rest of the buffer over itself after the current char */
q = p + 1;
for (; *s;)
- {
*q++ = *s++;
- }
*q = '\0';
#ifdef TCL_ARRAYS_DEBUG_ESCAPE
printf(" after = '%s'\n", p);
@@ -158,9 +148,7 @@ tcl_value(char *value)
char *p;
if (!value)
- {
return ((char *) NULL);
- }
#ifdef TCL_ARRAYS_DEBUG
printf("pq_value = '%s'\n", value);
@@ -206,9 +194,7 @@ tcl_value(char *value)
}
}
if (!*p)
- {
break;
- }
}
}
else
@@ -225,9 +211,7 @@ tcl_value(char *value)
p = translate_escape(p, 0);
}
if (!*p)
- {
break;
- }
}
}
#ifdef TCL_ARRAYS_DEBUG
@@ -1236,9 +1220,7 @@ Pg_select(ClientData cData, Tcl_Interp *interp, int argc, char **argv)
Tcl_SetVar2(interp, argv[3], ".tupno", buffer, 0);
for (column = 0; column < ncols; column++)
- {
Tcl_SetVar2(interp, argv[3], info[column].cname, PQgetvalue(result, tupno, column), 0);
- }
Tcl_SetVar2(interp, argv[3], ".command", "update", 0);
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c
index 148d9343497..a5d842d905d 100644
--- a/src/interfaces/libpq/fe-auth.c
+++ b/src/interfaces/libpq/fe-auth.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.16 1998/03/22 04:18:17 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.17 1998/06/15 19:30:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -396,9 +396,7 @@ pg_krb5_sendauth(const char *PQerrormsg, int sock,
strcpy(servbuf, PG_KRB_SRVNAM);
*(hostp = servbuf + (sizeof(PG_KRB_SRVNAM) - 1)) = '/';
if (hostname || *hostname)
- {
strncpy(++hostp, hostname, MAXHOSTNAMELEN);
- }
else
{
if (gethostname(++hostp, MAXHOSTNAMELEN) < 0)
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 288f159c740..20c02950b1d 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.66 1998/05/06 23:51:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.67 1998/06/15 19:30:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -328,17 +328,11 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions, cons
conn->pgoptions = strdup(pgoptions);
if (login)
- {
conn->pguser = strdup(login);
- }
else if ((tmp = getenv("PGUSER")) != NULL)
- {
conn->pguser = strdup(tmp);
- }
else
- {
conn->pguser = fe_getauthname(conn->errorMessage);
- }
if (conn->pguser == NULL)
{
@@ -348,17 +342,11 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions, cons
}
if (pwd)
- {
conn->pgpass = strdup(pwd);
- }
else if ((tmp = getenv("PGPASSWORD")) != NULL)
- {
conn->pgpass = strdup(tmp);
- }
else
- {
conn->pgpass = strdup(DefaultPassword);
- }
if ((dbName == NULL) || dbName[0] == '\0')
{
@@ -465,9 +453,7 @@ connectDB(PGconn *conn)
len = sizeof(struct sockaddr_in);
}
else
- {
len = UNIXSOCK_PATH(conn->raddr.un, portno);
- }
/* Connect to the server */
if ((conn->sock = socket(family, SOCK_STREAM, 0)) < 0)
@@ -846,9 +832,7 @@ void
PQfinish(PGconn *conn)
{
if (!conn)
- {
fprintf(stderr, "PQfinish() -- pointer to PGconn is null\n");
- }
else
{
closePGconn(conn);
@@ -864,9 +848,7 @@ void
PQreset(PGconn *conn)
{
if (!conn)
- {
fprintf(stderr, "PQreset() -- pointer to PGconn is null\n");
- }
else
{
closePGconn(conn);
@@ -941,18 +923,14 @@ conninfo_parse(const char *conninfo, char *errorMessage)
while (*cp)
{
if (*cp == '=')
- {
break;
- }
if (isspace(*cp))
{
*cp++ = '\0';
while (*cp)
{
if (!isspace(*cp))
- {
break;
- }
cp++;
}
break;
@@ -975,9 +953,7 @@ conninfo_parse(const char *conninfo, char *errorMessage)
while (*cp)
{
if (!isspace(*cp))
- {
break;
- }
cp++;
}
@@ -997,14 +973,10 @@ conninfo_parse(const char *conninfo, char *errorMessage)
{
cp++;
if (*cp != '\0')
- {
*cp2++ = *cp++;
- }
}
else
- {
*cp2++ = *cp++;
- }
}
*cp2 = '\0';
}
@@ -1025,9 +997,7 @@ conninfo_parse(const char *conninfo, char *errorMessage)
{
cp++;
if (*cp != '\0')
- {
*cp2++ = *cp++;
- }
continue;
}
if (*cp == '\'')
@@ -1048,9 +1018,7 @@ conninfo_parse(const char *conninfo, char *errorMessage)
for (option = PQconninfoOptions; option->keyword != NULL; option++)
{
if (!strcmp(option->keyword, pname))
- {
break;
- }
}
if (option->keyword == NULL)
{
@@ -1112,9 +1080,7 @@ conninfo_parse(const char *conninfo, char *errorMessage)
{
tmp = fe_getauthname(errortmp);
if (tmp)
- {
option->val = strdup(tmp);
- }
}
/* ----------
@@ -1125,9 +1091,7 @@ conninfo_parse(const char *conninfo, char *errorMessage)
{
tmp = conninfo_getval("user");
if (tmp)
- {
option->val = strdup(tmp);
- }
}
}
@@ -1143,9 +1107,7 @@ conninfo_getval(char *keyword)
for (option = PQconninfoOptions; option->keyword != NULL; option++)
{
if (!strcmp(option->keyword, keyword))
- {
return option->val;
- }
}
return NULL;
@@ -1273,9 +1235,7 @@ PQtrace(PGconn *conn, FILE *debug_port)
{
if (conn == NULL ||
conn->status == CONNECTION_BAD)
- {
return;
- }
PQuntrace(conn);
conn->Pfdebug = debug_port;
}
@@ -1285,9 +1245,7 @@ PQuntrace(PGconn *conn)
{
/* note: better allow untrace even when connection bad */
if (conn == NULL)
- {
return;
- }
if (conn->Pfdebug)
{
fflush(conn->Pfdebug);
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index c48e9aa9b15..8b4a55e290e 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.52 1998/05/14 17:18:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.53 1998/06/15 19:30:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -258,9 +258,7 @@ PQconsumeInput(PGconn *conn)
* Note that we will NOT block waiting for more input.
*/
if (pqReadData(conn) < 0)
- {
strcpy(conn->asyncErrorMessage, conn->errorMessage);
- }
/* Parsing of the data waits till later. */
}
@@ -580,9 +578,7 @@ getAnotherTuple(PGconn *conn, int binary)
if (pqGetInt(&vlen, 4, conn))
return EOF;
if (binary == 0)
- {
vlen = vlen - 4;
- }
if (vlen < 0)
vlen = 0;
if (tup[i].value == NULL)
@@ -950,9 +946,7 @@ void
PQputline(PGconn *conn, const char *s)
{
if (conn && conn->sock >= 0)
- {
(void) pqPutnchar(s, strlen(s), conn);
- }
}
/*
@@ -1237,9 +1231,7 @@ PQfname(PGresult *res, int field_num)
return NULL;
}
if (res->attDescs)
- {
return res->attDescs[field_num].name;
- }
else
return NULL;
}
@@ -1304,9 +1296,7 @@ PQftype(PGresult *res, int field_num)
return InvalidOid;
}
if (res->attDescs)
- {
return res->attDescs[field_num].adtid;
- }
else
return InvalidOid;
}
@@ -1328,9 +1318,7 @@ PQfsize(PGresult *res, int field_num)
return 0;
}
if (res->attDescs)
- {
return res->attDescs[field_num].adtsize;
- }
else
return 0;
}
@@ -1352,9 +1340,7 @@ PQfmod(PGresult *res, int field_num)
return 0;
}
if (res->attDescs)
- {
return res->attDescs[field_num].adtmod;
- }
else
return 0;
}
diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 126a704b32c..d18a4d53c15 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.12 1998/05/12 21:44:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.13 1998/06/15 19:30:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -51,9 +51,7 @@ lo_open(PGconn *conn, Oid lobjId, int mode)
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
- {
return -1;
- }
}
res = PQfn(conn, conn->lobjfuncs->fn_lo_open, &fd, &result_len, 1, argv, 2);
@@ -89,9 +87,7 @@ lo_close(PGconn *conn, int fd)
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
- {
return -1;
- }
}
argv[0].isint = 1;
@@ -126,9 +122,7 @@ lo_read(PGconn *conn, int fd, char *buf, int len)
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
- {
return -1;
- }
}
argv[0].isint = 1;
@@ -166,9 +160,7 @@ lo_write(PGconn *conn, int fd, char *buf, int len)
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
- {
return -1;
- }
}
if (len <= 0)
@@ -211,9 +203,7 @@ lo_lseek(PGconn *conn, int fd, int offset, int whence)
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
- {
return -1;
- }
}
argv[0].isint = 1;
@@ -259,9 +249,7 @@ lo_creat(PGconn *conn, int mode)
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
- {
return -1;
- }
}
argv[0].isint = 1;
@@ -296,9 +284,7 @@ lo_tell(PGconn *conn, int fd)
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
- {
return -1;
- }
}
argv[0].isint = 1;
@@ -333,9 +319,7 @@ lo_unlink(PGconn *conn, Oid lobjId)
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
{
if (lo_initialize(conn) < 0)
- {
return -1;
- }
}
argv[0].isint = 1;
@@ -546,37 +530,21 @@ lo_initialize(PGconn *conn)
fname = PQgetvalue(res, n, 0);
foid = (Oid) atoi(PQgetvalue(res, n, 1));
if (!strcmp(fname, "lo_open"))
- {
lobjfuncs->fn_lo_open = foid;
- }
else if (!strcmp(fname, "lo_close"))
- {
lobjfuncs->fn_lo_close = foid;
- }
else if (!strcmp(fname, "lo_creat"))
- {
lobjfuncs->fn_lo_creat = foid;
- }
else if (!strcmp(fname, "lo_unlink"))
- {
lobjfuncs->fn_lo_unlink = foid;
- }
else if (!strcmp(fname, "lo_lseek"))
- {
lobjfuncs->fn_lo_lseek = foid;
- }
else if (!strcmp(fname, "lo_tell"))
- {
lobjfuncs->fn_lo_tell = foid;
- }
else if (!strcmp(fname, "loread"))
- {
lobjfuncs->fn_lo_read = foid;
- }
else if (!strcmp(fname, "lowrite"))
- {
lobjfuncs->fn_lo_write = foid;
- }
}
PQclear(res);
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c
index bbe112d2ef7..e79460798d9 100644
--- a/src/interfaces/libpq/fe-misc.c
+++ b/src/interfaces/libpq/fe-misc.c
@@ -24,7 +24,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.14 1998/05/12 15:42:09 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.15 1998/06/15 19:30:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -316,9 +316,7 @@ pqReadData(PGconn *conn)
conn->inStart = 0;
}
else
- {
conn->inStart = conn->inCursor = conn->inEnd = 0;
- }
/* If the buffer is fairly full, enlarge it.
* We need to be able to enlarge the buffer in case a single message
* exceeds the initial buffer size. We enlarge before filling the
diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c
index 5b86f950959..493b37d0a3e 100644
--- a/src/interfaces/libpq/fe-print.c
+++ b/src/interfaces/libpq/fe-print.c
@@ -9,7 +9,7 @@
* didn't really belong there.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.2 1998/05/07 16:17:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.3 1998/06/15 19:30:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -327,9 +327,7 @@ PQdisplayTuples(PGresult *res,
/* Zero the initial field lengths */
for (j = 0; j < nFields; j++)
- {
fLength[j] = strlen(PQfname(res, j));
- }
/* Find the max length of each field in the result */
/* will be somewhat time consuming for very large results */
if (fillAlign)
@@ -415,9 +413,7 @@ PQprintTuples(PGresult *res,
nTups = PQntuples(res);
if (colWidth > 0)
- {
sprintf(formatString, "%%s %%-%ds", colWidth);
- }
else
sprintf(formatString, "%%s %%s");
diff --git a/src/interfaces/libpq/pqsignal.c b/src/interfaces/libpq/pqsignal.c
index 3a43271be0d..815c00f343d 100644
--- a/src/interfaces/libpq/pqsignal.c
+++ b/src/interfaces/libpq/pqsignal.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.5 1997/09/08 02:40:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/pqsignal.c,v 1.6 1998/06/15 19:30:26 momjian Exp $
*
* NOTES
* This shouldn't be in libpq, but the monitor and some other
@@ -35,9 +35,7 @@ pqsignal(int signo, pqsigfunc func)
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
if (signo != SIGALRM)
- {
act.sa_flags |= SA_RESTART;
- }
if (sigaction(signo, &act, &oact) < 0)
return (SIG_ERR);
return (oact.sa_handler);
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index 8a01e6509a0..751a243b407 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -3,7 +3,7 @@
* procedural language (PL)
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.2 1998/02/26 04:46:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.3 1998/06/15 19:30:27 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -302,14 +302,10 @@ pltcl_init_safe_interp(void)
* Try to load the unknown procedure from pltcl_modules
************************************************************/
if (SPI_connect() != SPI_OK_CONNECT)
- {
elog(ERROR, "pltcl_init_safe_interp(): SPI_connect failed");
- }
pltcl_init_load_unknown();
if (SPI_finish() != SPI_OK_FINISH)
- {
elog(ERROR, "pltcl_init_safe_interp(): SPI_finish failed");
- }
#endif /* PLTCL_UNKNOWN_SUPPORT */
}
@@ -336,13 +332,9 @@ pltcl_init_load_unknown(void)
spi_rc = SPI_exec("select 1 from pg_class "
"where relname = 'pltcl_modules'", 1);
if (spi_rc != SPI_OK_SELECT)
- {
elog(ERROR, "pltcl_init_load_unknown(): select from pg_class failed");
- }
if (SPI_processed == 0)
- {
return;
- }
/************************************************************
* Read all the row's from it where modname = 'unknown' in
@@ -411,17 +403,13 @@ pltcl_call_handler(FmgrInfo *proinfo,
* Initialize interpreters on first call
************************************************************/
if (pltcl_firstcall)
- {
pltcl_init_all();
- }
/************************************************************
* Connect to SPI manager
************************************************************/
if (SPI_connect() != SPI_OK_CONNECT)
- {
elog(ERROR, "pltcl: cannot connect to SPI manager");
- }
/************************************************************
* Keep track about the nesting of Tcl-SPI-Tcl-... calls
************************************************************/
@@ -432,13 +420,9 @@ pltcl_call_handler(FmgrInfo *proinfo,
* call appropriate subhandler
************************************************************/
if (CurrentTriggerData == NULL)
- {
retval = pltcl_func_handler(proinfo, proargs, isNull);
- }
else
- {
retval = (Datum) pltcl_trigger_handler(proinfo);
- }
pltcl_call_level--;
@@ -446,9 +430,7 @@ pltcl_call_handler(FmgrInfo *proinfo,
* Disconnect from SPI manager
************************************************************/
if (SPI_finish() != SPI_OK_FINISH)
- {
elog(ERROR, "pltcl: SPI_finish() failed");
- }
return retval;
}
@@ -576,26 +558,20 @@ pltcl_func_handler(FmgrInfo *proinfo,
{
prodesc->arg_is_rel[i] = 1;
if (i > 0)
- {
strcat(proc_internal_args, " ");
- }
sprintf(buf, "__PLTcl_Tup_%d", i + 1);
strcat(proc_internal_args, buf);
continue;
}
else
- {
prodesc->arg_is_rel[i] = 0;
- }
fmgr_info(typeStruct->typoutput, &(prodesc->arg_out_func[i]));
prodesc->arg_out_elem[i] = (Oid) (typeStruct->typelem);
prodesc->arg_out_len[i] = typeStruct->typlen;
if (i > 0)
- {
strcat(proc_internal_args, " ");
- }
sprintf(buf, "%d", i + 1);
strcat(proc_internal_args, buf);
}
@@ -680,9 +656,7 @@ pltcl_func_handler(FmgrInfo *proinfo,
Tcl_DStringFree(&list_tmp);
pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0)
- {
pltcl_restart_in_progress = 0;
- }
siglongjmp(Warn_restart, 1);
}
@@ -742,15 +716,11 @@ pltcl_func_handler(FmgrInfo *proinfo,
{
pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0)
- {
pltcl_restart_in_progress = 0;
- }
elog(ERROR, "pltcl: %s", pltcl_safe_interp->result);
}
if (--pltcl_call_level == 0)
- {
pltcl_restart_in_progress = 0;
- }
siglongjmp(Warn_restart, 1);
}
@@ -766,9 +736,7 @@ pltcl_func_handler(FmgrInfo *proinfo,
memcpy(&Warn_restart, &save_restart, sizeof(Warn_restart));
pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0)
- {
pltcl_restart_in_progress = 0;
- }
siglongjmp(Warn_restart, 1);
}
@@ -956,9 +924,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
Tcl_DStringFree(&tcl_newtup);
pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0)
- {
pltcl_restart_in_progress = 0;
- }
siglongjmp(Warn_restart, 1);
}
@@ -976,40 +942,26 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
/* A list of attribute names for argument TG_relatts */
Tcl_DStringAppendElement(&tcl_trigtup, "");
for (i = 0; i < tupdesc->natts; i++)
- {
Tcl_DStringAppendElement(&tcl_trigtup, tupdesc->attrs[i]->attname.data);
- }
Tcl_DStringAppendElement(&tcl_cmd, Tcl_DStringValue(&tcl_trigtup));
Tcl_DStringFree(&tcl_trigtup);
Tcl_DStringInit(&tcl_trigtup);
/* The when part of the event for TG_when */
if (TRIGGER_FIRED_BEFORE(trigdata->tg_event))
- {
Tcl_DStringAppendElement(&tcl_cmd, "BEFORE");
- }
else if (TRIGGER_FIRED_AFTER(trigdata->tg_event))
- {
Tcl_DStringAppendElement(&tcl_cmd, "AFTER");
- }
else
- {
Tcl_DStringAppendElement(&tcl_cmd, "UNKNOWN");
- }
/* The level part of the event for TG_level */
if (TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))
- {
Tcl_DStringAppendElement(&tcl_cmd, "ROW");
- }
else if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event))
- {
Tcl_DStringAppendElement(&tcl_cmd, "STATEMENT");
- }
else
- {
Tcl_DStringAppendElement(&tcl_cmd, "UNKNOWN");
- }
/* Build the data list for the trigtuple */
pltcl_build_tuple_argument(trigdata->tg_trigtuple,
@@ -1067,9 +1019,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
* Finally append the arguments from CREATE TRIGGER
************************************************************/
for (i = 0; i < trigdata->tg_trigger->tgnargs; i++)
- {
Tcl_DStringAppendElement(&tcl_cmd, trigdata->tg_trigger->tgargs[i]);
- }
/************************************************************
* Call the Tcl function
@@ -1089,15 +1039,11 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
{
pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0)
- {
pltcl_restart_in_progress = 0;
- }
elog(ERROR, "pltcl: %s", pltcl_safe_interp->result);
}
if (--pltcl_call_level == 0)
- {
pltcl_restart_in_progress = 0;
- }
siglongjmp(Warn_restart, 1);
}
@@ -1115,9 +1061,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
* the magic strings OK or SKIP or a list from array get
************************************************************/
if (strcmp(pltcl_safe_interp->result, "OK") == 0)
- {
return rettup;
- }
if (strcmp(pltcl_safe_interp->result, "SKIP") == 0)
{
return (HeapTuple) NULL;;
@@ -1161,9 +1105,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
ckfree(ret_values);
pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0)
- {
pltcl_restart_in_progress = 0;
- }
siglongjmp(Warn_restart, 1);
}
@@ -1190,9 +1132,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
************************************************************/
attnum = SPI_fnumber(tupdesc, ret_values[i++]);
if (attnum == SPI_ERROR_NOATTRIBUTE)
- {
elog(ERROR, "pltcl: invalid attribute '%s'", ret_values[--i]);
- }
/************************************************************
* Lookup the attribute type in the syscache
@@ -1233,9 +1173,7 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
pfree(modnulls);
if (rettup == NULL)
- {
elog(ERROR, "pltcl: SPI_modifytuple() failed - RC = %d\n", SPI_result);
- }
ckfree(ret_values);
memcpy(&Warn_restart, &save_restart, sizeof(Warn_restart));
@@ -1280,29 +1218,17 @@ pltcl_elog(ClientData cdata, Tcl_Interp * interp,
}
if (strcmp(argv[1], "NOTICE") == 0)
- {
level = NOTICE;
- }
else if (strcmp(argv[1], "WARN") == 0)
- {
level = ERROR;
- }
else if (strcmp(argv[1], "ERROR") == 0)
- {
level = ERROR;
- }
else if (strcmp(argv[1], "FATAL") == 0)
- {
level = FATAL;
- }
else if (strcmp(argv[1], "DEBUG") == 0)
- {
level = DEBUG;
- }
else if (strcmp(argv[1], "NOIND") == 0)
- {
level = NOIND;
- }
else
{
Tcl_AppendResult(interp, "Unknown elog level '", argv[1],
@@ -1356,15 +1282,11 @@ pltcl_quote(ClientData cdata, Tcl_Interp * interp,
while (*cp1)
{
if (*cp1 == '\'')
- {
*cp2++ = '\'';
- }
else
{
if (*cp1 == '\\')
- {
*cp2++ = '\\';
- }
}
*cp2++ = *cp1++;
}
@@ -1440,9 +1362,7 @@ pltcl_SPI_exec(ClientData cdata, Tcl_Interp * interp,
return TCL_ERROR;
}
if (Tcl_GetInt(interp, argv[i++], &count) != TCL_OK)
- {
return TCL_ERROR;
- }
continue;
}
@@ -1566,9 +1486,7 @@ pltcl_SPI_exec(ClientData cdata, Tcl_Interp * interp,
if (argc == query_idx + 1)
{
if (ntuples > 0)
- {
pltcl_set_tuple_values(interp, arrayname, 0, tuples[0], tupdesc);
- }
sprintf(buf, "%d", ntuples);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
memcpy(&Warn_restart, &save_restart, sizeof(Warn_restart));
@@ -1653,9 +1571,7 @@ pltcl_SPI_prepare(ClientData cdata, Tcl_Interp * interp,
* Split the argument type list
************************************************************/
if (Tcl_SplitList(interp, argv[2], &nargs, &args) != TCL_OK)
- {
return TCL_ERROR;
- }
/************************************************************
* Allocate the new querydesc structure
@@ -1698,9 +1614,7 @@ pltcl_SPI_prepare(ClientData cdata, Tcl_Interp * interp,
PointerGetDatum(args[i]),
0, 0, 0);
if (!HeapTupleIsValid(typeTup))
- {
elog(ERROR, "pltcl: Cache lookup of type %s failed", args[i]);
- }
qdesc->argtypes[i] = typeTup->t_oid;
fmgr_info(((TypeTupleForm) GETSTRUCT(typeTup))->typinput,
&(qdesc->arginfuncs[i]));
@@ -1879,9 +1793,7 @@ pltcl_SPI_execp(ClientData cdata, Tcl_Interp * interp,
return TCL_ERROR;
}
if (Tcl_GetInt(interp, argv[i++], &count) != TCL_OK)
- {
return TCL_ERROR;
- }
continue;
}
@@ -1938,9 +1850,7 @@ pltcl_SPI_execp(ClientData cdata, Tcl_Interp * interp,
* Split the argument values
************************************************************/
if (Tcl_SplitList(interp, argv[i++], &callnargs, &callargs) != TCL_OK)
- {
return TCL_ERROR;
- }
/************************************************************
* Check that the # of arguments matches
@@ -2003,9 +1913,7 @@ pltcl_SPI_execp(ClientData cdata, Tcl_Interp * interp,
callargs = NULL;
}
else
- {
callnargs = 0;
- }
/************************************************************
* Remember the index of the last processed call
@@ -2149,9 +2057,7 @@ pltcl_SPI_execp(ClientData cdata, Tcl_Interp * interp,
if (loop_body >= argc)
{
if (ntuples > 0)
- {
pltcl_set_tuple_values(interp, arrayname, 0, tuples[0], tupdesc);
- }
memcpy(&Warn_restart, &save_restart, sizeof(Warn_restart));
sprintf(buf, "%d", ntuples);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
@@ -2283,9 +2189,7 @@ pltcl_set_tuple_values(Tcl_Interp * interp, char *arrayname,
pfree(outputstr);
}
else
- {
Tcl_UnsetVar2(interp, *arrptr, *nameptr, 0);
- }
}
}
diff --git a/src/test/examples/testlibpq.c b/src/test/examples/testlibpq.c
index 84973df807f..fc75467e475 100644
--- a/src/test/examples/testlibpq.c
+++ b/src/test/examples/testlibpq.c
@@ -102,18 +102,14 @@ main()
/* first, print out the attribute names */
nFields = PQnfields(res);
for (i = 0; i < nFields; i++)
- {
printf("%-15s", PQfname(res, i));
- }
printf("\n\n");
/* next, print out the instances */
for (i = 0; i < PQntuples(res); i++)
{
for (j = 0; j < nFields; j++)
- {
printf("%-15s", PQgetvalue(res, i, j));
- }
printf("\n");
}
diff --git a/src/test/examples/testlibpq4.c b/src/test/examples/testlibpq4.c
index 2cbe622f9b4..e497e7a8fb9 100644
--- a/src/test/examples/testlibpq4.c
+++ b/src/test/examples/testlibpq4.c
@@ -121,18 +121,14 @@ main(int argc, char **argv)
/* first, print out the attribute names */
nFields = PQnfields(res1);
for (i = 0; i < nFields; i++)
- {
printf("%-15s", PQfname(res1, i));
- }
printf("\n\n");
/* next, print out the instances */
for (i = 0; i < PQntuples(res1); i++)
{
for (j = 0; j < nFields; j++)
- {
printf("%-15s", PQgetvalue(res1, i, j));
- }
printf("\n");
}
diff --git a/src/test/examples/testlo.c b/src/test/examples/testlo.c
index 8c18a2463c8..73841d47782 100644
--- a/src/test/examples/testlo.c
+++ b/src/test/examples/testlo.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/test/examples/testlo.c,v 1.8 1998/05/12 21:44:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/test/examples/testlo.c,v 1.9 1998/06/15 19:30:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,9 +53,7 @@ importFile(PGconn *conn, char *filename)
*/
lobjId = lo_creat(conn, INV_READ | INV_WRITE);
if (lobjId == 0)
- {
fprintf(stderr, "can't create large object");
- }
lobj_fd = lo_open(conn, lobjId, INV_WRITE);
@@ -66,9 +64,7 @@ importFile(PGconn *conn, char *filename)
{
tmp = lo_write(conn, lobj_fd, buf, nbytes);
if (tmp < nbytes)
- {
fprintf(stderr, "error while reading \"%s\"", filename);
- }
}
close(fd);
@@ -241,9 +237,7 @@ main(int argc, char **argv)
/* lobjOid = importFile(conn, in_filename); */
lobjOid = lo_import(conn, in_filename);
if (lobjOid == 0)
- {
fprintf(stderr, "%s\n", PQerrorMessage(conn));
- }
/*
printf("\tas large object %d.\n", lobjOid);
@@ -257,9 +251,7 @@ main(int argc, char **argv)
printf("exporting large object to file \"%s\" ...\n", out_filename);
/* exportFile(conn, lobjOid, out_filename); */
if (!lo_export(conn, lobjOid, out_filename))
- {
fprintf(stderr, "%s\n", PQerrorMessage(conn));
- }
res = PQexec(conn, "end");
PQclear(res);
diff --git a/src/test/examples/testlo2.c b/src/test/examples/testlo2.c
index 31607ba0f17..b00ee9c5099 100644
--- a/src/test/examples/testlo2.c
+++ b/src/test/examples/testlo2.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/test/examples/Attic/testlo2.c,v 1.7 1998/05/12 21:44:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/test/examples/Attic/testlo2.c,v 1.8 1998/06/15 19:30:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -49,9 +49,7 @@ importFile(PGconn *conn, char *filename)
*/
lobjId = lo_creat(conn, INV_READ | INV_WRITE);
if (lobjId == 0)
- {
fprintf(stderr, "can't create large object");
- }
lobj_fd = lo_open(conn, lobjId, INV_WRITE);
@@ -62,9 +60,7 @@ importFile(PGconn *conn, char *filename)
{
tmp = lo_write(conn, lobj_fd, buf, nbytes);
if (tmp < nbytes)
- {
fprintf(stderr, "error while reading \"%s\"", filename);
- }
}
close(fd);