]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
libpq: Trace all NegotiateProtocolVersion fields
authorRobert Haas <rhaas@postgresql.org>
Mon, 24 Feb 2025 17:03:25 +0000 (12:03 -0500)
committerRobert Haas <rhaas@postgresql.org>
Mon, 24 Feb 2025 17:06:21 +0000 (12:06 -0500)
Previously, the names of the unsupported protocol options were not
traced. Since NegotiateProtocolVersion has not really been used yet,
that has not mattered much, but we hope to use it eventually, so let's
fix this.

Author: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://postgr.es/m/CAGECzQTfc_O+HXqAo5_-xG4r3EFVsTefUeQzSvhEyyLDba-O9w@mail.gmail.com

src/interfaces/libpq/fe-trace.c

index 641e70f321c2d43d81a16f6846c1f0d4fd753729..a45f0d855871bea65a2cd9a9a0fe68d7b976a1a3 100644 (file)
@@ -578,9 +578,15 @@ pqTraceOutput_RowDescription(FILE *f, const char *message, int *cursor, bool reg
 static void
 pqTraceOutput_NegotiateProtocolVersion(FILE *f, const char *message, int *cursor)
 {
+       int                     nparams;
+
        fprintf(f, "NegotiateProtocolVersion\t");
        pqTraceOutputInt32(f, message, cursor, false);
-       pqTraceOutputInt32(f, message, cursor, false);
+       nparams = pqTraceOutputInt32(f, message, cursor, false);
+       for (int i = 0; i < nparams; i++)
+       {
+               pqTraceOutputString(f, message, cursor, false);
+       }
 }
 
 static void