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

Function PQreset

src/interfaces/libpq/fe-connect.c:4409–4441  ·  view source on GitHub ↗

* PQreset: resets the connection to the backend by closing the * existing connection and creating a new one. */

Source from the content-addressed store, hash-verified

4407 * existing connection and creating a new one.
4408 */
4409void
4410PQreset(PGconn *conn)
4411{
4412 if (conn)
4413 {
4414 closePGconn(conn);
4415
4416 if (connectDBStart(conn) && connectDBComplete(conn))
4417 {
4418 /*
4419 * Notify event procs of successful reset. We treat an event proc
4420 * failure as disabling the connection ... good idea?
4421 */
4422 int i;
4423
4424 for (i = 0; i < conn->nEvents; i++)
4425 {
4426 PGEventConnReset evt;
4427
4428 evt.conn = conn;
4429 if (!conn->events[i].proc(PGEVT_CONNRESET, &evt,
4430 conn->events[i].passThrough))
4431 {
4432 conn->status = CONNECTION_BAD;
4433 appendPQExpBuffer(&conn->errorMessage,
4434 libpq_gettext("PGEventProc \"%s\" failed during PGEVT_CONNRESET event\n"),
4435 conn->events[i].name);
4436 break;
4437 }
4438 }
4439 }
4440 }
4441}
4442
4443
4444/*

Callers 1

CheckConnectionFunction · 0.85

Calls 5

closePGconnFunction · 0.85
connectDBStartFunction · 0.85
connectDBCompleteFunction · 0.85
appendPQExpBufferFunction · 0.85
libpq_gettextFunction · 0.85

Tested by

no test coverage detected