Fix segfault in end_internal_transaction().
authorTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 2 Jun 2022 07:55:10 +0000 (16:55 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 2 Jun 2022 07:58:05 +0000 (16:58 +0900)
This was introduced by the commit:
https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=050be475d738ab4f8268dce21e2e5361b7dbcbee

In raw mode, end_internal_transaction() should not be called.

src/protocol/pool_process_query.c

index 409d6b0332994cd1a9e900cf6ae7d2f3172d40ba..ea66ed6289c10d908727783f0ab6f2c5190563f4 100644 (file)
@@ -4126,6 +4126,9 @@ end_internal_transaction(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * back
        char            tstate;
        pool_sigset_t oldmask;
 
+       if (!REPLICATION)
+               return POOL_CONTINUE;
+
        /*
         * We must block all signals. If pgpool SIGTERM, SIGINT or SIGQUIT is
         * delivered, it could cause data inconsistency.