From db754701724f1825de790d13f308b9962f858169 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 d2c1a9c08..114db9078 100644 --- a/src/protocol/pool_process_query.c +++ b/src/protocol/pool_process_query.c @@ -2794,7 +2794,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