aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/common/heaptuple.c32
-rw-r--r--src/backend/access/common/indextuple.c5
-rw-r--r--src/backend/access/gist/gistscan.c2
-rw-r--r--src/backend/access/hash/hashscan.c4
-rw-r--r--src/backend/access/heap/hio.c4
-rw-r--r--src/backend/access/index/istrat.c10
-rw-r--r--src/backend/access/nbtree/nbtinsert.c4
-rw-r--r--src/backend/access/nbtree/nbtscan.c4
-rw-r--r--src/backend/access/nbtree/nbtsort.c4
-rw-r--r--src/backend/access/rtree/rtscan.c4
10 files changed, 37 insertions, 36 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 469a5ba252a..998ce5a457c 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.59 1999/12/16 22:19:34 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.60 2000/01/15 02:59:17 petere Exp $
*
* NOTES
* The old interface functions have been converted to macros
@@ -136,8 +136,9 @@ DataFill(char *data,
*((int32 *) value[i]));
break;
default:
- memmove(data, DatumGetPointer(value[i]),
- att[i]->attlen);
+ Assert(att[i]->attlen >= 0);
+ memmove(data, DatumGetPointer(value[i]),
+ (size_t)(att[i]->attlen));
break;
}
data = (char *) att_addlength((long) data, att[i]->attlen, value[i]);
@@ -324,8 +325,8 @@ nocachegetattr(HeapTuple tuple,
Form_pg_attribute *att = tupleDesc->attrs;
int slow = 0; /* do we have to walk nulls? */
-
-#if IN_MACRO
+ (void)isnull; /*not used*/
+#ifdef IN_MACRO
/* This is handled in the macro */
Assert(attnum > 0);
@@ -346,7 +347,7 @@ nocachegetattr(HeapTuple tuple,
if (HeapTupleNoNulls(tuple))
{
-#if IN_MACRO
+#ifdef IN_MACRO
/* This is handled in the macro */
if (att[attnum]->attcacheoff != -1)
{
@@ -376,7 +377,7 @@ nocachegetattr(HeapTuple tuple,
* ----------------
*/
-#if IN_MACRO
+#ifdef IN_MACRO
/* This is handled in the macro */
if (att_isnull(attnum, bp))
{
@@ -565,7 +566,7 @@ heap_copytuple(HeapTuple tuple)
newTuple->t_datamcxt = CurrentMemoryContext;
newTuple->t_data = (HeapTupleHeader) ((char *) newTuple + HEAPTUPLESIZE);
memmove((char *) newTuple->t_data,
- (char *) tuple->t_data, (int) tuple->t_len);
+ (char *) tuple->t_data, tuple->t_len);
return newTuple;
}
@@ -589,7 +590,7 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
dest->t_datamcxt = CurrentMemoryContext;
dest->t_data = (HeapTupleHeader) palloc(src->t_len);
memmove((char *) dest->t_data,
- (char *) src->t_data, (int) src->t_len);
+ (char *) src->t_data, src->t_len);
return;
}
@@ -655,7 +656,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
HeapTuple tuple; /* return tuple */
HeapTupleHeader td; /* tuple data */
int bitmaplen;
- long len;
+ unsigned long len;
int hoff;
bool hasnull = false;
int i;
@@ -687,7 +688,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
tuple->t_datamcxt = CurrentMemoryContext;
td = tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
- MemSet((char *) td, 0, (int) len);
+ MemSet((char *) td, 0, len);
tuple->t_len = len;
ItemPointerSetInvalid(&(tuple->t_self));
@@ -803,8 +804,6 @@ heap_modifytuple(HeapTuple tuple,
void
heap_freetuple(HeapTuple htup)
{
- extern int getpid();
-
if (htup->t_data != NULL)
if (htup->t_datamcxt != NULL && (char *)(htup->t_data) !=
((char *) htup + HEAPTUPLESIZE))
@@ -828,7 +827,7 @@ heap_addheader(uint32 natts, /* max domain index */
{
HeapTuple tuple;
HeapTupleHeader td; /* tuple data */
- long len;
+ unsigned long len;
int hoff;
AssertArg(natts > 0);
@@ -841,7 +840,7 @@ heap_addheader(uint32 natts, /* max domain index */
tuple->t_datamcxt = CurrentMemoryContext;
td = tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
- MemSet((char *) td, 0, (int) len);
+ MemSet((char *) td, 0, len);
tuple->t_len = len;
ItemPointerSetInvalid(&(tuple->t_self));
@@ -850,7 +849,8 @@ heap_addheader(uint32 natts, /* max domain index */
td->t_infomask = 0;
td->t_infomask |= HEAP_XMAX_INVALID;
- memmove((char *) td + hoff, structure, structlen);
+ if (structlen > 0)
+ memmove((char *) td + hoff, structure, (size_t)structlen);
return tuple;
}
diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c
index 9a096e8930b..694aeca33fe 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.40 2000/01/11 03:33:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.41 2000/01/15 02:59:17 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -63,7 +63,7 @@ index_formtuple(TupleDesc tupleDescriptor,
tp = (char *) palloc(size);
tuple = (IndexTuple) tp;
- MemSet(tp, 0, (int) size);
+ MemSet(tp, 0, size);
DataFill((char *) tp + hoff,
tupleDescriptor,
@@ -133,6 +133,7 @@ nocache_index_getattr(IndexTuple tup,
int data_off; /* tuple data offset */
Form_pg_attribute *att = tupleDesc->attrs;
+ (void)isnull;
/* ----------------
* sanity checks
* ----------------
diff --git a/src/backend/access/gist/gistscan.c b/src/backend/access/gist/gistscan.c
index e7a864985a4..a7d1faf43db 100644
--- a/src/backend/access/gist/gistscan.c
+++ b/src/backend/access/gist/gistscan.c
@@ -266,7 +266,7 @@ gistdropscan(IndexScanDesc s)
prev = l;
if (l == (GISTScanList) NULL)
- elog(ERROR, "GiST scan list corrupted -- cannot find 0x%lx", s);
+ elog(ERROR, "GiST scan list corrupted -- cannot find 0x%p", (void*)s);
if (prev == (GISTScanList) NULL)
GISTScans = l->gsl_next;
diff --git a/src/backend/access/hash/hashscan.c b/src/backend/access/hash/hashscan.c
index d3bd838bc12..7e7b38c90c9 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.20 1999/07/15 23:02:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.21 2000/01/15 02:59:19 petere Exp $
*
* NOTES
* Because we can be doing an index scan on a relation while we
@@ -74,7 +74,7 @@ _hash_dropscan(IndexScanDesc scan)
last = chk;
if (chk == (HashScanList) NULL)
- elog(ERROR, "hash scan list trashed; can't find 0x%lx", scan);
+ elog(ERROR, "hash scan list trashed; can't find 0x%p", (void*)scan);
if (last == (HashScanList) NULL)
HashScans = chk->hashsl_next;
diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c
index d21d219c10c..9edd35e72d0 100644
--- a/src/backend/access/heap/hio.c
+++ b/src/backend/access/heap/hio.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Id: hio.c,v 1.27 1999/11/29 04:34:55 tgl Exp $
+ * $Id: hio.c,v 1.28 2000/01/15 02:59:20 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -114,7 +114,7 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
* this code should go away eventually.
*/
if (len > MaxTupleSize)
- elog(ERROR, "Tuple is too big: size %d, max size %d",
+ elog(ERROR, "Tuple is too big: size %d, max size %ld",
len, MaxTupleSize);
/*
diff --git a/src/backend/access/index/istrat.c b/src/backend/access/index/istrat.c
index ee3477bedc1..7169e2ec66a 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.38 1999/11/22 17:55:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.39 2000/01/15 02:59:21 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -502,8 +502,8 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
{
if (IsBootstrapProcessingMode())
heap_endscan(scan);
- elog(ERROR, "OperatorObjectIdFillScanKeyEntry: unknown operator %lu",
- (uint32) operatorObjectId);
+ elog(ERROR, "OperatorObjectIdFillScanKeyEntry: unknown operator %u",
+ operatorObjectId);
}
entry->sk_flags = 0;
@@ -517,8 +517,8 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
if (!RegProcedureIsValid(entry->sk_procedure))
{
elog(ERROR,
- "OperatorObjectIdFillScanKeyEntry: no procedure for operator %lu",
- (uint32) operatorObjectId);
+ "OperatorObjectIdFillScanKeyEntry: no procedure for operator %u",
+ operatorObjectId);
}
}
diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c
index 57c57997e3c..dcbac83cf78 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.52 1999/12/26 03:48:22 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.53 2000/01/15 02:59:23 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -275,7 +275,7 @@ _bt_insertonpg(Relation rel,
* Note that at this point, itemsz doesn't include the ItemId.
*/
if (itemsz > (PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData))
- elog(ERROR, "btree: index item size %d exceeds maximum %d",
+ elog(ERROR, "btree: index item size %d exceeds maximum %ld",
itemsz,
(PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData));
diff --git a/src/backend/access/nbtree/nbtscan.c b/src/backend/access/nbtree/nbtscan.c
index f5c1f7b99f8..1b791db633a 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.28 1999/08/08 20:12:51 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.29 2000/01/15 02:59:23 petere Exp $
*
*
* NOTES
@@ -95,7 +95,7 @@ _bt_dropscan(IndexScanDesc scan)
last = chk;
if (chk == (BTScanList) NULL)
- elog(ERROR, "btree scan list trashed; can't find 0x%lx", scan);
+ elog(ERROR, "btree scan list trashed; can't find 0x%p", (void*)scan);
if (last == (BTScanList) NULL)
BTScans = chk->btsl_next;
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index fff65b7d79d..c1f9e5403de 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -27,7 +27,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.48 2000/01/08 21:24:49 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.49 2000/01/15 02:59:23 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -314,7 +314,7 @@ _bt_buildadd(Relation index, BTPageState *state, BTItem bti, int flags)
* But during creation of an index, we don't go through there.
*/
if (btisz > (PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData))
- elog(ERROR, "btree: index item size %d exceeds maximum %d",
+ elog(ERROR, "btree: index item size %d exceeds maximum %ld",
btisz,
(PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3 - sizeof(ItemIdData));
diff --git a/src/backend/access/rtree/rtscan.c b/src/backend/access/rtree/rtscan.c
index 30bf065d121..f34bf50ba57 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.29 1999/07/17 20:16:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.30 2000/01/15 02:59:25 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -267,7 +267,7 @@ rtdropscan(IndexScanDesc s)
prev = l;
if (l == (RTScanList) NULL)
- elog(ERROR, "rtree scan list corrupted -- cannot find 0x%lx", s);
+ elog(ERROR, "rtree scan list corrupted -- cannot find 0x%p", (void*)s);
if (prev == (RTScanList) NULL)
RTScans = l->rtsl_next;