summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2003-05-26 17:51:38 +0000
committerTom Lane2003-05-26 17:51:38 +0000
commit8c43300cccb626bae3ca84f4ae89c051f81190bb (patch)
tree3078ccc0f70aab150eddc547ca9dc637b50d55cc
parentb71a48990a57647025780363e01b66c0ef8198b5 (diff)
Make sure printtup() always sends the number of columns previously
advertised in RowDescription message. Depending on the physical tuple's column count is not really correct, since according to heap_getattr() conventions the tuple may be short some columns, which will automatically get read as nulls. Problem has been latent since forever, but was only exposed by recent change to skip a projection step in SELECT * FROM...
-rw-r--r--src/backend/access/common/printtup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c
index 1d2c6cc4f0a..29ed33c9f61 100644
--- a/src/backend/access/common/printtup.c
+++ b/src/backend/access/common/printtup.c
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.73 2003/05/13 18:39:50 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.74 2003/05/26 17:51:38 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -286,7 +286,7 @@ printtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
{
DR_printtup *myState = (DR_printtup *) self;
StringInfoData buf;
- int natts = tuple->t_data->t_natts;
+ int natts = typeinfo->natts;
int i;
/* Set or update my derived attribute info, if needed */
@@ -370,7 +370,7 @@ printtup_20(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
{
DR_printtup *myState = (DR_printtup *) self;
StringInfoData buf;
- int natts = tuple->t_data->t_natts;
+ int natts = typeinfo->natts;
int i,
j,
k;
@@ -517,7 +517,7 @@ debugStartup(DestReceiver *self, int operation, TupleDesc typeinfo)
void
debugtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
{
- int natts = tuple->t_data->t_natts;
+ int natts = typeinfo->natts;
int i;
Datum origattr,
attr;
@@ -573,7 +573,7 @@ printtup_internal_20(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
{
DR_printtup *myState = (DR_printtup *) self;
StringInfoData buf;
- int natts = tuple->t_data->t_natts;
+ int natts = typeinfo->natts;
int i,
j,
k;