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

Function disconnectDatabase

src/fe_utils/connect_utils.c:162–181  ·  view source on GitHub ↗

* Disconnect the given connection, canceling any statement if one is active. */

Source from the content-addressed store, hash-verified

160 * Disconnect the given connection, canceling any statement if one is active.
161 */
162void
163disconnectDatabase(PGconn *conn)
164{
165 char errbuf[256];
166
167 Assert(conn != NULL);
168
169 if (PQtransactionStatus(conn) == PQTRANS_ACTIVE)
170 {
171 PGcancel *cancel;
172
173 if ((cancel = PQgetCancel(conn)))
174 {
175 (void) PQcancel(cancel, errbuf, sizeof(errbuf));
176 PQfreeCancel(cancel);
177 }
178 }
179
180 PQfinish(conn);
181}

Callers 6

ParallelSlotsGetIdleFunction · 0.85
ParallelSlotsAdoptConnFunction · 0.85
ParallelSlotsTerminateFunction · 0.85
mainFunction · 0.85
compile_database_listFunction · 0.85

Calls 5

PQtransactionStatusFunction · 0.85
PQgetCancelFunction · 0.85
PQcancelFunction · 0.85
PQfreeCancelFunction · 0.85
PQfinishFunction · 0.85

Tested by

no test coverage detected