1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-24 01:29:19 +03:00

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
This commit is contained in:
Tom Lane
2007-02-27 23:48:10 +00:00
parent 0459b591fc
commit 234a02b2a8
87 changed files with 483 additions and 498 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/access/htup.h,v 1.91 2007/02/09 03:35:34 tgl Exp $
* $PostgreSQL: pgsql/src/include/access/htup.h,v 1.92 2007/02/27 23:48:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -115,7 +115,7 @@ typedef struct HeapTupleFields
typedef struct DatumTupleFields
{
int32 datum_len; /* required to be a varlena type */
int32 datum_len_; /* varlena header (do not touch directly!) */
int32 datum_typmod; /* -1, or identifier of a record type */
@@ -260,14 +260,10 @@ do { \
} while (0)
#define HeapTupleHeaderGetDatumLength(tup) \
( \
(tup)->t_choice.t_datum.datum_len \
)
VARSIZE(tup)
#define HeapTupleHeaderSetDatumLength(tup, len) \
( \
(tup)->t_choice.t_datum.datum_len = (len) \
)
SET_VARSIZE(tup, len)
#define HeapTupleHeaderGetTypeId(tup) \
( \