aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/common/heaptuple.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-10-19 22:30:30 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-10-19 22:30:30 +0000
commitd9cb48786ee84c27dc20e3aed92bb1f1cadf95c3 (patch)
tree069d205641f6a635e6e438d2741801cf0e826f3a /src/backend/access/common/heaptuple.c
parent07908c9c370ee0715f8e1dfe0c17fbba335003c6 (diff)
downloadpostgresql-d9cb48786ee84c27dc20e3aed92bb1f1cadf95c3.tar.gz
postgresql-d9cb48786ee84c27dc20e3aed92bb1f1cadf95c3.zip
Better solution to the problem of labeling whole-row Datums that are
generated from subquery outputs: use the type info stored in the Var itself. To avoid making ExecEvalVar and slot_getattr more complex and slower, I split out the whole-row case into a separate ExecEval routine.
Diffstat (limited to 'src/backend/access/common/heaptuple.c')
-rw-r--r--src/backend/access/common/heaptuple.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index fc0a85d2ddd..5551f744bb2 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.101 2005/10/19 18:18:32 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.102 2005/10/19 22:30:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,7 +27,6 @@
#include "access/tuptoaster.h"
#include "catalog/pg_type.h"
#include "executor/tuptable.h"
-#include "utils/typcache.h"
/* ----------------------------------------------------------------
@@ -595,38 +594,6 @@ heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
case TableOidAttributeNumber:
result = ObjectIdGetDatum(tup->t_tableOid);
break;
-
- /*
- * If the attribute number is 0, then we are supposed to return
- * the entire tuple as a row-type Datum. (Using zero for this
- * purpose is unclean since it risks confusion with "invalid attr"
- * result codes, but it's not worth changing now.)
- *
- * We have to make a copy of the tuple so we can safely insert the
- * Datum overhead fields, which are not set in on-disk tuples.
- *
- * It's possible that the passed tupleDesc is a record type that
- * hasn't been "blessed" yet, so cover that case.
- */
- case InvalidAttrNumber:
- {
- HeapTupleHeader dtup;
-
- if (tupleDesc->tdtypeid == RECORDOID &&
- tupleDesc->tdtypmod < 0)
- assign_record_type_typmod(tupleDesc);
-
- dtup = (HeapTupleHeader) palloc(tup->t_len);
- memcpy((char *) dtup, (char *) tup->t_data, tup->t_len);
-
- HeapTupleHeaderSetDatumLength(dtup, tup->t_len);
- HeapTupleHeaderSetTypeId(dtup, tupleDesc->tdtypeid);
- HeapTupleHeaderSetTypMod(dtup, tupleDesc->tdtypmod);
-
- result = PointerGetDatum(dtup);
- }
- break;
-
default:
elog(ERROR, "invalid attnum: %d", attnum);
result = 0; /* keep compiler quiet */