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

Function PQsendQueryParams

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

* PQsendQueryParams * Like PQsendQuery, but use extended query protocol so we can pass parameters */

Source from the content-addressed store, hash-verified

1469 * Like PQsendQuery, but use extended query protocol so we can pass parameters
1470 */
1471int
1472PQsendQueryParams(PGconn *conn,
1473 const char *command,
1474 int nParams,
1475 const Oid *paramTypes,
1476 const char *const *paramValues,
1477 const int *paramLengths,
1478 const int *paramFormats,
1479 int resultFormat)
1480{
1481 if (!PQsendQueryStart(conn, true))
1482 return 0;
1483
1484 /* check the arguments */
1485 if (!command)
1486 {
1487 appendPQExpBufferStr(&conn->errorMessage,
1488 libpq_gettext("command string is a null pointer\n"));
1489 return 0;
1490 }
1491 if (nParams < 0 || nParams > PQ_QUERY_PARAM_MAX_LIMIT)
1492 {
1493 appendPQExpBuffer(&conn->errorMessage,
1494 libpq_gettext("number of parameters must be between 0 and %d\n"),
1495 PQ_QUERY_PARAM_MAX_LIMIT);
1496 return 0;
1497 }
1498
1499 return PQsendQueryGuts(conn,
1500 command,
1501 "", /* use unnamed statement */
1502 nParams,
1503 paramTypes,
1504 paramValues,
1505 paramLengths,
1506 paramFormats,
1507 resultFormat);
1508}
1509
1510/*
1511 * PQsendPrepare

Callers 12

create_cursorFunction · 0.85
execute_dml_stmtFunction · 0.85
test_multi_pipelinesFunction · 0.85
test_nosyncFunction · 0.85
test_pipeline_abortFunction · 0.85
test_pipelined_insertFunction · 0.85
test_simple_pipelineFunction · 0.85
test_singlerowmodeFunction · 0.85
test_transactionFunction · 0.85
PQexecParamsFunction · 0.85
receiveFileChunksFunction · 0.85
sendCommandFunction · 0.85

Calls 5

PQsendQueryStartFunction · 0.85
appendPQExpBufferStrFunction · 0.85
libpq_gettextFunction · 0.85
appendPQExpBufferFunction · 0.85
PQsendQueryGutsFunction · 0.85

Tested by 7

test_multi_pipelinesFunction · 0.68
test_nosyncFunction · 0.68
test_pipeline_abortFunction · 0.68
test_pipelined_insertFunction · 0.68
test_simple_pipelineFunction · 0.68
test_singlerowmodeFunction · 0.68
test_transactionFunction · 0.68