From: | Gregory Stark <stark(at)enterprisedb(dot)com> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Dead code? |
Date: | 2006-09-05 12:21:46 |
Message-ID: | 87r6yqh5b9.fsf@stark.enterprisedb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Is there anywhere we make use of this code that handles attlen == -2?
If so I'm curious where because I was thinking of doing something similar and
didn't realise we already had this capability. But I suspect it's just dead
code left over, possibly from the days before the Name data type?
/*
* att_addlength increments the given offset by the length of the attribute.
* attval is only accessed if we are dealing with a variable-length attribute.
*/
#define att_addlength(cur_offset, attlen, attval) \
( \
((attlen) > 0) ? \
( \
(cur_offset) + (attlen) \
) \
: (((attlen) == -1) ? \
( \
(cur_offset) + VARATT_SIZE(DatumGetPointer(attval)) \
) \
: \
( \
AssertMacro((attlen) == -2), \
(cur_offset) + (strlen(DatumGetCString(attval)) + 1) \
)) \
)
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2006-09-05 12:25:35 | Re: Dead code? |
Previous Message | Alvaro Herrera | 2006-09-05 12:01:22 | Re: Open items for 8.2 |