Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3067ac8

Browse files
committed
From: Massimo Dal Zotto <dz@cs.unitn.it>After some playing with gdb I found that in printtup() there is a non nullattribute with typeinfo->attrs[i]->atttypid = 0 (invalid oid). Unfortunatelyattibutes with invalid type are neither printed nor marked as null, and thisexplains why psql doesn't get all the expected data.So I made this patch to printtup():
1 parent3b7d13a commit3067ac8

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎src/backend/access/common/printtup.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.32 1998/08/19 02:00:54 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.33 1998/08/30 19:30:38 scrappy Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -123,9 +123,11 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
123123
for (i=0;i<tuple->t_natts;++i)
124124
{
125125
attr=heap_getattr(tuple,i+1,typeinfo,&isnull);
126-
typoutput=typtoout((Oid)typeinfo->attrs[i]->atttypid);
126+
if (isnull)
127+
continue;
127128

128-
if (!isnull&&OidIsValid(typoutput))
129+
typoutput=typtoout((Oid)typeinfo->attrs[i]->atttypid);
130+
if (OidIsValid(typoutput))
129131
{
130132
outputstr=fmgr(typoutput,attr,
131133
gettypelem(typeinfo->attrs[i]->atttypid),
@@ -140,6 +142,12 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
140142
#endif
141143
pfree(outputstr);
142144
}
145+
else
146+
{
147+
outputstr="<unprintable>";
148+
pq_putint(strlen(outputstr)+VARHDRSZ,VARHDRSZ);
149+
pq_putnchar(outputstr,strlen(outputstr));
150+
}
143151
}
144152
}
145153

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp