]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove unused 'countincludesself' argument to pq_sendcountedtext()
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 4 Mar 2024 10:56:05 +0000 (12:56 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 4 Mar 2024 10:56:05 +0000 (12:56 +0200)
It has been unused since we removed support for protocol version 2.

src/backend/access/common/printsimple.c
src/backend/access/common/printtup.c
src/backend/libpq/pqformat.c
src/backend/replication/logical/proto.c
src/backend/tcop/fastpath.c
src/include/libpq/pqformat.h

index 469fe0baaf0d7bab8875087a8955fad1e8433ff9..8134c3be0cad9eb6731564e3fbd573e1d515c7d7 100644 (file)
@@ -95,8 +95,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
 
                                        pq_sendcountedtext(&buf,
                                                                           VARDATA_ANY(t),
-                                                                          VARSIZE_ANY_EXHDR(t),
-                                                                          false);
+                                                                          VARSIZE_ANY_EXHDR(t));
                                }
                                break;
 
@@ -107,7 +106,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
                                        int                     len;
 
                                        len = pg_ltoa(num, str);
-                                       pq_sendcountedtext(&buf, str, len, false);
+                                       pq_sendcountedtext(&buf, str, len);
                                }
                                break;
 
@@ -118,7 +117,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
                                        int                     len;
 
                                        len = pg_lltoa(num, str);
-                                       pq_sendcountedtext(&buf, str, len, false);
+                                       pq_sendcountedtext(&buf, str, len);
                                }
                                break;
 
@@ -129,7 +128,7 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
                                        int                     len;
 
                                        len = pg_ultoa_n(num, str);
-                                       pq_sendcountedtext(&buf, str, len, false);
+                                       pq_sendcountedtext(&buf, str, len);
                                }
                                break;
 
index 8a4953ea033e4e3557f5abeb3d10ae62a282fef4..ba0f8f5407afedd1aedb796a48d2fe09515b9cbf 100644 (file)
@@ -355,7 +355,7 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
                        char       *outputstr;
 
                        outputstr = OutputFunctionCall(&thisState->finfo, attr);
-                       pq_sendcountedtext(buf, outputstr, strlen(outputstr), false);
+                       pq_sendcountedtext(buf, outputstr, strlen(outputstr));
                }
                else
                {
index a697ccfbbf944c892a817911b0e0b2edca9c8f2f..aa9433bb3b240f3daffa0275257421bb19f11328 100644 (file)
@@ -133,30 +133,27 @@ pq_sendbytes(StringInfo buf, const void *data, int datalen)
  *             pq_sendcountedtext - append a counted text string (with character set conversion)
  *
  * The data sent to the frontend by this routine is a 4-byte count field
- * followed by the string.  The count includes itself or not, as per the
- * countincludesself flag (pre-3.0 protocol requires it to include itself).
- * The passed text string need not be null-terminated, and the data sent
- * to the frontend isn't either.
+ * followed by the string.  The count does not include itself, as required by
+ * protocol version 3.0.  The passed text string need not be null-terminated,
+ * and the data sent to the frontend isn't either.
  * --------------------------------
  */
 void
-pq_sendcountedtext(StringInfo buf, const char *str, int slen,
-                                  bool countincludesself)
+pq_sendcountedtext(StringInfo buf, const char *str, int slen)
 {
-       int                     extra = countincludesself ? 4 : 0;
        char       *p;
 
        p = pg_server_to_client(str, slen);
        if (p != str)                           /* actual conversion has been done? */
        {
                slen = strlen(p);
-               pq_sendint32(buf, slen + extra);
+               pq_sendint32(buf, slen);
                appendBinaryStringInfoNT(buf, p, slen);
                pfree(p);
        }
        else
        {
-               pq_sendint32(buf, slen + extra);
+               pq_sendint32(buf, slen);
                appendBinaryStringInfoNT(buf, str, slen);
        }
 }
index f273005c15d3cde92e5f75f3c6dabe8a2e490302..95c09c95167d02b6ecd651b5ef251c3b5f8a9e71 100644 (file)
@@ -851,7 +851,7 @@ logicalrep_write_tuple(StringInfo out, Relation rel, TupleTableSlot *slot,
 
                        pq_sendbyte(out, LOGICALREP_COLUMN_TEXT);
                        outputstr = OidOutputFunctionCall(typclass->typoutput, values[i]);
-                       pq_sendcountedtext(out, outputstr, strlen(outputstr), false);
+                       pq_sendcountedtext(out, outputstr, strlen(outputstr));
                        pfree(outputstr);
                }
 
index e35bee38f6e4c8c75ccc9cfd9e7521ebaad39b0c..83b5120d17b262844a5829252925ddb15d4f00b2 100644 (file)
@@ -85,7 +85,7 @@ SendFunctionResult(Datum retval, bool isnull, Oid rettype, int16 format)
 
                        getTypeOutputInfo(rettype, &typoutput, &typisvarlena);
                        outputstr = OidOutputFunctionCall(typoutput, retval);
-                       pq_sendcountedtext(&buf, outputstr, strlen(outputstr), false);
+                       pq_sendcountedtext(&buf, outputstr, strlen(outputstr));
                        pfree(outputstr);
                }
                else if (format == 1)
index a710bc18687270e66ea6c999a0b32b611de30942..7f48cbded97a72fa779deb4b5c875a434c500166 100644 (file)
@@ -23,8 +23,7 @@ extern void pq_endmessage(StringInfo buf);
 extern void pq_endmessage_reuse(StringInfo buf);
 
 extern void pq_sendbytes(StringInfo buf, const void *data, int datalen);
-extern void pq_sendcountedtext(StringInfo buf, const char *str, int slen,
-                                                          bool countincludesself);
+extern void pq_sendcountedtext(StringInfo buf, const char *str, int slen);
 extern void pq_sendtext(StringInfo buf, const char *str, int slen);
 extern void pq_sendstring(StringInfo buf, const char *str);
 extern void pq_send_ascii_string(StringInfo buf, const char *str);