@@ -109,21 +109,18 @@ pgfdw_cancel_query(PGconn *conn)
109
109
{
110
110
if (!PQcancel (cancel , errbuf , sizeof (errbuf )))
111
111
{
112
- printf ("LAV: Cancel - ERROR\n" );
113
112
ereport (WARNING ,
114
113
(errcode (ERRCODE_CONNECTION_FAILURE ),
115
114
errmsg ("could not send cancel request: %s" ,
116
115
errbuf )));
117
116
PQfreeCancel (cancel );
118
117
return false;
119
118
}
120
- else
121
- printf ("LAV: Cancel - OK\n" );
122
119
123
120
PQfreeCancel (cancel );
124
121
}
125
122
else
126
- printf ( "---ERROR--- " );
123
+ elog ( FATAL , "Can't get connection cancel descriptor " );
127
124
128
125
PQconsumeInput (conn );
129
126
PQclear (result );
@@ -147,17 +144,9 @@ cancelQueryIfNeeded(PGconn *conn, const char *query)
147
144
PQerrorMessage (conn ));
148
145
149
146
res = PQgetResult (conn );
150
- // printf("status AFTER result request=%d, txs: %d errmsg: %s, resstatus: %s\n",
151
- // PQstatus(conn),
152
- // PQtransactionStatus(conn),
153
- // PQerrorMessage(conn),
154
- // PQresStatus(PQresultStatus(res)));
147
+
155
148
if (PQresultStatus (res ) == PGRES_FATAL_ERROR )
156
- // {
157
149
Assert (pgfdw_cancel_query (conn ));
158
- // printf("TRY to CANCEL query. status=%d, txs: %d errmsg: %s, resstatus: %s\n", PQstatus(conn), PQtransactionStatus(conn), PQerrorMessage(conn),
159
- // PQresStatus(PQresultStatus(res)));
160
- // }
161
150
else
162
151
pgfdw_get_result (conn , query );
163
152
}
@@ -233,7 +222,6 @@ HOOK_Utility_injection(PlannedStmt *pstmt,
233
222
dest , completionTag );
234
223
if (conn )
235
224
cancelQueryIfNeeded (conn , queryString );
236
- // pgfdw_get_result(conn, queryString);
237
225
}
238
226
239
227
0 commit comments