mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +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:
@ -7,7 +7,7 @@
|
||||
*
|
||||
* Copyright (c) 1998-2007, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.23 2007/01/05 22:19:59 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/numeric.h,v 1.24 2007/02/27 23:48:10 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -62,7 +62,7 @@
|
||||
*/
|
||||
typedef struct NumericData
|
||||
{
|
||||
int32 varlen; /* Variable size (std varlena header) */
|
||||
int32 vl_len_; /* varlena header (do not touch directly!) */
|
||||
int16 n_weight; /* Weight of 1st digit */
|
||||
uint16 n_sign_dscale; /* Sign + display scale */
|
||||
char n_data[1]; /* Digits (really array of NumericDigit) */
|
||||
@ -70,7 +70,7 @@ typedef struct NumericData
|
||||
|
||||
typedef NumericData *Numeric;
|
||||
|
||||
#define NUMERIC_HDRSZ (sizeof(int32) + sizeof(int16) + sizeof(uint16))
|
||||
#define NUMERIC_HDRSZ (VARHDRSZ + sizeof(int16) + sizeof(uint16))
|
||||
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user