MCPcopy Create free account
hub / github.com/apache/cloudberry / pqTraceOutputNoTypeByteMessage

Function pqTraceOutputNoTypeByteMessage

src/interfaces/libpq/fe-trace.c:693–729  ·  view source on GitHub ↗

* Print special messages (those containing no type byte) to the trace output * stream. */

Source from the content-addressed store, hash-verified

691 * stream.
692 */
693void
694pqTraceOutputNoTypeByteMessage(PGconn *conn, const char *message)
695{
696 int length;
697 int logCursor = 0;
698
699 if ((conn->traceFlags & PQTRACE_SUPPRESS_TIMESTAMPS) == 0)
700 {
701 char timestr[128];
702
703 pqTraceFormatTimestamp(timestr, sizeof(timestr));
704 fprintf(conn->Pfdebug, "%s\t", timestr);
705 }
706
707 memcpy(&length, message + logCursor, 4);
708 length = (int) pg_ntoh32(length);
709 logCursor += 4;
710
711 fprintf(conn->Pfdebug, "F\t%d\t", length);
712
713 switch (length)
714 {
715 case 16: /* CancelRequest */
716 fprintf(conn->Pfdebug, "CancelRequest\t");
717 pqTraceOutputInt32(conn->Pfdebug, message, &logCursor, false);
718 pqTraceOutputInt32(conn->Pfdebug, message, &logCursor, false);
719 pqTraceOutputInt32(conn->Pfdebug, message, &logCursor, false);
720 break;
721 case 8: /* GSSENCRequest or SSLRequest */
722 /* These messages do not reach here. */
723 default:
724 fprintf(conn->Pfdebug, "Unknown message: length is %d", length);
725 break;
726 }
727
728 fputc('\n', conn->Pfdebug);
729}

Callers 1

pqPutMsgEndNoAutoFlushFunction · 0.85

Calls 2

pqTraceFormatTimestampFunction · 0.85
pqTraceOutputInt32Function · 0.85

Tested by

no test coverage detected