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

Function ReadCommand

src/backend/tcop/postgres.c:607–628  ·  view source on GitHub ↗

---------------- * ReadCommand reads a command from either the frontend or * standard input, places it in inBuf, and returns the * message type code (first byte of the message). * EOF is returned if end of file. * ---------------- */

Source from the content-addressed store, hash-verified

605 * ----------------
606 */
607static int
608ReadCommand(StringInfo inBuf)
609{
610 int result;
611
612 /*
613 * XXX Use of this fault is discouraged! This fault location is reached
614 * in query executing backends as well as many non-query executing
615 * processes such as FTS probe handler, walsender, etc. It is also found
616 * to be triggered by the same SQL statement used to inject the fault,
617 * causing difficult to analyse failures in CI. If a test intends to
618 * target a query executing backend process, consider using
619 * "exec_simple_query_start" fault.
620 */
621 SIMPLE_FAULT_INJECTOR("before_read_command");
622
623 if (whereToSendOutput == DestRemote)
624 result = SocketBackend(inBuf);
625 else
626 result = InteractiveBackend(inBuf);
627 return result;
628}
629
630/*
631 * ProcessClientReadInterrupt() - Process interrupts specific to client reads

Callers 1

PostgresMainFunction · 0.85

Calls 2

SocketBackendFunction · 0.85
InteractiveBackendFunction · 0.85

Tested by

no test coverage detected