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

Function executeMaintenanceCommand

src/fe_utils/query_utils.c:73–92  ·  view source on GitHub ↗

* As above for a SQL maintenance command (returns command success). * Command is executed with a cancel handler set, so Ctrl-C can * interrupt it. */

Source from the content-addressed store, hash-verified

71 * interrupt it.
72 */
73bool
74executeMaintenanceCommand(PGconn *conn, const char *query, bool echo)
75{
76 PGresult *res;
77 bool r;
78
79 if (echo)
80 printf("%s\n", query);
81
82 SetCancelConn(conn);
83 res = PQexec(conn, query);
84 ResetCancelConn();
85
86 r = (res && PQresultStatus(res) == PGRES_COMMAND_OK);
87
88 if (res)
89 PQclear(res);
90
91 return r;
92}

Callers 2

cluster_one_databaseFunction · 0.85
run_reindex_commandFunction · 0.85

Calls 5

SetCancelConnFunction · 0.85
PQexecFunction · 0.85
ResetCancelConnFunction · 0.85
PQresultStatusFunction · 0.85
PQclearFunction · 0.85

Tested by

no test coverage detected