OSDN Git Service

SendFunctionResult should take care to detoast varlena results.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 7 Jan 2003 22:32:10 +0000 (22:32 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 7 Jan 2003 22:32:10 +0000 (22:32 +0000)
src/backend/tcop/fastpath.c

index d4bb1e3..554ea57 100644 (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);