@@ -368,21 +368,21 @@ static void
368
368
do_sql_send_command (PGconn * conn , const char * sql )
369
369
{
370
370
if (PQsendQuery (conn , sql ) != PGRES_COMMAND_OK ) {
371
- PGresult * res = PQgetResult (conn );
371
+ PGresult * res = PQgetResult (conn );
372
372
pgfdw_report_error (ERROR , res , conn , true, sql );
373
- PQclear (res );
374
- }
373
+ PQclear (res );
374
+ }
375
375
}
376
376
377
377
static void
378
378
do_sql_wait_command (PGconn * conn , const char * sql )
379
379
{
380
- PGresult * res ;
381
- while ((res = PQgetResult (conn )) != NULL ) {
382
- if (PQresultStatus (res ) != PGRES_COMMAND_OK )
383
- pgfdw_report_error (ERROR , res , conn , true, sql );
384
- PQclear (res );
385
- }
380
+ PGresult * res ;
381
+ while ((res = PQgetResult (conn )) != NULL ) {
382
+ if (PQresultStatus (res ) != PGRES_COMMAND_OK )
383
+ pgfdw_report_error (ERROR , res , conn , true, sql );
384
+ PQclear (res );
385
+ }
386
386
}
387
387
388
388
/*
@@ -403,20 +403,20 @@ begin_remote_xact(ConnCacheEntry *entry)
403
403
/* Start main transaction if we haven't yet */
404
404
if (entry -> xact_depth <= 0 )
405
405
{
406
- TransactionId gxid = GetTransactionManager ()-> GetGlobalTransactionId ();
406
+ TransactionId gxid = GetTransactionManager ()-> GetGlobalTransactionId ();
407
407
const char * sql ;
408
408
409
409
elog (DEBUG3 , "starting remote transaction on connection %p" ,
410
410
entry -> conn );
411
411
412
- if (TransactionIdIsValid (gxid )) {
413
- char stmt [64 ];
414
- PGresult * res ;
412
+ if (TransactionIdIsValid (gxid )) {
413
+ char stmt [64 ];
414
+ PGresult * res ;
415
415
416
- snprintf (stmt , sizeof (stmt ), "select public.dtm_join_transaction(%d)" , gxid );
417
- res = PQexec (entry -> conn , stmt );
418
- PQclear (res );
419
- }
416
+ snprintf (stmt , sizeof (stmt ), "select public.dtm_join_transaction(%d)" , gxid );
417
+ res = PQexec (entry -> conn , stmt );
418
+ PQclear (res );
419
+ }
420
420
421
421
if (IsolationIsSerializable ())
422
422
sql = "START TRANSACTION ISOLATION LEVEL SERIALIZABLE" ;
@@ -607,7 +607,7 @@ pgfdw_xact_callback(XactEvent event, void *arg)
607
607
case XACT_EVENT_PARALLEL_COMMIT :
608
608
case XACT_EVENT_COMMIT :
609
609
case XACT_EVENT_PREPARE :
610
- do_sql_wait_command (entry -> conn , "COMMIT TRANSACTION" );
610
+ do_sql_wait_command (entry -> conn , "COMMIT TRANSACTION" );
611
611
/*
612
612
* If there were any errors in subtransactions, and we
613
613
* made prepared statements, do a DEALLOCATE ALL to make
@@ -680,17 +680,17 @@ pgfdw_xact_callback(XactEvent event, void *arg)
680
680
}
681
681
}
682
682
683
- if (event != XACT_EVENT_PARALLEL_PRE_COMMIT && event != XACT_EVENT_PRE_COMMIT ) {
684
- /*
685
- * Regardless of the event type, we can now mark ourselves as out of the
686
- * transaction. (Note: if we are here during PRE_COMMIT or PRE_PREPARE,
687
- * this saves a useless scan of the hashtable during COMMIT or PREPARE.)
688
- */
689
- xact_got_connection = false;
690
-
691
- /* Also reset cursor numbering for next transaction */
692
- cursor_number = 0 ;
693
- }
683
+ if (event != XACT_EVENT_PARALLEL_PRE_COMMIT && event != XACT_EVENT_PRE_COMMIT ) {
684
+ /*
685
+ * Regardless of the event type, we can now mark ourselves as out of the
686
+ * transaction. (Note: if we are here during PRE_COMMIT or PRE_PREPARE,
687
+ * this saves a useless scan of the hashtable during COMMIT or PREPARE.)
688
+ */
689
+ xact_got_connection = false;
690
+
691
+ /* Also reset cursor numbering for next transaction */
692
+ cursor_number = 0 ;
693
+ }
694
694
}
695
695
696
696
/*
0 commit comments