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

Function PQfn

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

Source from the content-addressed store, hash-verified

2869 */
2870
2871PGresult *
2872PQfn(PGconn *conn,
2873 int fnid,
2874 int *result_buf,
2875 int *result_len,
2876 int result_is_int,
2877 const PQArgBlock *args,
2878 int nargs)
2879{
2880 *result_len = 0;
2881
2882 if (!conn)
2883 return NULL;
2884
2885 /*
2886 * Since this is the beginning of a query cycle, reset the error buffer.
2887 */
2888 resetPQExpBuffer(&conn->errorMessage);
2889
2890 if (conn->pipelineStatus != PQ_PIPELINE_OFF)
2891 {
2892 appendPQExpBufferStr(&conn->errorMessage,
2893 libpq_gettext("PQfn not allowed in pipeline mode\n"));
2894 return NULL;
2895 }
2896
2897 if (conn->sock == PGINVALID_SOCKET || conn->asyncStatus != PGASYNC_IDLE ||
2898 conn->result != NULL)
2899 {
2900 appendPQExpBufferStr(&conn->errorMessage,
2901 libpq_gettext("connection in wrong state\n"));
2902 return NULL;
2903 }
2904
2905 return pqFunctionCall3(conn, fnid,
2906 result_buf, result_len,
2907 result_is_int,
2908 args, nargs);
2909}
2910
2911/* ====== Pipeline mode support ======== */
2912

Callers 15

mainFunction · 0.85
mainFunction · 0.85
lo_openFunction · 0.85
lo_closeFunction · 0.85
lo_truncateFunction · 0.85
lo_truncate64Function · 0.85
lo_readFunction · 0.85
lo_writeFunction · 0.85
lo_lseekFunction · 0.85
lo_lseek64Function · 0.85
lo_creatFunction · 0.85
lo_createFunction · 0.85

Calls 4

resetPQExpBufferFunction · 0.85
appendPQExpBufferStrFunction · 0.85
libpq_gettextFunction · 0.85
pqFunctionCall3Function · 0.85

Tested by 2

mainFunction · 0.68
mainFunction · 0.68