aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/large_object/inv_api.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-02-27 23:48:10 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-02-27 23:48:10 +0000
commit234a02b2a888cacc4c09363cc1411ae4eac9bb51 (patch)
tree4aadb74b5d7bbcfc3cdae9c8703eac168d6108ae /src/backend/storage/large_object/inv_api.c
parent0459b591fc90b197ed31923b170c658cc30758d5 (diff)
downloadpostgresql-234a02b2a888cacc4c09363cc1411ae4eac9bb51.tar.gz
postgresql-234a02b2a888cacc4c09363cc1411ae4eac9bb51.zip
Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len).
Get rid of VARATT_SIZE and VARATT_DATA, which were simply redundant with VARSIZE and VARDATA, and as a consequence almost no code was using the longer names. Rename the length fields of struct varlena and various derived structures to catch anyplace that was accessing them directly; and clean up various places so caught. In itself this patch doesn't change any behavior at all, but it is necessary infrastructure if we hope to play any games with the representation of varlena headers. Greg Stark and Tom Lane
Diffstat (limited to 'src/backend/storage/large_object/inv_api.c')
-rw-r--r--src/backend/storage/large_object/inv_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c
index b787c6a3caf..9e033c436c9 100644
--- a/src/backend/storage/large_object/inv_api.c
+++ b/src/backend/storage/large_object/inv_api.c
@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/large_object/inv_api.c,v 1.121 2007/01/05 22:19:38 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/large_object/inv_api.c,v 1.122 2007/02/27 23:48:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -507,7 +507,7 @@ inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes)
bytea hdr;
char data[LOBLKSIZE];
} workbuf;
- char *workb = VARATT_DATA(&workbuf.hdr);
+ char *workb = VARDATA(&workbuf.hdr);
HeapTuple newtup;
Datum values[Natts_pg_largeobject];
char nulls[Natts_pg_largeobject];
@@ -607,7 +607,7 @@ inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes)
off += n;
/* compute valid length of new page */
len = (len >= off) ? len : off;
- VARATT_SIZEP(&workbuf.hdr) = len + VARHDRSZ;
+ SET_VARSIZE(&workbuf.hdr, len + VARHDRSZ);
/*
* Form and insert updated tuple
@@ -651,7 +651,7 @@ inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes)
obj_desc->offset += n;
/* compute valid length of new page */
len = off + n;
- VARATT_SIZEP(&workbuf.hdr) = len + VARHDRSZ;
+ SET_VARSIZE(&workbuf.hdr, len + VARHDRSZ);
/*
* Form and insert updated tuple