MCPcopy Create free account
hub / github.com/anse1/sqlsmith / connect

Method connect

postgres.cc:332–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332void dut_libpq::connect(std::string &conninfo)
333{
334 if (conn) {
335 PQfinish(conn);
336 }
337 conn = PQconnectdb(conninfo.c_str());
338 if (PQstatus(conn) != CONNECTION_OK)
339 {
340 char *errmsg = PQerrorMessage(conn);
341 if (strlen(errmsg))
342 throw dut::broken(errmsg, "08001");
343 }
344
345 command("set statement_timeout to '1s'");
346 command("set client_min_messages to 'ERROR';");
347 command("set application_name to '" PACKAGE "::dut';");
348
349 PQsetNoticeReceiver(conn, dut_libpq_notice_rx, (void *) 0);
350}
351
352dut_libpq::dut_libpq(std::string conninfo)
353 : conninfo_(conninfo)

Callers

nothing calls this directly

Calls 1

brokenClass · 0.85

Tested by

no test coverage detected