From a4c15f4595fc2ab5b5ac58eedf96b5b5119e074e Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Sat, 14 Sep 2024 09:54:56 +0900 Subject: [PATCH] Fix bug in replication/snapshot isolation mode. When INSERT command is received, pgpool automatically issues table LOCK command to the target table but it forgot to send the command to other than main nodes. This only happened in extended query mode. This commit fixes the bug. Discussion: GitHub issue #69. https://github.com/pgpool/pgpool2/issues/69 Backpatch-through: v4.1 --- src/protocol/pool_process_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol/pool_process_query.c b/src/protocol/pool_process_query.c index 2eb877f9f..2aab2b29d 100644 --- a/src/protocol/pool_process_query.c +++ b/src/protocol/pool_process_query.c @@ -2835,7 +2835,7 @@ insert_lock(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *qu per_node_statement_log(backend, i, qbuf); if (pool_get_session_context(true) && pool_is_doing_extended_query_message()) { - do_query(MAIN(backend), qbuf, &result, MAJOR(backend)); + do_query(CONNECTION(backend, i), qbuf, &result, MAJOR(backend)); if (result) free_select_result(result); } -- 2.39.5