Fix long standing bind bug with query cache.
authorTatsuo Ishii <ishii@postgresql.org>
Thu, 8 May 2025 10:49:10 +0000 (19:49 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Thu, 8 May 2025 12:22:28 +0000 (21:22 +0900)
commit14d3789805d22fccabcc3b9fd6ac35a3c35a6ebd
treefadbc56953076c772854bf8c8c7ec7f2285ea3dd
parent430bec31ae98661331568e7e784dc29c8297a40c
Fix long standing bind bug with query cache.

When a named statement is prepared, it is possible to bind then
execute without a parse message. Problem is, table oids which are
necessary to invalidate query cache at execute or COMMIT was collected
only in parse messages process (Parse()). Thus if bind is executed
without parse after previous execute, no table oids were collected,
and pgpool failed to invalidate query cache.

Fix is collecting table oids at bind time too.

Add regression test to 006.memqcache.

Problem reported by and test program provided by Achilleas Mantzios
<a.mantzios@cloud.gatewaynet.com>.

Discussion: [pgpool-general: 9427] Clarification on query results cache visibility
https://www.pgpool.net/pipermail/pgpool-general/2025-April/009430.html

Backpatch-through: v4.2
src/protocol/pool_proto_modules.c
src/test/regression/tests/006.memqcache/expected.6 [new file with mode: 0644]
src/test/regression/tests/006.memqcache/expected.7 [new file with mode: 0644]
src/test/regression/tests/006.memqcache/query_cache_bug6.data [new file with mode: 0644]
src/test/regression/tests/006.memqcache/query_cache_bug7.data [new file with mode: 0644]
src/test/regression/tests/006.memqcache/test.sh