Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 24eebc6

Browse files
committed
Remove unused 'countincludesself' argument to pq_sendcountedtext()
It has been unused since we removed support for protocol version 2.
1 parent 0dd094c commit 24eebc6

File tree

6 files changed

+14
-19
lines changed

6 files changed

+14
-19
lines changed

src/backend/access/common/printsimple.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
9595

9696
pq_sendcountedtext(&buf,
9797
VARDATA_ANY(t),
98-
VARSIZE_ANY_EXHDR(t),
99-
false);
98+
VARSIZE_ANY_EXHDR(t));
10099
}
101100
break;
102101

@@ -107,7 +106,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
107106
int len;
108107

109108
len = pg_ltoa(num, str);
110-
pq_sendcountedtext(&buf, str, len, false);
109+
pq_sendcountedtext(&buf, str, len);
111110
}
112111
break;
113112

@@ -118,7 +117,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
118117
int len;
119118

120119
len = pg_lltoa(num, str);
121-
pq_sendcountedtext(&buf, str, len, false);
120+
pq_sendcountedtext(&buf, str, len);
122121
}
123122
break;
124123

@@ -129,7 +128,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
129128
int len;
130129

131130
len = pg_ultoa_n(num, str);
132-
pq_sendcountedtext(&buf, str, len, false);
131+
pq_sendcountedtext(&buf, str, len);
133132
}
134133
break;
135134

src/backend/access/common/printtup.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
355355
char *outputstr;
356356

357357
outputstr = OutputFunctionCall(&thisState->finfo, attr);
358-
pq_sendcountedtext(buf, outputstr, strlen(outputstr), false);
358+
pq_sendcountedtext(buf, outputstr, strlen(outputstr));
359359
}
360360
else
361361
{

src/backend/libpq/pqformat.c

+6-9
Original file line numberDiff line numberDiff line change
@@ -133,30 +133,27 @@ pq_sendbytes(StringInfo buf, const void *data, int datalen)
133133
* pq_sendcountedtext - append a counted text string (with character set conversion)
134134
*
135135
* The data sent to the frontend by this routine is a 4-byte count field
136-
* followed by the string. The count includes itself or not, as per the
137-
* countincludesself flag (pre-3.0 protocol requires it to include itself).
138-
* The passed text string need not be null-terminated, and the data sent
139-
* to the frontend isn't either.
136+
* followed by the string. The count does not include itself, as required by
137+
* protocol version 3.0. The passed text string need not be null-terminated,
138+
* and the data sent to the frontend isn't either.
140139
* --------------------------------
141140
*/
142141
void
143-
pq_sendcountedtext(StringInfo buf, const char *str, int slen,
144-
bool countincludesself)
142+
pq_sendcountedtext(StringInfo buf, const char *str, int slen)
145143
{
146-
int extra = countincludesself ? 4 : 0;
147144
char *p;
148145

149146
p = pg_server_to_client(str, slen);
150147
if (p != str) /* actual conversion has been done? */
151148
{
152149
slen = strlen(p);
153-
pq_sendint32(buf, slen + extra);
150+
pq_sendint32(buf, slen);
154151
appendBinaryStringInfoNT(buf, p, slen);
155152
pfree(p);
156153
}
157154
else
158155
{
159-
pq_sendint32(buf, slen + extra);
156+
pq_sendint32(buf, slen);
160157
appendBinaryStringInfoNT(buf, str, slen);
161158
}
162159
}

src/backend/replication/logical/proto.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ logicalrep_write_tuple(StringInfo out, Relation rel, TupleTableSlot *slot,
851851

852852
pq_sendbyte(out, LOGICALREP_COLUMN_TEXT);
853853
outputstr = OidOutputFunctionCall(typclass->typoutput, values[i]);
854-
pq_sendcountedtext(out, outputstr, strlen(outputstr), false);
854+
pq_sendcountedtext(out, outputstr, strlen(outputstr));
855855
pfree(outputstr);
856856
}
857857

src/backend/tcop/fastpath.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ SendFunctionResult(Datum retval, bool isnull, Oid rettype, int16 format)
8585

8686
getTypeOutputInfo(rettype, &typoutput, &typisvarlena);
8787
outputstr = OidOutputFunctionCall(typoutput, retval);
88-
pq_sendcountedtext(&buf, outputstr, strlen(outputstr), false);
88+
pq_sendcountedtext(&buf, outputstr, strlen(outputstr));
8989
pfree(outputstr);
9090
}
9191
else if (format == 1)

src/include/libpq/pqformat.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ extern void pq_endmessage(StringInfo buf);
2323
extern void pq_endmessage_reuse(StringInfo buf);
2424

2525
extern void pq_sendbytes(StringInfo buf, const void *data, int datalen);
26-
extern void pq_sendcountedtext(StringInfo buf, const char *str, int slen,
27-
bool countincludesself);
26+
extern void pq_sendcountedtext(StringInfo buf, const char *str, int slen);
2827
extern void pq_sendtext(StringInfo buf, const char *str, int slen);
2928
extern void pq_sendstring(StringInfo buf, const char *str);
3029
extern void pq_send_ascii_string(StringInfo buf, const char *str);

0 commit comments

Comments
 (0)