SendFunctionResult should take care to detoast varlena results.

This commit is contained in:
Tom Lane 2003-01-07 22:32:10 +00:00
parent 9f1f2bfb66
commit 1bc9e98549
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.55 2003/01/01 21:57:05 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.56 2003/01/07 22:32:10 tgl Exp $
*
* NOTES
* This cruft is the server side of PQfn.
@ -97,7 +97,7 @@ SendFunctionResult(Datum retval, bool retbyval, int retlen)
{ /* by-reference ... */
if (retlen == -1)
{ /* ... varlena */
struct varlena *v = (struct varlena *) DatumGetPointer(retval);
struct varlena *v = PG_DETOAST_DATUM(retval);
pq_sendint(&buf, VARSIZE(v) - VARHDRSZ, VARHDRSZ);
pq_sendbytes(&buf, VARDATA(v), VARSIZE(v) - VARHDRSZ);