1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Add resetStringInfo(), which clears the content of a StringInfo, and

fixup various places in the tree that were clearing a StringInfo by hand.
Making this function a part of the API simplifies client code slightly,
and avoids needlessly peeking inside the StringInfo interface.
This commit is contained in:
Neil Conway
2007-03-03 19:32:55 +00:00
parent 053981f405
commit 90d76525c5
11 changed files with 57 additions and 69 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.95 2007/01/05 22:19:39 momjian Exp $
* $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.96 2007/03/03 19:32:54 neilc Exp $
*
* NOTES
* This cruft is the server side of PQfn.
@ -480,10 +480,7 @@ parse_fcall_arguments(StringInfo msgBuf, struct fp_info * fip,
argsize)));
/* Reset abuf to empty, and insert raw data into it */
abuf.len = 0;
abuf.data[0] = '\0';
abuf.cursor = 0;
resetStringInfo(&abuf);
appendBinaryStringInfo(&abuf,
pq_getmsgbytes(msgBuf, argsize),
argsize);
@ -613,10 +610,7 @@ parse_fcall_arguments_20(StringInfo msgBuf, struct fp_info * fip,
argsize)));
/* Reset abuf to empty, and insert raw data into it */
abuf.len = 0;
abuf.data[0] = '\0';
abuf.cursor = 0;
resetStringInfo(&abuf);
appendBinaryStringInfo(&abuf,
pq_getmsgbytes(msgBuf, argsize),
argsize);