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:19:31 +0000 (21:19 +0900)
commit35a5a79d623b0ae7023437ac0360fcb2f6300d19
treedd440c69f39d7514c192b4af4f6992392fc39789
parent5f7d06d87256d0db53a7ec35cd13196768e31c0f
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