1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +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

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.214 2007/02/27 01:11:25 tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.215 2007/02/27 23:48:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2533,7 +2533,7 @@ ExecEvalArray(ArrayExprState *astate, ExprContext *econtext,
}
result = (ArrayType *) palloc(nbytes);
result->size = nbytes;
SET_VARSIZE(result, nbytes);
result->ndim = ndims;
result->dataoffset = dataoffset;
result->elemtype = element_type;
@ -2967,7 +2967,7 @@ ExecEvalXml(XmlExprState *xmlExpr, ExprContext *econtext,
int len = buf.len + VARHDRSZ;
result = palloc(len);
VARATT_SIZEP(result) = len;
SET_VARSIZE(result, len);
memcpy(VARDATA(result), buf.data, buf.len);
}