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

Function PQconsumeInput

src/interfaces/libpq/fe-exec.c:1938–1966  ·  view source on GitHub ↗

* Consume any available input from the backend * 0 return: some kind of trouble * 1 return: no problem */

Source from the content-addressed store, hash-verified

1936 * 1 return: no problem
1937 */
1938int
1939PQconsumeInput(PGconn *conn)
1940{
1941 if (!conn)
1942 return 0;
1943
1944 /*
1945 * for non-blocking connections try to flush the send-queue, otherwise we
1946 * may never get a response for something that may not have already been
1947 * sent because it's in our write buffer!
1948 */
1949 if (pqIsnonblocking(conn))
1950 {
1951 if (pqFlush(conn) < 0)
1952 return 0;
1953 }
1954
1955 /*
1956 * Load more data, if available. We do this no matter what state we are
1957 * in, since we are probably getting called because the application wants
1958 * to get rid of a read-select condition. Note that we will NOT block
1959 * waiting for more input.
1960 */
1961 if (pqReadData(conn) < 0)
1962 return 0;
1963
1964 /* Parsing of the data waits till later. */
1965 return 1;
1966}
1967
1968
1969/*

Callers 15

pgfdw_get_resultFunction · 0.85
pgfdw_get_cleanup_resultFunction · 0.85
dblink_is_busyFunction · 0.85
dblink_get_notifyFunction · 0.85
ftsReceiveFunction · 0.85
ManageCronTaskFunction · 0.85
libpqrcv_PQgetResultFunction · 0.85
libpqrcv_receiveFunction · 0.85
processResultsFunction · 0.85
wait_on_slotsFunction · 0.85
try_complete_stepFunction · 0.85

Calls 2

pqFlushFunction · 0.85
pqReadDataFunction · 0.85

Tested by 5

try_complete_stepFunction · 0.68
test_nosyncFunction · 0.68
test_pipelined_insertFunction · 0.68
test_uniqviolFunction · 0.68
mainFunction · 0.68