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

Function pqTraceOutputNchar

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

* pqTraceOutputNchar: output a string of exactly len bytes message to the log */

Source from the content-addressed store, hash-verified

185 * pqTraceOutputNchar: output a string of exactly len bytes message to the log
186 */
187static void
188pqTraceOutputNchar(FILE *pfdebug, int len, const char *data, int *cursor)
189{
190 int i,
191 next; /* first char not yet printed */
192 const char *v = data + *cursor;
193
194 fprintf(pfdebug, " \'");
195
196 for (next = i = 0; i < len; ++i)
197 {
198 if (isprint((unsigned char) v[i]))
199 continue;
200 else
201 {
202 fwrite(v + next, 1, i - next, pfdebug);
203 fprintf(pfdebug, "\\x%02x", v[i]);
204 next = i + 1;
205 }
206 }
207 if (next < len)
208 fwrite(v + next, 1, len - next, pfdebug);
209
210 fprintf(pfdebug, "\'");
211 *cursor += len;
212}
213
214/*
215 * Output functions by protocol message type

Callers 4

pqTraceOutputBFunction · 0.85
pqTraceOutputDFunction · 0.85
pqTraceOutputFFunction · 0.85
pqTraceOutputVFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected