From: Tomas Vondra Date: Tue, 23 Aug 2016 08:45:16 +0000 (+0200) Subject: simplify slot_deform_datarow by using VARSIZE_ANY X-Git-Tag: XL9_5_R1_4~43 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=c1e248680f300a9c93627f6c9a4b285c4ab7eb75;p=postgres-xl.git simplify slot_deform_datarow by using VARSIZE_ANY Replace the slightly complex branching with VARSIZE_ANY, which does exactly the same thing. Also, ditch the pointless '#ifdef PGXC' around the function. --- diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index ffc48bd8b1..49560f2a8b 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -1198,7 +1198,6 @@ slot_deform_tuple(TupleTableSlot *slot, int natts) slot->tts_slow = slow; } -#ifdef PGXC /* * slot_deform_datarow * Extract data from the DataRow message into Datum/isnull arrays. @@ -1304,14 +1303,7 @@ slot_deform_datarow(TupleTableSlot *slot) if (attr->attlen == -1) { /* varlena */ - if (VARATT_IS_EXTERNAL(val)) - /* no alignment, since it's short by definition */ - data_length = VARSIZE_EXTERNAL(val); - else if (VARATT_IS_SHORT(val)) - /* no alignment for short varlenas */ - data_length = VARSIZE_SHORT(val); - else - data_length = VARSIZE(val); + data_length = VARSIZE_ANY(val); } else if (attr->attlen == -2) { @@ -1338,7 +1330,6 @@ slot_deform_datarow(TupleTableSlot *slot) slot->tts_nvalid = attnum; } -#endif /* * slot_getattr